BLE fota Lamp Demo
Dependencies: mbed-rtos mbed mbed_fota_fan_control
Fork of mbed_fota_fan_control by
dialog_fota/app_task.h@9:fcf91f563147, 2015-08-24 (annotated)
- Committer:
- dudnwjs
- Date:
- Mon Aug 24 02:29:16 2015 +0000
- Revision:
- 9:fcf91f563147
- Parent:
- 6:8dd20294b2aa
- Child:
- 12:e3d3676753cc
Add comment for form doxygen;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dudnwjs | 9:fcf91f563147 | 1 | /** |
dudnwjs | 9:fcf91f563147 | 2 | * @file app_task.h |
dudnwjs | 9:fcf91f563147 | 3 | * @brief Header file for application handlers for ble events and responses. |
dudnwjs | 9:fcf91f563147 | 4 | * Copyright 2015 SEVENCORE Co., Ltd. |
dudnwjs | 9:fcf91f563147 | 5 | * |
dudnwjs | 9:fcf91f563147 | 6 | * @author HyeongJun Kim |
dudnwjs | 9:fcf91f563147 | 7 | * @version 1.0.0 |
dudnwjs | 9:fcf91f563147 | 8 | * @date 2015-08-20 |
dudnwjs | 9:fcf91f563147 | 9 | */ |
dudnwjs | 4:60be78a172c2 | 10 | #ifndef APP_TASK_H |
dudnwjs | 4:60be78a172c2 | 11 | #define APP_TASK_H |
dudnwjs | 4:60be78a172c2 | 12 | #include "gapm_task.h" |
dudnwjs | 5:e11b23f9aacc | 13 | #include "gapc_task.h" |
dudnwjs | 4:60be78a172c2 | 14 | #include "BleMsgHandler.h" |
dudnwjs | 4:60be78a172c2 | 15 | |
dudnwjs | 9:fcf91f563147 | 16 | /** |
dudnwjs | 9:fcf91f563147 | 17 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 18 | * @addtogroup dialog_fota module |
dudnwjs | 9:fcf91f563147 | 19 | * @brief application handlers for ble events and responses. |
dudnwjs | 9:fcf91f563147 | 20 | * |
dudnwjs | 9:fcf91f563147 | 21 | * @{ |
dudnwjs | 9:fcf91f563147 | 22 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 23 | */ |
dudnwjs | 4:60be78a172c2 | 24 | namespace sevencore_fota{ |
dudnwjs | 4:60be78a172c2 | 25 | |
dudnwjs | 9:fcf91f563147 | 26 | /** |
dudnwjs | 9:fcf91f563147 | 27 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 28 | * @brief Handles GAPM_ADV_REPORT_IND event. |
dudnwjs | 9:fcf91f563147 | 29 | * |
dudnwjs | 9:fcf91f563147 | 30 | * @param[in] msgid Id of the message received. |
dudnwjs | 9:fcf91f563147 | 31 | * @param[in] param Pointer to the parameters of the message. |
dudnwjs | 9:fcf91f563147 | 32 | * @param[in] dest_id ID of the receiving task instance (TASK_GAP). |
dudnwjs | 9:fcf91f563147 | 33 | * @param[in] src_id ID of the sending task instance. |
dudnwjs | 9:fcf91f563147 | 34 | * |
dudnwjs | 9:fcf91f563147 | 35 | * @return If the message was consumed or not. |
dudnwjs | 9:fcf91f563147 | 36 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 37 | */ |
dudnwjs | 4:60be78a172c2 | 38 | int gapm_adv_report_ind_handler(unsigned short msgid, |
dudnwjs | 4:60be78a172c2 | 39 | struct gapm_adv_report_ind *param, |
dudnwjs | 4:60be78a172c2 | 40 | unsigned short dest_id, |
dudnwjs | 4:60be78a172c2 | 41 | unsigned short src_id); |
dudnwjs | 4:60be78a172c2 | 42 | |
dudnwjs | 9:fcf91f563147 | 43 | /** |
dudnwjs | 9:fcf91f563147 | 44 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 45 | * @brief Handles the DISS_CREATE_DB_CFM message. |
dudnwjs | 9:fcf91f563147 | 46 | * |
dudnwjs | 9:fcf91f563147 | 47 | * @param[in] msgid Id of the message received. |
dudnwjs | 9:fcf91f563147 | 48 | * @param[in] param Pointer to the parameters of the message. |
dudnwjs | 9:fcf91f563147 | 49 | * @param[in] dest_id ID of the receiving task instance (TASK_GAP). |
dudnwjs | 9:fcf91f563147 | 50 | * @param[in] src_id ID of the sending task instance. |
dudnwjs | 9:fcf91f563147 | 51 | * @param[in] BMH Ble Message Handler class reference. |
dudnwjs | 9:fcf91f563147 | 52 | * |
dudnwjs | 9:fcf91f563147 | 53 | * @return If the message was consumed or not. |
dudnwjs | 9:fcf91f563147 | 54 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 55 | */ |
dudnwjs | 9:fcf91f563147 | 56 | int diss_create_db_cfm_handler(unsigned short msgid, |
dudnwjs | 4:60be78a172c2 | 57 | struct diss_create_db_cfm *param, |
dudnwjs | 4:60be78a172c2 | 58 | unsigned short dest_id, |
dudnwjs | 4:60be78a172c2 | 59 | unsigned short src_id, |
dudnwjs | 5:e11b23f9aacc | 60 | BleMsgHandler* BMH); |
dudnwjs | 9:fcf91f563147 | 61 | /** |
dudnwjs | 9:fcf91f563147 | 62 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 63 | * @brief Handles the FOTA_SERVER_CREATE_DB_CFM message. |
dudnwjs | 9:fcf91f563147 | 64 | * |
dudnwjs | 9:fcf91f563147 | 65 | * @param[in] msgid Id of the message received. |
dudnwjs | 9:fcf91f563147 | 66 | * @param[in] param Pointer to the parameters of the message. |
dudnwjs | 9:fcf91f563147 | 67 | * @param[in] dest_id ID of the receiving task instance (TASK_GAP). |
dudnwjs | 9:fcf91f563147 | 68 | * @param[in] src_id ID of the sending task instance. |
dudnwjs | 9:fcf91f563147 | 69 | * @param[in] BMH Ble Message Handler class reference. |
dudnwjs | 9:fcf91f563147 | 70 | * |
dudnwjs | 9:fcf91f563147 | 71 | * @return If the message was consumed or not. |
dudnwjs | 9:fcf91f563147 | 72 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 73 | */ |
dudnwjs | 5:e11b23f9aacc | 74 | int fota_server_create_db_cfm_handler(unsigned short msgid, |
dudnwjs | 5:e11b23f9aacc | 75 | struct fota_server_create_db_cfm *param, |
dudnwjs | 5:e11b23f9aacc | 76 | unsigned short dest_id, |
dudnwjs | 5:e11b23f9aacc | 77 | unsigned short src_id, |
dudnwjs | 9:fcf91f563147 | 78 | BleMsgHandler* BMH); |
dudnwjs | 9:fcf91f563147 | 79 | /** |
dudnwjs | 9:fcf91f563147 | 80 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 81 | * @brief Handles Firmware Data Copy event. |
dudnwjs | 9:fcf91f563147 | 82 | * |
dudnwjs | 9:fcf91f563147 | 83 | * @param[in] msgid Id of the message received. |
dudnwjs | 9:fcf91f563147 | 84 | * @param[in] param Pointer to the parameters of the message. |
dudnwjs | 9:fcf91f563147 | 85 | * @param[in] dest_id ID of the receiving task instance (TASK_GAP). |
dudnwjs | 9:fcf91f563147 | 86 | * @param[in] src_id ID of the sending task instance. |
dudnwjs | 9:fcf91f563147 | 87 | * @param[in] BMH Ble Message Handler class reference. |
dudnwjs | 9:fcf91f563147 | 88 | * |
dudnwjs | 9:fcf91f563147 | 89 | * @return If the message was consumed or not. |
dudnwjs | 9:fcf91f563147 | 90 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 91 | */ |
dudnwjs | 9:fcf91f563147 | 92 | void fota_server_data_flash_ind_handler(unsigned short msgid, |
dudnwjs | 9:fcf91f563147 | 93 | struct fota_server_data_flash_ind *param, |
dudnwjs | 9:fcf91f563147 | 94 | unsigned short dest_id, |
dudnwjs | 9:fcf91f563147 | 95 | unsigned short src_id, |
dudnwjs | 9:fcf91f563147 | 96 | BleMsgHandler* BMH); |
dudnwjs | 9:fcf91f563147 | 97 | /** |
dudnwjs | 9:fcf91f563147 | 98 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 99 | * @brief Handles ready indication from the GAP. |
dudnwjs | 9:fcf91f563147 | 100 | * |
dudnwjs | 9:fcf91f563147 | 101 | * @param[in] msgid Id of the message received. |
dudnwjs | 9:fcf91f563147 | 102 | * @param[in] param Pointer to the parameters of the message. |
dudnwjs | 9:fcf91f563147 | 103 | * @param[in] dest_id ID of the receiving task instance (TASK_GAP). |
dudnwjs | 9:fcf91f563147 | 104 | * @param[in] src_id ID of the sending task instance. |
dudnwjs | 9:fcf91f563147 | 105 | * @param[in] BMH Ble Message Handler class reference. |
dudnwjs | 9:fcf91f563147 | 106 | * |
dudnwjs | 9:fcf91f563147 | 107 | * @return If the message was consumed or not. |
dudnwjs | 9:fcf91f563147 | 108 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 109 | */ |
dudnwjs | 4:60be78a172c2 | 110 | int gapm_device_ready_ind_handler(unsigned short msgid, |
dudnwjs | 5:e11b23f9aacc | 111 | struct gap_ready_evt *param, |
dudnwjs | 4:60be78a172c2 | 112 | unsigned short dest_id, |
dudnwjs | 4:60be78a172c2 | 113 | unsigned short src_id, |
dudnwjs | 4:60be78a172c2 | 114 | BleMsgHandler* BMH ); |
dudnwjs | 9:fcf91f563147 | 115 | /** |
dudnwjs | 9:fcf91f563147 | 116 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 117 | * @brief Handle reset GAP request completion event. |
dudnwjs | 9:fcf91f563147 | 118 | * |
dudnwjs | 9:fcf91f563147 | 119 | * @param[in] msgid Id of the message received. |
dudnwjs | 9:fcf91f563147 | 120 | * @param[in] param Pointer to the parameters of the message. |
dudnwjs | 9:fcf91f563147 | 121 | * @param[in] dest_id ID of the receiving task instance (TASK_GAP). |
dudnwjs | 9:fcf91f563147 | 122 | * @param[in] src_id ID of the sending task instance. |
dudnwjs | 9:fcf91f563147 | 123 | * @param[in] BMH Ble Message Handler class reference. |
dudnwjs | 9:fcf91f563147 | 124 | * |
dudnwjs | 9:fcf91f563147 | 125 | * @return If the message was consumed or not. |
dudnwjs | 9:fcf91f563147 | 126 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 127 | */ |
dudnwjs | 4:60be78a172c2 | 128 | int gapm_reset_completion_handler(unsigned short msgid, |
dudnwjs | 4:60be78a172c2 | 129 | struct gapm_cmp_evt *param, |
dudnwjs | 4:60be78a172c2 | 130 | unsigned short dest_id, |
dudnwjs | 4:60be78a172c2 | 131 | unsigned short src_id, |
dudnwjs | 4:60be78a172c2 | 132 | BleMsgHandler* BMH); |
dudnwjs | 9:fcf91f563147 | 133 | /** |
dudnwjs | 9:fcf91f563147 | 134 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 135 | * @brief Handles GAPM_CMP_EVT event for GAPM_SET_DEV_CONFIG_CMD. |
dudnwjs | 9:fcf91f563147 | 136 | * |
dudnwjs | 9:fcf91f563147 | 137 | * @param[in] msgid Id of the message received. |
dudnwjs | 9:fcf91f563147 | 138 | * @param[in] param Pointer to the parameters of the message. |
dudnwjs | 9:fcf91f563147 | 139 | * @param[in] dest_id ID of the receiving task instance (TASK_GAP). |
dudnwjs | 9:fcf91f563147 | 140 | * @param[in] src_id ID of the sending task instance. |
dudnwjs | 9:fcf91f563147 | 141 | * @param[in] BMH Ble Message Handler class reference. |
dudnwjs | 9:fcf91f563147 | 142 | * |
dudnwjs | 9:fcf91f563147 | 143 | * @return If the message was consumed or not. |
dudnwjs | 9:fcf91f563147 | 144 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 145 | */ |
dudnwjs | 4:60be78a172c2 | 146 | int gapm_set_dev_config_completion_handler(unsigned short msgid, |
dudnwjs | 4:60be78a172c2 | 147 | struct gapm_cmp_evt *param, |
dudnwjs | 4:60be78a172c2 | 148 | unsigned short dest_id, |
dudnwjs | 4:60be78a172c2 | 149 | unsigned short src_id, |
dudnwjs | 4:60be78a172c2 | 150 | BleMsgHandler* BMH); |
dudnwjs | 9:fcf91f563147 | 151 | /** |
dudnwjs | 9:fcf91f563147 | 152 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 153 | * @brief Handles Connection request indication event. |
dudnwjs | 9:fcf91f563147 | 154 | * |
dudnwjs | 9:fcf91f563147 | 155 | * @param[in] msgid Id of the message received. |
dudnwjs | 9:fcf91f563147 | 156 | * @param[in] param Pointer to the parameters of the message. |
dudnwjs | 9:fcf91f563147 | 157 | * @param[in] dest_id ID of the receiving task instance (TASK_GAP). |
dudnwjs | 9:fcf91f563147 | 158 | * @param[in] src_id ID of the sending task instance. |
dudnwjs | 9:fcf91f563147 | 159 | * @param[in] BMH Ble Message Handler class reference. |
dudnwjs | 9:fcf91f563147 | 160 | * |
dudnwjs | 9:fcf91f563147 | 161 | * @return If the message was consumed or not. |
dudnwjs | 9:fcf91f563147 | 162 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 163 | */ |
dudnwjs | 5:e11b23f9aacc | 164 | int gapc_connection_req_ind_handler(uint16_t msgid, |
dudnwjs | 5:e11b23f9aacc | 165 | struct gapc_connection_req_ind *param, |
dudnwjs | 5:e11b23f9aacc | 166 | uint16_t dest_id, |
dudnwjs | 5:e11b23f9aacc | 167 | uint16_t src_id, |
dudnwjs | 5:e11b23f9aacc | 168 | BleMsgHandler* BMH); |
dudnwjs | 9:fcf91f563147 | 169 | /** |
dudnwjs | 9:fcf91f563147 | 170 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 171 | * @brief Handles Discconnection indication event. |
dudnwjs | 9:fcf91f563147 | 172 | * |
dudnwjs | 9:fcf91f563147 | 173 | * @param[in] msgid Id of the message received. |
dudnwjs | 9:fcf91f563147 | 174 | * @param[in] param Pointer to the parameters of the message. |
dudnwjs | 9:fcf91f563147 | 175 | * @param[in] dest_id ID of the receiving task instance (TASK_GAP). |
dudnwjs | 9:fcf91f563147 | 176 | * @param[in] src_id ID of the sending task instance. |
dudnwjs | 9:fcf91f563147 | 177 | * @param[in] BMH Ble Message Handler class reference. |
dudnwjs | 9:fcf91f563147 | 178 | * |
dudnwjs | 9:fcf91f563147 | 179 | * @return If the message was consumed or not. |
dudnwjs | 9:fcf91f563147 | 180 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 181 | */ |
dudnwjs | 5:e11b23f9aacc | 182 | int gapc_disconnect_ind_handler(uint16_t msgid, |
dudnwjs | 5:e11b23f9aacc | 183 | struct gapc_disconnect_ind *param, |
dudnwjs | 5:e11b23f9aacc | 184 | uint16_t dest_id, |
dudnwjs | 5:e11b23f9aacc | 185 | uint16_t src_id, |
dudnwjs | 5:e11b23f9aacc | 186 | BleMsgHandler* BMH); |
dudnwjs | 9:fcf91f563147 | 187 | |
dudnwjs | 5:e11b23f9aacc | 188 | |
dudnwjs | 4:60be78a172c2 | 189 | |
dudnwjs | 4:60be78a172c2 | 190 | }//namespace |
dudnwjs | 9:fcf91f563147 | 191 | |
dudnwjs | 9:fcf91f563147 | 192 | /// @} dialog_fota module |
dudnwjs | 9:fcf91f563147 | 193 | |
dudnwjs | 4:60be78a172c2 | 194 | #endif//APP_TASK_H |