70 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			70 lines
		
	
	
		
			2.2 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_HW_VER
 | 
						|
#define IOT_CLI_HW_VER
 | 
						|
 | 
						|
/* 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 */
 | 
						|
 | 
						|
#define CLI_HW_VER_QUERY_TIME_WINDOW        (30000)
 | 
						|
#define CLI_HW_VER_QUERY_TIME_BASE          (20)
 | 
						|
 | 
						|
/** query hw ver */
 | 
						|
typedef struct _cli_hw_ver_query {
 | 
						|
    /** device addr, all bytes set to 0xFF means bcast*/
 | 
						|
    uint8_t             dst[IOT_MAC_ADDR_LEN];
 | 
						|
    /** random window for report */
 | 
						|
    uint16_t            report_window;
 | 
						|
} cli_hw_ver_query;
 | 
						|
 | 
						|
/** hw ver report */
 | 
						|
typedef struct _cli_hw_ver_report {
 | 
						|
    /** hw ver */
 | 
						|
    uint32_t            hw_ver;
 | 
						|
    /** device addr */
 | 
						|
    uint8_t             dst[IOT_MAC_ADDR_LEN];
 | 
						|
    /* user type, see USER_TYPE_XXX */
 | 
						|
    uint8_t             user_type;
 | 
						|
} cli_hw_ver_report;
 | 
						|
 | 
						|
/* cco forward hw ver report handler */
 | 
						|
void cli_cco_forward_hw_ver_report(
 | 
						|
    uint8_t *buffer, uint32_t bufferlen, uint8_t *src_mac);
 | 
						|
 | 
						|
/* cli query hardware version handler */
 | 
						|
void cli_query_hw_ver(
 | 
						|
    uint8_t *buffer, uint32_t bufferlen, uint8_t *src_mac);
 | 
						|
 | 
						|
/* handle query timer msg */
 | 
						|
void iot_cli_query_hw_ver_handle_timer_msg();
 | 
						|
 | 
						|
/* init query hw ver */
 | 
						|
void iot_cli_query_hw_ver_init();
 | 
						|
 | 
						|
#pragma pack(pop)   /* restore the pack status */
 | 
						|
 | 
						|
#ifdef __cplusplus
 | 
						|
}
 | 
						|
#endif
 | 
						|
 | 
						|
#endif // !IOT_CLI_HW_VER
 |