128 lines
3.8 KiB
C
128 lines
3.8 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_CLI_SET_INFO
|
|
#define IOT_CLI_SET_INFO
|
|
|
|
/* os shim includes */
|
|
#include "os_types.h"
|
|
#include "iot_utils_api.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#pragma pack(push) /* save the pack status */
|
|
#pragma pack(1) /* 1 byte align */
|
|
|
|
/** max id of set vendor */
|
|
#define CLI_SET_VENDOR_ID_MAX (100)
|
|
#define CLI_SET_VENDOR_TIME_WINDOW (30000)
|
|
|
|
/** cli vendor info */
|
|
typedef struct _cli_vendor_info {
|
|
/** set id, 1-100 */
|
|
uint8_t set_id;
|
|
uint8_t control;
|
|
/** vendor info */
|
|
uint16_t vendor;
|
|
/** dst info */
|
|
uint8_t dst[IOT_MAC_ADDR_LEN];
|
|
/** random window for sta report */
|
|
uint16_t report_window;
|
|
} cli_vendor_info;
|
|
|
|
/** cli set vendor ack */
|
|
typedef struct _cli_set_vendor_ack {
|
|
/** set result */
|
|
uint8_t result;
|
|
} cli_set_vendor_ack;
|
|
|
|
/** vendor report from sta */
|
|
typedef struct _cli_vendor_report {
|
|
/** set id, 1-100 */
|
|
uint8_t set_id;
|
|
/** stat addr */
|
|
uint8_t dst[IOT_MAC_ADDR_LEN];
|
|
} cli_vendor_report;
|
|
|
|
/** cli build info */
|
|
typedef struct _cli_build_info {
|
|
/** set id, 101-200 */
|
|
uint8_t set_id;
|
|
uint8_t control;
|
|
/** software version. BCD format */
|
|
uint16_t sw_ver;
|
|
/** build year */
|
|
uint8_t year;
|
|
/** build month */
|
|
uint8_t month;
|
|
/** build day */
|
|
uint8_t day;
|
|
/** build hour */
|
|
uint8_t hour;
|
|
/** build min */
|
|
uint8_t min;
|
|
/** build sec */
|
|
uint8_t sec;
|
|
/** dst info */
|
|
uint8_t dst[IOT_MAC_ADDR_LEN];
|
|
/** random window for sta report */
|
|
uint16_t report_window;
|
|
} cli_build_info;
|
|
|
|
/** cli set build info ack */
|
|
typedef struct _cli_set_build_info_ack {
|
|
/** set result */
|
|
uint8_t result;
|
|
} cli_set_build_info_ack;
|
|
|
|
/** build info report from sta */
|
|
typedef struct _cli_build_info_report {
|
|
/** set id, 101-200 */
|
|
uint8_t set_id;
|
|
/** stat addr */
|
|
uint8_t dst[IOT_MAC_ADDR_LEN];
|
|
} cli_build_info_report;
|
|
|
|
#if PLC_SUPPORT_CCO_ROLE
|
|
/* cli vendor report handler */
|
|
void cli_set_vendor_report(
|
|
uint8_t *buffer, uint32_t bufferlen, uint8_t *src_mac);
|
|
/* cli build info report handler */
|
|
void cli_set_build_info_report(
|
|
uint8_t *buffer, uint32_t bufferlen, uint8_t *src_mac);
|
|
#endif
|
|
|
|
/* cli set vendor handler */
|
|
void cli_set_vendor(
|
|
uint8_t *buffer, uint32_t bufferlen, uint8_t *src_mac);
|
|
/* cli set build info handler */
|
|
void cli_set_build_info(
|
|
uint8_t *buffer, uint32_t bufferlen, uint8_t *src_mac);
|
|
/* cli set info timer handler */
|
|
void iot_cli_set_info_handle_timer_msg();
|
|
/* cli set info init */
|
|
void iot_cli_set_info_init();
|
|
/* cli user ver change reset */
|
|
void iot_cli_user_ver_change_reset();
|
|
|
|
#pragma pack(pop) /* restore the pack status */
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif // !IOT_CLI_SET_INFO
|