提交SMOD ATSC IMX APP版本 V122
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
#ifndef __MSG_H__
|
||||
#define __MSG_H__
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/msg.h>
|
||||
#include "../inc/type.h"
|
||||
#include "../inc/isys_config.h"
|
||||
|
||||
|
||||
#define MAX_TEXT 512
|
||||
|
||||
#define CTTB_MSG 2222
|
||||
//#define MSG_NEED_FREE 0x55
|
||||
|
||||
|
||||
// MSG结构体里
|
||||
typedef enum {
|
||||
MSG_WEB_DATA = 1,
|
||||
|
||||
|
||||
MSG_DATA_MAX_END
|
||||
}ENUM_MSG_TYPE;
|
||||
|
||||
|
||||
//typedef struct {
|
||||
// uint16 type;
|
||||
// uint16 need_free; //若为申请消息,此位不要用,默认已填充释放标记
|
||||
// uint16 rPara;
|
||||
// uint32 lPara;
|
||||
//}MSG,*pMSG;
|
||||
|
||||
struct msg_st {
|
||||
long mtype;
|
||||
MSG msg; // 内含 旧msg 结构体
|
||||
};
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------
|
||||
|
||||
#if 1 //@CFIRMED
|
||||
|
||||
enum __MSG_KEY_ID_{
|
||||
WEB_MSG_KEY_ID = 1235,
|
||||
LCD_MSG_KEY_ID,
|
||||
UART_MSG_KEY_ID,
|
||||
TSOIP_MSG_KEY_ID,
|
||||
LOG_MSG_KEY_ID,
|
||||
//
|
||||
GPS_UART_MSG_KEY_ID,
|
||||
|
||||
KEY_ID_END
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
MSGQ_TYPE_ALL = 0,// must 0
|
||||
//
|
||||
MSGQ_TYPE_WEB,
|
||||
MSGQ_TYPE_LCD,
|
||||
MSGQ_TYPE_UART,
|
||||
MSGQ_TYPE_TSOIP,
|
||||
MSGQ_TYPE_LOG,
|
||||
//
|
||||
MSGQ_TYPE_GPS_UART,
|
||||
|
||||
MSGQ_MAX_END
|
||||
}MSGQ_TYPE;
|
||||
|
||||
|
||||
#define msg_send_to_web(p_msg) (sys_msg_send(p_msg, (key_t)WEB_MSG_KEY_ID))
|
||||
#define msg_send_to_lcd(p_msg) (sys_msg_send(p_msg, (key_t)LCD_MSG_KEY_ID))
|
||||
#define msg_send_to_uart(p_msg) (sys_msg_send(p_msg, (key_t)UART_MSG_KEY_ID))
|
||||
#define msg_send_to_gps_uart(p_msg) (sys_msg_send(p_msg, (key_t)GPS_UART_MSG_KEY_ID))
|
||||
#define msg_send_to_tsoip(p_msg) (sys_msg_send(p_msg, (key_t)TSOIP_MSG_KEY_ID))
|
||||
|
||||
#endif//@CONFIRMED
|
||||
//---------------------------------------------
|
||||
|
||||
//#define cttb_msg_send_to_web(p_msg) (cttb_msg_send(p_msg, (key_t)WEB_MSG_KEY_ID))
|
||||
//#define cttb_msg_send_to_lcd(p_msg) (cttb_msg_send(p_msg, (key_t)LCD_MSG_KEY_ID))
|
||||
//#define cttb_msg_send_to_uart(p_msg) (cttb_msg_send(p_msg, (key_t)UART_MSG_KEY_ID))
|
||||
//#define cttb_msg_send_to_tsoip(p_msg) (cttb_msg_send(p_msg, (key_t)TSOIP_MSG_KEY_ID))
|
||||
//#define cttb_msg_send_to_log(p_msg) (cttb_msg_send(p_msg, (key_t)LOG_MSG_KEY_ID))
|
||||
|
||||
|
||||
|
||||
extern int sys_msg_send(MSG *p_msg, key_t keyid);
|
||||
|
||||
extern int creat_web_msg_thread(void);
|
||||
extern int creat_lcd_msg_thread(void);
|
||||
extern int creat_uart_msg_thread(void);
|
||||
extern int creat_tsoip_msg_thread(void);
|
||||
extern int creat_log_msg_thread(void);
|
||||
extern int creat_gps_uart_msg_thread(void);
|
||||
extern void sec_msg_to_gps_uart_thr(void);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user