100 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
		
		
			
		
	
	
			100 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 _IOT_BT_EXT_MSG_H_
							 | 
						||
| 
								 | 
							
								#define _IOT_BT_EXT_MSG_H_
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifdef __cplusplus
							 | 
						||
| 
								 | 
							
								extern "C" {
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#include "os_types_api.h"
							 | 
						||
| 
								 | 
							
								#include "os_utils_api.h"
							 | 
						||
| 
								 | 
							
								#include "iot_task_api.h"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* @defgroup extern bluetooth message type
							 | 
						||
| 
								 | 
							
								 * @{
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* peripheral rx data and rpt to protocol */
							 | 
						||
| 
								 | 
							
								#define IOT_BT_EXT_MSG_TYPE_DATA_RX                 1
							 | 
						||
| 
								 | 
							
								/* protocol send data to peripheral */
							 | 
						||
| 
								 | 
							
								#define IOT_BT_EXT_MSG_TYPE_DATA_TX                 2
							 | 
						||
| 
								 | 
							
								/* message type of upgrade process */
							 | 
						||
| 
								 | 
							
								#define IOT_BT_EXT_MSG_TYPE_UPGRADE                 3
							 | 
						||
| 
								 | 
							
								/* device management prot msg */
							 | 
						||
| 
								 | 
							
								#define IOT_BT_EXT_MSG_TYPE_DEV_MGMT                4
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/**
							 | 
						||
| 
								 | 
							
								 * @}
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* @defgroup extern bluetooth message id
							 | 
						||
| 
								 | 
							
								 * @{
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* @defgroup upgrade message id
							 | 
						||
| 
								 | 
							
								 * @{
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								/* bluetooth upgrade timer id */
							 | 
						||
| 
								 | 
							
								#define IOT_BT_EXT_MSG_ID_UPGRADE_TIMER             1
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/**
							 | 
						||
| 
								 | 
							
								 * @}
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* @defgroup device management message id
							 | 
						||
| 
								 | 
							
								 * @{
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								/* device management sync command tx message id */
							 | 
						||
| 
								 | 
							
								#define IOT_BT_EXT_MSG_ID_DM_SYNC_TX_REQ            1
							 | 
						||
| 
								 | 
							
								/* device management alarm message id */
							 | 
						||
| 
								 | 
							
								#define IOT_BT_EXT_MSG_ID_DM_ALARM                  2
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/**
							 | 
						||
| 
								 | 
							
								 * @}
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/**
							 | 
						||
| 
								 | 
							
								 * @}
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								typedef struct _iot_bt_ext_msg_type {
							 | 
						||
| 
								 | 
							
								    /* task msg entry */
							 | 
						||
| 
								 | 
							
								    iot_task_msg_t msg;
							 | 
						||
| 
								 | 
							
								    /* msg data */
							 | 
						||
| 
								 | 
							
								    void *data;
							 | 
						||
| 
								 | 
							
								} iot_bt_ext_msg_type_t;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* @brief :             extern bluetooth module post message
							 | 
						||
| 
								 | 
							
								 * @param msg_type:     message type
							 | 
						||
| 
								 | 
							
								 * @param msg_id  :     message id
							 | 
						||
| 
								 | 
							
								 * @param data    :     message transport data
							 | 
						||
| 
								 | 
							
								 * @return :            error code.
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								uint32_t iot_bt_ext_post_msg(uint16_t msg_type, uint16_t msg_id, void *data);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* @brief :             extern bluetooth module clean message
							 | 
						||
| 
								 | 
							
								 * @param msg_type :    message type to clean
							 | 
						||
| 
								 | 
							
								 * @param msg_id   :    message id to clean
							 | 
						||
| 
								 | 
							
								 * @return :            none
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								void iot_bt_ext_clean_msg(uint16_t msg_type, uint16_t msg_id);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifdef __cplusplus
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#endif
							 |