Real-Time Workshop | ![]() ![]() |
Guidelines for Implementing the Transport Layer
Requirements
ext_svr.c
and updown.c
use malloc
to allocate buffers in target memory for messages, data collection, and other purposes. If your target uses some other memory allocation scheme, you must modify these modules appropriately.
int32_T
and uint32_T
data types.
Modifying ext_transport
The function prototypes in ext_transport.h
define the calling interface for the host (client) side transport layer functions. The implementation is in ext_transport.c
.
To implement the host side of your transport layer:
ext_transport.c
with functions that call your low-level communications primitives. The visible functions are called from other external mode modules such as ext_comm.c
. You must implement all the functions defined in ext_transport.h
. Your implementations must conform to the prototypes defined in ext_transport.h
.
UserData
structure in ext_transport.c
. This structure is required. If UserData
is not necessary for your external mode implementation, define a UserData
structure with one dummy field.
ext_transport_share.h
with functions that call your low-level communications primitives, or remove these functions. Functions defined in ext_transport_share.h
are common to the host and target, and are not part of the public interface to the transport layer.
ext_comm
MEX-file, using the MATLAB mex
command. This requires a compiler supported by the MATLAB API. See External Interfaces/API in the MATLAB online documentation for more information on the mex
command. The following table lists the form of the commands to build the standard ext_comm
module on PC and UNIX platforms. The ext_transport
and ext_transport_share
source code modules are fully commented. See these files for further details.
Guidelines for Modifying ext_svr_transport
The function prototypes in ext_svr_transport.h
define the calling interface for the target (server) side transport layer functions. The implementation is in ext_svr_transport.c
.
To implement the target side of your transport layer:
ext_svr_transport.c
with functions that call your low-level communications primitives. These are the functions called from other target modules such as the main program.
You must implement all the functions defined in ext_svr_transport.h
. Your implementations must conform to the prototypes defined in ext_svr_transport.h
.
ExtUserData
structure in ext_svr_transport.c
. This structure is required. If ExtUserData
is not necessary for your external mode implementation, define an ExtUserData
structure with one dummy field.
EXT_BLOCKING
conditional in ext_svr_transport.c
as needed:
The ext_svr_transport
source code modules are fully commented. See these files for further details.
![]() | External Mode Source Files | Combining Multiple Models | ![]() |