94 lines
		
	
	
		
			3.0 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			94 lines
		
	
	
		
			3.0 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_NB_H
 | 
						|
#define IOT_BRM_NB_H
 | 
						|
 | 
						|
/* os shim includes */
 | 
						|
#include "os_types_api.h"
 | 
						|
 | 
						|
/* iot common includes */
 | 
						|
#include "iot_plc_api.h"
 | 
						|
#include "iot_plc_msg_sta_api.h"
 | 
						|
 | 
						|
/* protocol header file */
 | 
						|
#include "proto_645_vendor.h"
 | 
						|
 | 
						|
#ifdef __cplusplus
 | 
						|
extern "C" {
 | 
						|
#endif
 | 
						|
 | 
						|
#if (IOT_BRM_ENABLE)
 | 
						|
 | 
						|
/* A single query message can only carry the maximum number of node information.
 | 
						|
 */
 | 
						|
#define IOT_BRM_NB_GET_INFO_CNT_MAX    24
 | 
						|
 | 
						|
/**
 | 
						|
 * @brief iot_brm_nb_add_scan_node() - handle the neighbor node information
 | 
						|
 *        reported by the underlying broadcast.
 | 
						|
 * @param rpt:  neighbor node information, see iot_plc_discovery_node_rpt_t.
 | 
						|
 * @retval: ERR_OK - for successfully, otherwise - error code
 | 
						|
 */
 | 
						|
uint32_t iot_brm_nb_add_scan_node(iot_plc_discovery_node_rpt_t *rpt);
 | 
						|
 | 
						|
/**
 | 
						|
 * @brief iot_brm_nb_get_scan_node_cnt() - get neighbor nodes count.
 | 
						|
 * @retval: the number neighbor nodes.
 | 
						|
 */
 | 
						|
uint16_t iot_brm_nb_get_scan_node_cnt(void);
 | 
						|
 | 
						|
/**
 | 
						|
 * @brief iot_brm_nb_get_scan_node_info() - copy neighbor nodes information.
 | 
						|
 * @param nodes_info[out]:  the neighbor nodes information, see
 | 
						|
 *                          iot_brm_nb_scan_node_info_t.
 | 
						|
 * @param start_index:      the index of the first node in collected table to
 | 
						|
 *                          be copied.
 | 
						|
 * @param cnt:              expected number of copy nodes.
 | 
						|
 * @retval: the number of actual copy nodes.
 | 
						|
 */
 | 
						|
uint8_t iot_brm_nb_get_scan_node_info(
 | 
						|
    proto_645_07_ext_brm_nei_data_t *nodes_info, uint8_t start_index,
 | 
						|
    uint8_t cnt);
 | 
						|
 | 
						|
/**
 | 
						|
 * @brief iot_brm_nb_scan_node_refresh() - call periodically to check if the
 | 
						|
 *        node has not been detected for a long time.
 | 
						|
 */
 | 
						|
void iot_brm_nb_scan_node_refresh(void);
 | 
						|
 | 
						|
/**
 | 
						|
 * @brief iot_brm_nb_plc_state_change_handle() - call when plc connect.
 | 
						|
 */
 | 
						|
void iot_brm_nb_plc_connect_handle(void);
 | 
						|
 | 
						|
/**
 | 
						|
 * @brief iot_brm_nb_scan_init() - neighbor node collect initialize
 | 
						|
 * @param handle:       plc application handler
 | 
						|
 */
 | 
						|
uint32_t iot_brm_nb_scan_init(iot_plc_app_h handle);
 | 
						|
 | 
						|
/**
 | 
						|
 * @brief iot_brm_nb_scan_deinit() - neighbor node collect deinitialize
 | 
						|
 */
 | 
						|
void iot_brm_nb_scan_deinit(void);
 | 
						|
 | 
						|
#endif /* IOT_BRM_ENABLE */
 | 
						|
 | 
						|
#ifdef __cplusplus
 | 
						|
}
 | 
						|
#endif
 | 
						|
 | 
						|
#endif
 |