rtiostream_wrapper - Test rtiostream shared library methods

Syntax

STATION_ID = rtiostream_wrapper(SHARED_LIB,'open')
STATION_ID = rtiostream_wrapper(SHARED_LIB,'open','p1',v1,'p2', v2,...)
[RES,SIZE_SENT] = rtiostream_wrapper(SHARED_LIB,'send',ID, DATA, SIZE)
[RES,SIZE_RECVD] = rtiostream_wrapper(SHARED_LIB,'recv',ID, SIZE)
RES = rtiostream_wrapper(SHARED_LIB,'close',ID)
rtiostream_wrapper(SHARED_LIB, 'unloadlibrary')

Description

rtiostream_wrapper enables you to access the methods of an rtiostream shared library from M-code, for testing purposes.

STATION_ID = rtiostream_wrapper(SHARED_LIB,'open') opens an rtIOStream communication channel via a shared library.

If successful, STATION_ID is a handle to the channel. A value of -1 for STATION_ID indicates that the attempt to open a channel was unsuccessful. SHARED_LIB is the name of a shared library that implements the required rtIOStream functions rtIOStreamOpen, rtIOStreamSend, rtIOStreamRecv and rtIOStreamClose. The shared library must be on the system path.

STATION_ID = rtiostream_wrapper(SHARED_LIB,'open','p1',v1,'p2', v2,...) opens an rtIOStream communication channel via a shared library, where p1, v1 are additional parameter value pairs. These arguments are implementation dependent, i.e., they are specific to the shared library being called.

[RES,SIZE_SENT] = rtiostream_wrapper(SHARED_LIB,'send',ID, DATA, SIZE) sends DATA into the communication channel with handle ID, and attempts to send SIZE bytes. A value of RES==-1 indicates that an error occurred, and RES==0 indicates no error. SIZE_SENT is the number of bytes accepted by the communication channel. SIZE_SENT may be less than SIZE, i.e., the requested number of bytes to send.

[RES,SIZE_RECVD] = rtiostream_wrapper(SHARED_LIB,'recv',ID, SIZE) receives up to SIZE bytes of DATA from the communication channel with handle ID. A value of RES==-1 indicates that an error occurred, and RES==0 indicates no error. SIZE_RECVD is the number of bytes actually received from the channel. SIZE_RECVD may be less than SIZE, i.e., the requested number of bytes to send.

RES = rtiostream_wrapper(SHARED_LIB,'close',ID) closes the communication channel with handle ID.

rtiostream_wrapper(SHARED_LIB, 'unloadlibrary') unloads the SHARED_LIB, clearing any persistent data.

See Also

rtIOStreamOpen, rtIOStreamSend, rtIOStreamRecv, rtIOStreamClose

Creating a Connectivity Configuration for Your Target in the Real-Time Workshop Embedded Coder documentation.

rtwdemo_rtiostream

rtwdemo_custom_pil

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS