87 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			87 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
/****************************************************************************
 | 
						|
 | 
						|
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_BT_EXT_DEV_MGMT_H_
 | 
						|
#define _IOT_BT_EXT_DEV_MGMT_H_
 | 
						|
 | 
						|
#ifdef __cplusplus
 | 
						|
extern "C" {
 | 
						|
#endif
 | 
						|
 | 
						|
#include "os_types_api.h"
 | 
						|
#include "iot_bt_ext_dev_mgmt_protocol.h"
 | 
						|
 | 
						|
/* bt hardware reset mode */
 | 
						|
#define IOT_BT_EXT_DM_BT_HW_RST             (0)
 | 
						|
/* bt software reset mode */
 | 
						|
#define IOT_BT_EXT_DM_BT_SW_RST             (1)
 | 
						|
 | 
						|
/* @brief               device management rx data
 | 
						|
 *
 | 
						|
 * @param pkt:          rx data pkt
 | 
						|
 * @return:             none
 | 
						|
 */
 | 
						|
void iot_bt_ext_dm_rx(iot_pkt_t *pkt);
 | 
						|
 | 
						|
/* @brief               device management alarm task callback
 | 
						|
 *
 | 
						|
 * @param elapsed_time: elapsed time, unit: ms.
 | 
						|
 * @return:             none
 | 
						|
 */
 | 
						|
void iot_bt_ext_dm_alarm_cb(uint32_t elapsed_time);
 | 
						|
 | 
						|
/* @brief               device management command
 | 
						|
 *
 | 
						|
 * @param type:         cmd type, see IOT_BT_EXT_DM_PROTO_TYPE_XXX
 | 
						|
 * @param cmd:          cmd id, see iot_bt_ext_dm_proto_cmd_t
 | 
						|
 * @param para:         parameter address
 | 
						|
 * @param len:          parameter length
 | 
						|
 * @return:             error code, see ERR_XXX
 | 
						|
 */
 | 
						|
uint32_t iot_bt_ext_dm_cmd(uint8_t type, uint16_t cmd, uint8_t *para,
 | 
						|
    uint16_t len);
 | 
						|
 | 
						|
/* @brief               device management message handle
 | 
						|
 *
 | 
						|
 * @param msg_id:       device management msg id, see IOT_BT_EXT_MSG_ID_XXX
 | 
						|
 * @param data:         message data address
 | 
						|
 * @return:             none
 | 
						|
 */
 | 
						|
void iot_bt_ext_dm_msg_handle(uint16_t msg_id, void *data);
 | 
						|
 | 
						|
/* @brief           open bluetooth device management module
 | 
						|
 *
 | 
						|
 * @return:         errno, see ERR_XXX
 | 
						|
 */
 | 
						|
uint32_t iot_bt_ext_dm_open(void);
 | 
						|
 | 
						|
/* @brief           close bluetooth device management module
 | 
						|
 *
 | 
						|
 * @return:         none
 | 
						|
 */
 | 
						|
void iot_bt_ext_dm_close(void);
 | 
						|
 | 
						|
/* @brief           reset bluetooth device management module
 | 
						|
 * @param rst_mode: bt reset mode, see IOT_BT_EXT_DM_BT_XX_RST
 | 
						|
 * @return:         none
 | 
						|
 */
 | 
						|
void iot_bt_ext_reset(uint8_t rst_mode);
 | 
						|
 | 
						|
#ifdef __cplusplus
 | 
						|
}
 | 
						|
#endif
 | 
						|
 | 
						|
#endif
 |