📄 ext_transport232.h
字号:
/*
* File: ext_transport232.h
*
* Abstract:
* PUBLIC interface for ext_transport232.c.
*
* Raul Murillo, Frank Wornle, December 2002
*
*/
#ifndef _EXT_TRANSPORT232_H_
#define _EXT_TRANSPORT232_H_
/********************* DO NOT CHANGE BELOW THIS LINE **************************
* *
* The function prototypes below define the interface between ext_comm and *
* ext_custom. They should not need to be changed. Only the *
* implementation of these functions in ext_transport.c should need to be *
* modified. *
* *
******************************************************************************/
/* communication buffers (host), input and output */
#define COMBUFSIZE 2048 // increase this value, if a block diagram has many tunable parameters
//#define COMBUFSIZE 8192 // e. g. 'shower.c'
/*
* Export the user data as an 'opaque' or 'incomplete' data type. ext_comm
* may reference it (i.e., pass pointers to it, but it can not dereference
* the pointer).
*/
typedef struct UserData_tag {
HANDLE hCom; // serial interface handle
char_T TelType; // detected telegram type: 0, MSG, DAT or USR
boolean_T MsgTelIntercepted; // TRUE indicates the availability of an intercepted message telegram
boolean_T DataTelIntercepted; // TRUE indicates the availability of an intercepted (log) data telegram
boolean_T UsrTelIntercepted; // TRUE indicates the availability of an intercepted user telegram
boolean_T ExtDisconnectConfirmed; // flag for 'ExtDisconnectConfirmed received (8 0 0 0 5 0 0 0)
uint16_T port;
uint32_T baudrate;
} UserData;
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */
/* ----------------------------------------------------------------- */
/* moved from within transport232.c to make it visible to ext_comm.c */
/* ----------------------------------------------------------------- */
/*
* Define the transport interface.
*/
extern boolean_T ExtTargetTelPending(
ExternalSim *ES,
boolean_T *pending,
long int timeOutSecs,
long int timeOutUSecs);
extern boolean_T ExtGetTargetMsg(
ExternalSim *ES,
const int nBytesToGet,
int *nBytesGot,
char *dst);
extern boolean_T ExtGetTargetData(
ExternalSim *ES,
const int nBytesToGet,
int *nBytesGot,
char *dst);
extern boolean_T ExtSetTargetMsg(
const ExternalSim *ES,
const int nBytesToSet,
const char *src,
int *nBytesSet);
extern void ExtCloseConnection(ExternalSim *ES);
extern void ExtOpenConnection(ExternalSim *ES);
extern UserData *ExtUserDataCreate();
extern void ExtUserDataDestroy(UserData *userData);
extern void ExtProcessArgs(
ExternalSim *ES,
int nrhs,
const mxArray *prhs[]);
#endif /* _EXT_TRANSPORT232_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -