sevencore fota solution development project
Diff: dialog_fota/app_task.cpp
- Revision:
- 9:fcf91f563147
- Parent:
- 8:9eec2c246a85
- Child:
- 11:1ed93accb3fb
--- a/dialog_fota/app_task.cpp Thu Aug 20 05:16:55 2015 +0000 +++ b/dialog_fota/app_task.cpp Mon Aug 24 02:29:16 2015 +0000 @@ -1,11 +1,39 @@ +/** + * @file app_task.h + * @brief Handling for ble events and responses. + * Copyright 2015 SEVENCORE Co., Ltd. + * + * @author HyeongJun Kim + * @version 1.0.0 + * @date 2015-08-20 +*/ #include "app_task.h" #include "app.h" #include "fota_server_task.h" #define BLE_FOTA_SERVICE 1 - +/** + **************************************************************************************** + * @addtogroup dialog_fota module + * @brief application handlers for ble events and responses. + * + * @{ + **************************************************************************************** + */ namespace sevencore_fota{ - + +/** + **************************************************************************************** + * @brief Handles GAPM_ADV_REPORT_IND event. + * + * @param[in] msgid Id of the message received. + * @param[in] param Pointer to the parameters of the message. + * @param[in] dest_id ID of the receiving task instance (TASK_GAP). + * @param[in] src_id ID of the sending task instance. + * + * @return If the message was consumed or not. + **************************************************************************************** + */ int gapm_adv_report_ind_handler(unsigned short msgid, struct gapm_adv_report_ind *param, unsigned short dest_id, @@ -16,7 +44,19 @@ return 0; } - +/** + **************************************************************************************** + * @brief Handles the DISS_CREATE_DB_CFM message. + * + * @param[in] msgid Id of the message received. + * @param[in] param Pointer to the parameters of the message. + * @param[in] dest_id ID of the receiving task instance (TASK_GAP). + * @param[in] src_id ID of the sending task instance. + * @param[in] BMH Ble Message Handler class reference. + * + * @return If the message was consumed or not. + **************************************************************************************** + */ int diss_create_db_cfm_handler(unsigned short msgid, struct diss_create_db_cfm *param, unsigned short dest_id, @@ -163,7 +203,19 @@ return 0; } - +/** + **************************************************************************************** + * @brief Handles the FOTA_SERVER_CREATE_DB_CFM message. + * + * @param[in] msgid Id of the message received. + * @param[in] param Pointer to the parameters of the message. + * @param[in] dest_id ID of the receiving task instance (TASK_GAP). + * @param[in] src_id ID of the sending task instance. + * @param[in] BMH Ble Message Handler class reference. + * + * @return If the message was consumed or not. + **************************************************************************************** + */ int fota_server_create_db_cfm_handler(unsigned short msgid, struct fota_server_create_db_cfm *param, unsigned short dest_id, @@ -277,7 +329,19 @@ return 0; } - +/** + **************************************************************************************** + * @brief Handles Firmware Data Copy event. + * + * @param[in] msgid Id of the message received. + * @param[in] param Pointer to the parameters of the message. + * @param[in] dest_id ID of the receiving task instance (TASK_GAP). + * @param[in] src_id ID of the sending task instance. + * @param[in] BMH Ble Message Handler class reference. + * + * @return If the message was consumed or not. + **************************************************************************************** + */ void fota_server_data_flash_ind_handler(unsigned short msgid, struct fota_server_data_flash_ind *param, unsigned short dest_id, @@ -289,7 +353,19 @@ version[8] = '\0'; BMH->FirmwareDataReceive(param->code_size,version); } - +/** + **************************************************************************************** + * @brief Handles ready indication from the GAP. + * + * @param[in] msgid Id of the message received. + * @param[in] param Pointer to the parameters of the message. + * @param[in] dest_id ID of the receiving task instance (TASK_GAP). + * @param[in] src_id ID of the sending task instance. + * @param[in] BMH Ble Message Handler class reference. + * + * @return If the message was consumed or not. + **************************************************************************************** + */ int gapm_device_ready_ind_handler(unsigned short msgid, struct gap_ready_evt *param, unsigned short dest_id, @@ -304,7 +380,19 @@ return 0; } - +/** + **************************************************************************************** + * @brief Handle reset GAP request completion event. + * + * @param[in] msgid Id of the message received. + * @param[in] param Pointer to the parameters of the message. + * @param[in] dest_id ID of the receiving task instance (TASK_GAP). + * @param[in] src_id ID of the sending task instance. + * @param[in] BMH Ble Message Handler class reference. + * + * @return If the message was consumed or not. + **************************************************************************************** + */ int gapm_reset_completion_handler(unsigned short msgid, struct gapm_cmp_evt *param, unsigned short dest_id, @@ -320,7 +408,19 @@ return 0; } - +/** + **************************************************************************************** + * @brief Handles GAPM_CMP_EVT event for GAPM_SET_DEV_CONFIG_CMD. + * + * @param[in] msgid Id of the message received. + * @param[in] param Pointer to the parameters of the message. + * @param[in] dest_id ID of the receiving task instance (TASK_GAP). + * @param[in] src_id ID of the sending task instance. + * @param[in] BMH Ble Message Handler class reference. + * + * @return If the message was consumed or not. + **************************************************************************************** + */ int gapm_set_dev_config_completion_handler(unsigned short msgid, struct gapm_cmp_evt *param, unsigned short dest_id, @@ -333,7 +433,19 @@ return 0; } - +/** + **************************************************************************************** + * @brief Handles Connection request indication event. + * + * @param[in] msgid Id of the message received. + * @param[in] param Pointer to the parameters of the message. + * @param[in] dest_id ID of the receiving task instance (TASK_GAP). + * @param[in] src_id ID of the sending task instance. + * @param[in] BMH Ble Message Handler class reference. + * + * @return If the message was consumed or not. + **************************************************************************************** + */ int gapc_connection_req_ind_handler(uint16_t msgid, struct gapc_connection_req_ind *param, uint16_t dest_id, @@ -362,7 +474,19 @@ return 0; } - +/** + **************************************************************************************** + * @brief Handles Discconnection indication event. + * + * @param[in] msgid Id of the message received. + * @param[in] param Pointer to the parameters of the message. + * @param[in] dest_id ID of the receiving task instance (TASK_GAP). + * @param[in] src_id ID of the sending task instance. + * @param[in] BMH Ble Message Handler class reference. + * + * @return If the message was consumed or not. + **************************************************************************************** + */ int gapc_disconnect_ind_handler(uint16_t msgid, struct gapc_disconnect_ind *param, uint16_t dest_id, @@ -384,3 +508,4 @@ }//namespace +/// @} dialog_fota module