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

80 lines
2.7 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_CKB_SNIFFER_H
#define _IOT_CKB_SNIFFER_H
#include "iot_task_api.h"
#ifdef __cplusplus
extern "C" {
#endif
/* message type definition */
/* messages from PLC */
#define IOT_CKB_SNIFFER_MSG_TYPE_PLC (1)
/* PLC type message id definition */
/* message delivered from PLC */
#define IOT_CKB_SNIFFER_MSG_ID_PLC_MSG (1)
/* define priorities for message to be handle */
#define IOT_CKB_SNIFFER_TASK_QUEUE_HP (0)
#define IOT_CKB_SNIFFER_TASK_QUEUE_LP (1)
#define IOT_CKB_SNIFFER_TASK_QUEUE_MAX_PRIO (2)
#define IOT_CKB_SNIFFER_TASK_LIKE_ID (2)
#define IOT_CKB_SNIFFER_TASK_POOL_SIZE (64)
#define IOT_CKB_SNIFFER_TASK_STACK_SIZE (512)
typedef struct _iot_ckb_sniffer_task_msg {
/* standard iot_task message */
iot_task_msg_t task_msg;
/* pointer to message data */
void *data;
} iot_ckb_sniffer_task_msg_t;
typedef struct _iot_ckb_sniffer_task_data {
/* handle of the ping iot_task */
iot_task_h task_handle;
/* a flag indicating if app registered successfully */
//uint8_t app_registered;
/* device type */
uint8_t dev_type;
/* role of local device */
uint8_t dev_role;
/* mac address of local device */
uint8_t mac_addr[IOT_MAC_ADDR_LEN];
/* handle of this app */
iot_plc_app_h app_handle;
union {
uint16_t vendor_id;
struct {
/* 0 - band0, 1 - band1 , max band id = band12 */
uint16_t band_id : 4,
/* rf option id, only for rf device, value is [1, 3] */
rf_option : 4,
/* rf channel id, only for rf device */
channel_id : 8;
} set_cfg;
} param;
}iot_ckb_sniffer_task_data_t;
#ifdef __cplusplus
}
#endif
#endif /* _IOT_CKB_SNIFFER_H */