Bluetooth Low Energy based Firmware Over The Air with Mbed. Mbed part is a external processor of the IoT devices and communicate with a Bluetooth module. The Bluetooth module have to support BLE and implement BLE FOTA profile designed by ours. BLE FOTA profile specification is available from our GIT hub wiki(https://github.com/sevencore/BLEFOTA).
Dependencies: mbed
Fork of mbed_fota by
app_task.h
00001 /** 00002 * @file app_task.h 00003 * @brief Header file for application handlers for ble events and responses. 00004 * Copyright 2015 SEVENCORE Co., Ltd. 00005 * 00006 * @author HyeongJun Kim 00007 * @version 1.0.0 00008 * @date 2015-08-20 00009 */ 00010 #ifndef APP_TASK_H 00011 #define APP_TASK_H 00012 #include "gapm_task.h" 00013 #include "gapc_task.h" 00014 #include "BleMsgHandler.h" 00015 00016 /** 00017 **************************************************************************************** 00018 * @addtogroup dialog_fota module 00019 * @brief application handlers for ble events and responses. 00020 * 00021 * @{ 00022 **************************************************************************************** 00023 */ 00024 namespace sevencore_fota{ 00025 00026 /** 00027 **************************************************************************************** 00028 * @brief Handles GAPM_ADV_REPORT_IND event. 00029 * 00030 * @param[in] msgid Id of the message received. 00031 * @param[in] param Pointer to the parameters of the message. 00032 * @param[in] dest_id ID of the receiving task instance (TASK_GAP). 00033 * @param[in] src_id ID of the sending task instance. 00034 * 00035 * @return If the message was consumed or not. 00036 **************************************************************************************** 00037 */ 00038 int gapm_adv_report_ind_handler(unsigned short msgid, 00039 struct gapm_adv_report_ind *param, 00040 unsigned short dest_id, 00041 unsigned short src_id); 00042 00043 /** 00044 **************************************************************************************** 00045 * @brief Handles the DISS_CREATE_DB_CFM message. 00046 * 00047 * @param[in] msgid Id of the message received. 00048 * @param[in] param Pointer to the parameters of the message. 00049 * @param[in] dest_id ID of the receiving task instance (TASK_GAP). 00050 * @param[in] src_id ID of the sending task instance. 00051 * @param[in] BMH Ble Message Handler class reference. 00052 * 00053 * @return If the message was consumed or not. 00054 **************************************************************************************** 00055 */ 00056 int diss_create_db_cfm_handler(unsigned short msgid, 00057 struct diss_create_db_cfm *param, 00058 unsigned short dest_id, 00059 unsigned short src_id, 00060 BleMsgHandler* BMH); 00061 /** 00062 **************************************************************************************** 00063 * @brief Handles the FOTA_SERVER_CREATE_DB_CFM message. 00064 * 00065 * @param[in] msgid Id of the message received. 00066 * @param[in] param Pointer to the parameters of the message. 00067 * @param[in] dest_id ID of the receiving task instance (TASK_GAP). 00068 * @param[in] src_id ID of the sending task instance. 00069 * @param[in] BMH Ble Message Handler class reference. 00070 * 00071 * @return If the message was consumed or not. 00072 **************************************************************************************** 00073 */ 00074 int fota_server_create_db_cfm_handler(unsigned short msgid, 00075 struct fota_server_create_db_cfm *param, 00076 unsigned short dest_id, 00077 unsigned short src_id, 00078 BleMsgHandler* BMH); 00079 /** 00080 **************************************************************************************** 00081 * @brief Handles Firmware Data Copy event. 00082 * 00083 * @param[in] msgid Id of the message received. 00084 * @param[in] param Pointer to the parameters of the message. 00085 * @param[in] dest_id ID of the receiving task instance (TASK_GAP). 00086 * @param[in] src_id ID of the sending task instance. 00087 * @param[in] BMH Ble Message Handler class reference. 00088 * 00089 * @return If the message was consumed or not. 00090 **************************************************************************************** 00091 */ 00092 void fota_server_data_flash_ind_handler(unsigned short msgid, 00093 struct fota_server_data_flash_ind *param, 00094 unsigned short dest_id, 00095 unsigned short src_id, 00096 BleMsgHandler* BMH); 00097 /** 00098 **************************************************************************************** 00099 * @brief Handles ready indication from the GAP. 00100 * 00101 * @param[in] msgid Id of the message received. 00102 * @param[in] param Pointer to the parameters of the message. 00103 * @param[in] dest_id ID of the receiving task instance (TASK_GAP). 00104 * @param[in] src_id ID of the sending task instance. 00105 * @param[in] BMH Ble Message Handler class reference. 00106 * 00107 * @return If the message was consumed or not. 00108 **************************************************************************************** 00109 */ 00110 int gapm_device_ready_ind_handler(unsigned short msgid, 00111 struct gap_ready_evt *param, 00112 unsigned short dest_id, 00113 unsigned short src_id, 00114 BleMsgHandler* BMH ); 00115 /** 00116 **************************************************************************************** 00117 * @brief Handle reset GAP request completion event. 00118 * 00119 * @param[in] msgid Id of the message received. 00120 * @param[in] param Pointer to the parameters of the message. 00121 * @param[in] dest_id ID of the receiving task instance (TASK_GAP). 00122 * @param[in] src_id ID of the sending task instance. 00123 * @param[in] BMH Ble Message Handler class reference. 00124 * 00125 * @return If the message was consumed or not. 00126 **************************************************************************************** 00127 */ 00128 int gapm_reset_completion_handler(unsigned short msgid, 00129 struct gapm_cmp_evt *param, 00130 unsigned short dest_id, 00131 unsigned short src_id, 00132 BleMsgHandler* BMH); 00133 /** 00134 **************************************************************************************** 00135 * @brief Handles GAPM_CMP_EVT event for GAPM_SET_DEV_CONFIG_CMD. 00136 * 00137 * @param[in] msgid Id of the message received. 00138 * @param[in] param Pointer to the parameters of the message. 00139 * @param[in] dest_id ID of the receiving task instance (TASK_GAP). 00140 * @param[in] src_id ID of the sending task instance. 00141 * @param[in] BMH Ble Message Handler class reference. 00142 * 00143 * @return If the message was consumed or not. 00144 **************************************************************************************** 00145 */ 00146 int gapm_set_dev_config_completion_handler(unsigned short msgid, 00147 struct gapm_cmp_evt *param, 00148 unsigned short dest_id, 00149 unsigned short src_id, 00150 BleMsgHandler* BMH); 00151 /** 00152 **************************************************************************************** 00153 * @brief Handles Connection request indication event. 00154 * 00155 * @param[in] msgid Id of the message received. 00156 * @param[in] param Pointer to the parameters of the message. 00157 * @param[in] dest_id ID of the receiving task instance (TASK_GAP). 00158 * @param[in] src_id ID of the sending task instance. 00159 * @param[in] BMH Ble Message Handler class reference. 00160 * 00161 * @return If the message was consumed or not. 00162 **************************************************************************************** 00163 */ 00164 int gapc_connection_req_ind_handler(uint16_t msgid, 00165 struct gapc_connection_req_ind *param, 00166 uint16_t dest_id, 00167 uint16_t src_id, 00168 BleMsgHandler* BMH); 00169 /** 00170 **************************************************************************************** 00171 * @brief Handles Discconnection indication event. 00172 * 00173 * @param[in] msgid Id of the message received. 00174 * @param[in] param Pointer to the parameters of the message. 00175 * @param[in] dest_id ID of the receiving task instance (TASK_GAP). 00176 * @param[in] src_id ID of the sending task instance. 00177 * @param[in] BMH Ble Message Handler class reference. 00178 * 00179 * @return If the message was consumed or not. 00180 **************************************************************************************** 00181 */ 00182 int gapc_disconnect_ind_handler(uint16_t msgid, 00183 struct gapc_disconnect_ind *param, 00184 uint16_t dest_id, 00185 uint16_t src_id, 00186 BleMsgHandler* BMH); 00187 00188 00189 00190 }//namespace 00191 00192 /// @} dialog_fota module 00193 00194 #endif//APP_TASK_H
Generated on Tue Jul 12 2022 16:20:47 by 1.7.2