78 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
		
		
			
		
	
	
			78 lines
		
	
	
		
			2.6 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 CVG_BEACON_SG_H
 | ||
|  | #define CVG_BEACON_SG_H
 | ||
|  | 
 | ||
|  | /* os shim includes */ | ||
|  | #include "os_types.h"
 | ||
|  | 
 | ||
|  | /* public api includes */ | ||
|  | #include "mac_bcm_api.h"
 | ||
|  | 
 | ||
|  | #ifdef __cplusplus
 | ||
|  | extern "C" { | ||
|  | #endif
 | ||
|  | 
 | ||
|  | /* rx beacon descriptor */ | ||
|  | typedef struct _mac_bc_rx_desc { | ||
|  |     /* beacon entries of the received beacon */ | ||
|  |     uint32_t                field_flag          :24, | ||
|  |     /* valid bcn entry count in entry_sort */ | ||
|  |                             entry_sort_cnt      :8; | ||
|  |     iot_pkt_t               *unknown_entry; | ||
|  |     mac_bc_fc_t             fc; | ||
|  |     mac_bc_fp_t             fp; | ||
|  |     mac_bc_sta_cap_t        sta_cap; | ||
|  |     mac_bc_rt_param_t       rt_param; | ||
|  |     mac_bc_freq_chg_t       freq_chg; | ||
|  |     mac_bc_time_slot_t      time_slot; | ||
|  |     mac_bc_vendor_spec_t    vendor; | ||
|  |     mac_bc_rf_channel_chg_t rf_chg; | ||
|  |     mac_bc_simple_param_t   rf_simple; | ||
|  |     mac_bc_rf_route_t       rf_route; | ||
|  |     mac_bc_rtc_t            rtc; | ||
|  |     uint8_t                 entry_sort[MAC_BCN_SORT_MAX_CNT]; | ||
|  | } mac_bc_rx_desc_t; | ||
|  | 
 | ||
|  | /*
 | ||
|  |  * @brief cvg_get_bc_entry() -  get pointer to beacon entry field specified | ||
|  |  *                              by entry_id | ||
|  |  * | ||
|  |  * @param bc:         the beacon descriptor | ||
|  |  * @param entry_id:   entry id of beacon field | ||
|  |  * | ||
|  |  * @retval:     NULL        -- if the field is invalid | ||
|  |  * @retval:     otherwise   -- pointer to specific field | ||
|  |  */ | ||
|  | void* cvg_get_bc_entry(mac_bc_rx_desc_t *bc, uint8_t entry_id); | ||
|  | 
 | ||
|  | /*
 | ||
|  |  * @brief cvg_parse_beacon() -  parse a iot_pkt to get beacon info | ||
|  |  *                              in a mac_bc_rx_desc_t | ||
|  |  * | ||
|  |  * @param pbuf:     pointer to a iot_pkt with beacon raw data | ||
|  |  * @param bc_desc:  beacon descriptor with all beacon info | ||
|  |  * @retval:         network id of the beacon | ||
|  |  */ | ||
|  | uint32_t cvg_parse_beacon(iot_pkt_t *pbuf, mac_bc_rx_desc_t *bc_desc); | ||
|  | 
 | ||
|  | 
 | ||
|  | #ifdef __cplusplus
 | ||
|  | } | ||
|  | #endif
 | ||
|  | 
 | ||
|  | #endif /* CVG_BEACON_SG_H */
 |