Files
GUI/src/device/dms_mq.h
2023-11-21 13:39:28 +08:00

38 lines
1004 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#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