88 lines
		
	
	
		
			2.8 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			88 lines
		
	
	
		
			2.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_BRM_TSFM_H
 | 
						|
#define IOT_BRM_TSFM_H
 | 
						|
 | 
						|
/* os shim includes */
 | 
						|
#include "os_types_api.h"
 | 
						|
 | 
						|
/* iot common includes */
 | 
						|
#include "iot_task_api.h"
 | 
						|
#include "iot_rtc_api.h"
 | 
						|
 | 
						|
#ifdef __cplusplus
 | 
						|
extern "C" {
 | 
						|
#endif
 | 
						|
 | 
						|
#if (IOT_BRM_ENABLE)
 | 
						|
 | 
						|
/* A single station area identification result message can only carry the
 | 
						|
 * maximum number of site addresses
 | 
						|
 */
 | 
						|
#define IOT_BRM_TSFM_FRAME_ENTRY_MAX    49
 | 
						|
 | 
						|
/**
 | 
						|
 * @brief iot_brm_same_tsfm_info_collect_handle() - handle hardware zone
 | 
						|
 *        identification notification message.
 | 
						|
 * @param data: data in frame, the format is proto_conn_less_tsfm_info_rpt_t.
 | 
						|
 * @param len:  data length.
 | 
						|
 * @param pkt:  the complete data package, the pkt will be free if exist.
 | 
						|
 */
 | 
						|
void iot_brm_same_tsfm_info_collect_handle( uint8_t *data, uint16_t len,
 | 
						|
    iot_pkt_t *pkt);
 | 
						|
 | 
						|
/**
 | 
						|
 * @brief iot_brm_same_tsfm_collect_trigger() - trigger collect the hardware
 | 
						|
 *        zone identification notification message.
 | 
						|
 * @param cco_addr:     the cco address.
 | 
						|
 * @retval: ERR_OK - for successfully, ERR_NOMEM - malloc fail
 | 
						|
 */
 | 
						|
uint32_t iot_brm_same_tsfm_collect_trigger(uint8_t *cco_addr);
 | 
						|
 | 
						|
/**
 | 
						|
 * @brief iot_brm_same_tsfm_collect_timeout() - call periodically to
 | 
						|
 *        determine whether it has timed out, please call it every second.
 | 
						|
 * @param cur_ts:  current time.
 | 
						|
 */
 | 
						|
void iot_brm_same_tsfm_collect_timeout(void);
 | 
						|
 | 
						|
/**
 | 
						|
 * @brief iot_brm_same_tsfm_fill_node_info() - copy the collected sta address
 | 
						|
 *        information.
 | 
						|
 * @param resp[out]:    sta address information out, see
 | 
						|
 *                      iot_sg_ext_cus_same_tsfm_node_resp_t.
 | 
						|
 * @retval: ERR_OK - for successfully, ERR_FAIL - for failure
 | 
						|
 */
 | 
						|
uint32_t iot_brm_same_tsfm_fill_node_info(
 | 
						|
    iot_sg_ext_cus_same_tsfm_node_resp_t *resp);
 | 
						|
 | 
						|
/**
 | 
						|
 * @brief iot_brm_tsfm_init() - tsfm initialize
 | 
						|
 */
 | 
						|
uint32_t iot_brm_tsfm_init(void);
 | 
						|
 | 
						|
/**
 | 
						|
 * @brief iot_brm_tsfm_deinit() - tsfm deinitialize
 | 
						|
 */
 | 
						|
void iot_brm_tsfm_deinit(void);
 | 
						|
 | 
						|
#endif /* IOT_BRM_ENABLE */
 | 
						|
 | 
						|
#ifdef __cplusplus
 | 
						|
}
 | 
						|
#endif
 | 
						|
#endif
 | 
						|
 |