75 lines
2.8 KiB
C
75 lines
2.8 KiB
C
/****************************************************************************
|
|
|
|
Copyright(c) 2016-2018 by WuQi Technologies. ALL RIGHTS RESERVED.
|
|
|
|
This Information is proprietary to WuQi Technologies and MAY NOT
|
|
be copied by any method or incorporated into another program without
|
|
the express written consent of WuQi. This Information or any portion
|
|
thereof remains the property of WuQi. The Information contained herein
|
|
is believed to be accurate and WuQi 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 PROTO_698_VENDOR_H
|
|
#define PROTO_698_VENDOR_H
|
|
|
|
#include "iot_utils_api.h"
|
|
|
|
/* define OADs for LiaoNing production line test */
|
|
/* OAD: extend 698 protocol for set rf param by broadcast */
|
|
#define PROTO_69845_EXT_APP_OAD_BROADCAST_RF_PARAM (0xFFF00100u)
|
|
/* OAD: extend 698 protocol for HRF work mode */
|
|
#define PROTO_69845_EXT_APP_OAD_HRF_MODE (0xFFF00200u)
|
|
/* OAD: extend 698 protocol for set rf param by uart */
|
|
#define PROTO_69845_EXT_APP_OAD_RF_PARAM (0xFFF00300u)
|
|
/* OAD: extend 698 protocol for HRF work mode by uart*/
|
|
#define PROTO_69845_EXT_APP_OAD_UART_HRF_MODE (0xFFF00400u)
|
|
/* OAD: extend 698 protocol for read Chip-ID */
|
|
#define PROTO_69845_EXT_APP_OAD_READ_CHIP_ID (0xFFF00500u)
|
|
|
|
/* define controller read meter control */
|
|
#define PROTO_69845_CONTROLLER_MODE_HPLC (1)
|
|
#define PROTO_69845_CONTROLLER_MODE_RF (2)
|
|
|
|
/* define chip id length */
|
|
#define PROTO_69845_EXT_CHIP_ID_LEN (24)
|
|
|
|
/* define energy data array count number */
|
|
#define PROTO_69845_ENERGY_DATA_ARRAY_COUNT (5)
|
|
|
|
#pragma pack(push) /* save the pack status */
|
|
#pragma pack(1) /* 1 byte align */
|
|
|
|
/* rf param struct download */
|
|
typedef struct _proto_69845_ext_rf_param {
|
|
/* rf option */
|
|
uint8_t option;
|
|
/* rf channel */
|
|
uint8_t channel;
|
|
} proto_69845_ext_rf_param_t;
|
|
|
|
/* for liaoning province controller */
|
|
typedef struct _proto_69845_ext_work_mode {
|
|
/* controller read meter control mode, see PROTO_69845_CONTROLLER_MODE_XXX*/
|
|
uint8_t mode;
|
|
} proto_69845_ext_work_mode_t;
|
|
|
|
#pragma pack(pop) /* restore the pack status */
|
|
|
|
/**
|
|
* @brief handle vendor 698 protocol.
|
|
* @param data pointer to protocol data buffer
|
|
* @param len data length.
|
|
* @param snr snr of current mpdu.
|
|
* @param rssi rssi of current mpdu.
|
|
* @retval: 1 -- handled vendor 698 protocol.
|
|
* @retval: 0 -- no vendor 698 protocol.
|
|
*/
|
|
uint32_t proto_69845_handle_vendor_proto(
|
|
uint8_t *data, uint32_t len, int8_t snr, int8_t rssi);
|
|
|
|
#endif /* PROTO_698_VENDOR_H */
|