代码拉取完成,页面将自动刷新
#ifndef _MESSAGE_HPP_
#define _MESSAGE_HPP_
#include "list.h"
#include "base.hpp"
enum {
MSG_TIME, //time message
MSG_DSRC_RECV_DATA, //DSRC recv data message
MSG_DSRC_SEND_DATA, //DSRC send data message
MSG_RTK_GPS_DATA, //RTK GPS data message
MSG_RTK_DATA_FRAME, //RTK handle frame
MSG_ANTLET_RECV_DATA, //Antlet recv data message
MSG_ANTLET_SEND_DATA, //Anelet send data message
MSG_MICROMOVE_STATE, //micro move recv data message
MSG_MICROMOVE_DATA, //micro move send data message
MSG_GPS_DATA, //GPS data message
MSG_GPS_FIXED, //GPS fix position message
MSG_GPS_LOST, //GPS lose position message
MSG_GPS_POS, //GPS position message
MSG_SETTIME, //
MSG_KEY, //
MSG_SKEY, //
MSG_DIN, //
MSG_PULSE, //
MSG_PARA, //
MSG_POWER, //
MSG_IPC_STATE, //
MSG_IPC_DATA, //
MSG_DEVICE_DATA_NET, //network data message
MSG_DEVICE_STATE_NET, //network status message
MSG_DEVICE_DATA_GPRS, //GPRS
MSG_DEVICE_STATE_GPRS, //GPRS
MSG_DEVICE_SMSDATA_GPRS, //GPRS
MSG_DEVICE_SMSSTATE_GPRS, //GPRS
MSG_DEVICE_LINKDATA_GPRS, //GPRS
MSG_DEVICE_DATA_0, //0#
MSG_DEVICE_DATA_1, //1#
MSG_DEVICE_DATA_2, //2#
MSG_DEVICE_DATA_3, //3#
MSG_DEVICE_DATA_4, //4#
MSG_DEVICE_DATA_5, //5#
MSG_DEVICE_DATA_6, //6#
MSG_DEVICE_DATA_7, //7#
MSG_DEVICE_DATA_8, //8#
MSG_DEVICE_DATA_9, //8#
MSG_DEVICE_DATA_USBD, //USB device message
MSG_DEVICE_STATE_MCU, //MCU Read sate
MSG_DEVICE_STATE_FTP, //FTP update state message
MSG_DEVICE_CONNECT_FTP, //FTP connect state message
MSG_SIGNAL_LIGHT_DATA, //signal light data
MSG_FRAMEWORK_LAST //module message define begin
};
/*************************************************
structs define
*************************************************/
typedef struct
{
struct list_head list;
BASE *obj;
} sub_node_t;
/*************************************************
global static variable
*************************************************/
typedef struct
{
pthread_mutex_t mutex;
struct list_head list_busy; //message busy list·
struct list_head list_idle; //message idle list·
sub_node_t nodepool[CFG_MESSAGE_SUBSCRIBE_MAX];
} subinfo_st;
class message
{
public:
static subinfo_st subinfo[CFG_MESSAGE_TYPE_MAX];
// message();
// ~message();
/******************************************************************************
* Function: message_init
* Description: init message
* Param:
* Return: 0 - success
-ERR_SYS - message has been inited
-ERR_BUSY - module opend
* Comment: this muest be call in the frameworkinit func
******************************************************************************/
static int message_init (void);
/******************************************************************************
* Function: message_subscribe
* Description: subscribe message
* Param: obj - base object
type - message type
* Return: 0 - success
-ERR_SYS - system error
-ERR_INVAL - invalid param
-ERR_NOMEM - no memory
* Comment:
******************************************************************************/
static int message_subscribe (BASE *obj, u16 type);
/******************************************************************************
* Function: message_unsubscribe
* Description: unsubscribe message
* Param: obj - base object
type - message type
* Return: 0 - success
-ERR_SYS - system error
-ERR_INVAL - invald param
-ERR_NORECORD - no record
* Comment:
******************************************************************************/
static int message_unsubscribe (BASE *obj, u16 type);
/******************************************************************************
* Function: message_dispatch
* Description: publish message
* Param: msg - msg info
* Return: 0 - success
-ERR_SYS - system error
-ERR_INVAL - invalid param
-ERR_NOMEM - no memory
* Comment:
******************************************************************************/
static int message_dispatch (message_t *msg);
};
#endif/* _MESSAGE_HPP_ */
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。