Files
kunlun/app/sniffer/inc/iot_sniffer.h
2024-09-28 14:24:04 +08:00

77 lines
2.5 KiB
C

/****************************************************************************
Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
be copied by any method or incorporated into another program without
the express written consent of Aerospace C.Power. This Information or any portion
thereof remains the property of Aerospace C.Power. The Information contained herein
is believed to be accurate and Aerospace C.Power assumes no responsibility or
liability for its use in any way and conveys no license or title under
any patent or copyright and makes no representation or warranty that this
Information is free from patent or copyright infringement.
****************************************************************************/
#ifndef IOT_SNIFFER_H
#define IOT_SNIFFER_H
/* common includes */
#include "iot_plc_api.h"
#include "iot_queue_api.h"
#include "iot_utils_api.h"
#include "iot_task_api.h"
#include "iot_uart_api.h"
#ifdef __cplusplus
extern "C" {
#endif
/* define sniffer module message queue count and priorities,
* the higer the priority, the lower the queue number.
*/
#define IOT_SNIFFER_MSG_QUEUE_HP (0)
#define IOT_SNIFFER_MSG_QUEUE_LP (1)
#define IOT_SNIFFER_MSG_QUEUE_MAX_PRIO (2)
/* message type definition */
/* messages from sniffer module interface */
/* messages from PLC */
#define IOT_SNIFFER_MSG_TYPE_PLC (1)
/* messages from uart */
#define IOT_SNIFFER_MSG_TYPE_UART (2)
/* PLC type message id definition */
/* message delivered from PLC */
#define IOT_SNIFFER_MSG_ID_PLC_MSG (1)
/* message delivered from uart */
#define IOT_SNIFFER_MSG_ID_UART_DATA (1)
/* sniffer module message */
typedef struct _iot_sniffer_msg {
/* iot task message */
iot_task_msg_t task_msg;
/* pointer to message data */
void *data;
/* another data field */
uint32_t data2;
} iot_sniffer_msg_t;
/* sniffer global descriptor */
typedef struct _iot_sniffer_global {
/* sniffer module task configuration */
iot_task_config_t task_cfg;
/* sniffer module task handle */
iot_task_h task_h;
/* handle of registered plc app */
iot_plc_app_h plc_app_h;
/* sniffer module 485 uart handle*/
iot_uart_h handle;
} iot_sniffer_global_t;
#ifdef __cplusplus
}
#endif
#endif /* IOT_SNIFFER_H */