38 lines
1004 B
C++
38 lines
1004 B
C++
#ifndef _DMS_MQ_H_
|
||
#define _DMS_MQ_H_
|
||
|
||
#define MAX_MQBLK_NO 5
|
||
|
||
#include <cstdint>
|
||
|
||
enum{
|
||
MQERR_DISCONNECT = -1,
|
||
MQERR_FULL = -2,
|
||
MQERR_NOMSGID = -3,
|
||
MQERR_MSGCTL_FAILED = -4,
|
||
MQERR_BLOCKED = -5,
|
||
MQERR_LOSTMSG = -6,
|
||
MQERR_PACKERR = -7,
|
||
MQERR_THDERR = -8,
|
||
};
|
||
|
||
//初始化DMS的MQ序列 with_debug = 0, 不启用MQ的Debug日志, 1 启用MQ的debug日志
|
||
int dmsmq_init( int with_debug );
|
||
|
||
//接收DMS的MQ序列,阻塞方式。
|
||
// srvid 服务ID
|
||
// actid 动作ID
|
||
// data 数据指针
|
||
// 返回值 >= 0 数据长度, < 0 异常信息
|
||
int dmsmq_recv( int *srvid, int *actid, uint8_t *data );
|
||
|
||
// 发送DMS的MQ序列,立即返回。
|
||
// srvid 服务ID
|
||
// actid 动作ID
|
||
// data 发送数据指针
|
||
// len 发送数据长度
|
||
// 返回值 0 成功,< 0 异常信息
|
||
int dmsmq_send( int srvid, int actid, uint8_t *data, int len );
|
||
int dmsmq_sendx( int srvid, int actid, uint8_t *data, int len );
|
||
#endif
|