Main Content

rtIOStreamOpen

Initialize communications channel

Description

example

streamID = rtIOStreamOpen(argCount, argValues) initializes a communication stream to allow the exchange of data between the development computer and target processor.

Examples

Initialize Communications Channel

This code from rtiostreamtest.c initializes a communication stream and checks for errors.

static int openServer(int rtArgc, void * rtArgv [])
{
    streamID = rtIOStreamOpen(rtArgc, rtArgv);
    if (streamID == RTIOSTREAM_ERROR)
    {
        return streamID;
    }
    return RTIOSTREAM_NO_ERROR;
}

Input Arguments

collapse all

Number of elements in argValues array.

Parameters for the communications driver.

Output Arguments

collapse all

If the function initializes a communication stream, it returns a positive integer that represents the stream handle. Otherwise, it returns -1, which indicates an error.

The rtiostream.h file defines this macro:

#define RTIOSTREAM_ERROR (-1)

Introduced in R2009a