BLE fota Lamp Demo
Dependencies: mbed-rtos mbed mbed_fota_fan_control
Fork of mbed_fota_fan_control by
dialog_fota/app_task.h@13:e714e2971c49, 2015-10-13 (annotated)
- Committer:
- dudnwjs
- Date:
- Tue Oct 13 06:35:19 2015 +0000
- Revision:
- 13:e714e2971c49
- Parent:
- 12:e3d3676753cc
lamp demo;
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 | 12:e3d3676753cc | 99 | * @brief Handles the FAN_CONTROL_CREATE_DB_CFM message. |
dudnwjs | 12:e3d3676753cc | 100 | * |
dudnwjs | 12:e3d3676753cc | 101 | * @param[in] msgid Id of the message received. |
dudnwjs | 12:e3d3676753cc | 102 | * @param[in] param Pointer to the parameters of the message. |
dudnwjs | 12:e3d3676753cc | 103 | * @param[in] dest_id ID of the receiving task instance (TASK_GAP). |
dudnwjs | 12:e3d3676753cc | 104 | * @param[in] src_id ID of the sending task instance. |
dudnwjs | 12:e3d3676753cc | 105 | * @param[in] BMH Ble Message Handler class reference. |
dudnwjs | 12:e3d3676753cc | 106 | * |
dudnwjs | 12:e3d3676753cc | 107 | * @return If the message was consumed or not. |
dudnwjs | 12:e3d3676753cc | 108 | **************************************************************************************** |
dudnwjs | 12:e3d3676753cc | 109 | */ |
dudnwjs | 12:e3d3676753cc | 110 | void fan_control_create_db_cfm_handler(unsigned short msgid, |
dudnwjs | 12:e3d3676753cc | 111 | struct fan_control_create_db_cfm *param, |
dudnwjs | 12:e3d3676753cc | 112 | unsigned short dest_id, |
dudnwjs | 12:e3d3676753cc | 113 | unsigned short src_id, |
dudnwjs | 12:e3d3676753cc | 114 | BleMsgHandler* BMH); |
dudnwjs | 12:e3d3676753cc | 115 | /** |
dudnwjs | 12:e3d3676753cc | 116 | **************************************************************************************** |
dudnwjs | 12:e3d3676753cc | 117 | * @brief Handles the FAN_CONTROL_COMMAND_IND message. |
dudnwjs | 12:e3d3676753cc | 118 | * |
dudnwjs | 12:e3d3676753cc | 119 | * @param[in] msgid Id of the message received. |
dudnwjs | 12:e3d3676753cc | 120 | * @param[in] param Pointer to the parameters of the message. |
dudnwjs | 12:e3d3676753cc | 121 | * @param[in] dest_id ID of the receiving task instance (TASK_GAP). |
dudnwjs | 12:e3d3676753cc | 122 | * @param[in] src_id ID of the sending task instance. |
dudnwjs | 12:e3d3676753cc | 123 | * @param[in] BMH Ble Message Handler class reference. |
dudnwjs | 12:e3d3676753cc | 124 | * |
dudnwjs | 12:e3d3676753cc | 125 | * @return If the message was consumed or not. |
dudnwjs | 12:e3d3676753cc | 126 | **************************************************************************************** |
dudnwjs | 12:e3d3676753cc | 127 | */ |
dudnwjs | 12:e3d3676753cc | 128 | void fan_control_command_ind_handler(unsigned short msgid, |
dudnwjs | 12:e3d3676753cc | 129 | struct fan_control_command_ind *param, |
dudnwjs | 12:e3d3676753cc | 130 | unsigned short dest_id, |
dudnwjs | 12:e3d3676753cc | 131 | unsigned short src_id, |
dudnwjs | 12:e3d3676753cc | 132 | BleMsgHandler* BMH); |
dudnwjs | 12:e3d3676753cc | 133 | /** |
dudnwjs | 12:e3d3676753cc | 134 | **************************************************************************************** |
dudnwjs | 13:e714e2971c49 | 135 | * @brief Handles the LAMP_CONTROL_CREATE_DB_CFM message. |
dudnwjs | 13:e714e2971c49 | 136 | * |
dudnwjs | 13:e714e2971c49 | 137 | * @param[in] msgid Id of the message received. |
dudnwjs | 13:e714e2971c49 | 138 | * @param[in] param Pointer to the parameters of the message. |
dudnwjs | 13:e714e2971c49 | 139 | * @param[in] dest_id ID of the receiving task instance (TASK_GAP). |
dudnwjs | 13:e714e2971c49 | 140 | * @param[in] src_id ID of the sending task instance. |
dudnwjs | 13:e714e2971c49 | 141 | * @param[in] BMH Ble Message Handler class reference. |
dudnwjs | 13:e714e2971c49 | 142 | * |
dudnwjs | 13:e714e2971c49 | 143 | * @return If the message was consumed or not. |
dudnwjs | 13:e714e2971c49 | 144 | **************************************************************************************** |
dudnwjs | 13:e714e2971c49 | 145 | */ |
dudnwjs | 13:e714e2971c49 | 146 | void lamp_control_create_db_cfm_handler(unsigned short msgid, |
dudnwjs | 13:e714e2971c49 | 147 | struct lamp_control_create_db_cfm *param, |
dudnwjs | 13:e714e2971c49 | 148 | unsigned short dest_id, |
dudnwjs | 13:e714e2971c49 | 149 | unsigned short src_id, |
dudnwjs | 13:e714e2971c49 | 150 | BleMsgHandler* BMH); |
dudnwjs | 13:e714e2971c49 | 151 | /** |
dudnwjs | 13:e714e2971c49 | 152 | **************************************************************************************** |
dudnwjs | 13:e714e2971c49 | 153 | * @brief Handles the LAMP_CONTROL_COMMAND_IND message. |
dudnwjs | 13:e714e2971c49 | 154 | * |
dudnwjs | 13:e714e2971c49 | 155 | * @param[in] msgid Id of the message received. |
dudnwjs | 13:e714e2971c49 | 156 | * @param[in] param Pointer to the parameters of the message. |
dudnwjs | 13:e714e2971c49 | 157 | * @param[in] dest_id ID of the receiving task instance (TASK_GAP). |
dudnwjs | 13:e714e2971c49 | 158 | * @param[in] src_id ID of the sending task instance. |
dudnwjs | 13:e714e2971c49 | 159 | * @param[in] BMH Ble Message Handler class reference. |
dudnwjs | 13:e714e2971c49 | 160 | * |
dudnwjs | 13:e714e2971c49 | 161 | * @return If the message was consumed or not. |
dudnwjs | 13:e714e2971c49 | 162 | **************************************************************************************** |
dudnwjs | 13:e714e2971c49 | 163 | */ |
dudnwjs | 13:e714e2971c49 | 164 | void lamp_control_command_ind_handler(unsigned short msgid, |
dudnwjs | 13:e714e2971c49 | 165 | struct lamp_control_command_ind *param, |
dudnwjs | 13:e714e2971c49 | 166 | unsigned short dest_id, |
dudnwjs | 13:e714e2971c49 | 167 | unsigned short src_id, |
dudnwjs | 13:e714e2971c49 | 168 | BleMsgHandler* BMH); |
dudnwjs | 13:e714e2971c49 | 169 | /** |
dudnwjs | 13:e714e2971c49 | 170 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 171 | * @brief Handles ready indication from the GAP. |
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 | 4:60be78a172c2 | 182 | int gapm_device_ready_ind_handler(unsigned short msgid, |
dudnwjs | 5:e11b23f9aacc | 183 | struct gap_ready_evt *param, |
dudnwjs | 4:60be78a172c2 | 184 | unsigned short dest_id, |
dudnwjs | 4:60be78a172c2 | 185 | unsigned short src_id, |
dudnwjs | 4:60be78a172c2 | 186 | BleMsgHandler* BMH ); |
dudnwjs | 9:fcf91f563147 | 187 | /** |
dudnwjs | 9:fcf91f563147 | 188 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 189 | * @brief Handle reset GAP request completion event. |
dudnwjs | 9:fcf91f563147 | 190 | * |
dudnwjs | 9:fcf91f563147 | 191 | * @param[in] msgid Id of the message received. |
dudnwjs | 9:fcf91f563147 | 192 | * @param[in] param Pointer to the parameters of the message. |
dudnwjs | 9:fcf91f563147 | 193 | * @param[in] dest_id ID of the receiving task instance (TASK_GAP). |
dudnwjs | 9:fcf91f563147 | 194 | * @param[in] src_id ID of the sending task instance. |
dudnwjs | 9:fcf91f563147 | 195 | * @param[in] BMH Ble Message Handler class reference. |
dudnwjs | 9:fcf91f563147 | 196 | * |
dudnwjs | 9:fcf91f563147 | 197 | * @return If the message was consumed or not. |
dudnwjs | 9:fcf91f563147 | 198 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 199 | */ |
dudnwjs | 4:60be78a172c2 | 200 | int gapm_reset_completion_handler(unsigned short msgid, |
dudnwjs | 4:60be78a172c2 | 201 | struct gapm_cmp_evt *param, |
dudnwjs | 4:60be78a172c2 | 202 | unsigned short dest_id, |
dudnwjs | 4:60be78a172c2 | 203 | unsigned short src_id, |
dudnwjs | 4:60be78a172c2 | 204 | BleMsgHandler* BMH); |
dudnwjs | 9:fcf91f563147 | 205 | /** |
dudnwjs | 9:fcf91f563147 | 206 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 207 | * @brief Handles GAPM_CMP_EVT event for GAPM_SET_DEV_CONFIG_CMD. |
dudnwjs | 9:fcf91f563147 | 208 | * |
dudnwjs | 9:fcf91f563147 | 209 | * @param[in] msgid Id of the message received. |
dudnwjs | 9:fcf91f563147 | 210 | * @param[in] param Pointer to the parameters of the message. |
dudnwjs | 9:fcf91f563147 | 211 | * @param[in] dest_id ID of the receiving task instance (TASK_GAP). |
dudnwjs | 9:fcf91f563147 | 212 | * @param[in] src_id ID of the sending task instance. |
dudnwjs | 9:fcf91f563147 | 213 | * @param[in] BMH Ble Message Handler class reference. |
dudnwjs | 9:fcf91f563147 | 214 | * |
dudnwjs | 9:fcf91f563147 | 215 | * @return If the message was consumed or not. |
dudnwjs | 9:fcf91f563147 | 216 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 217 | */ |
dudnwjs | 4:60be78a172c2 | 218 | int gapm_set_dev_config_completion_handler(unsigned short msgid, |
dudnwjs | 4:60be78a172c2 | 219 | struct gapm_cmp_evt *param, |
dudnwjs | 4:60be78a172c2 | 220 | unsigned short dest_id, |
dudnwjs | 4:60be78a172c2 | 221 | unsigned short src_id, |
dudnwjs | 4:60be78a172c2 | 222 | BleMsgHandler* BMH); |
dudnwjs | 9:fcf91f563147 | 223 | /** |
dudnwjs | 9:fcf91f563147 | 224 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 225 | * @brief Handles Connection request indication event. |
dudnwjs | 9:fcf91f563147 | 226 | * |
dudnwjs | 9:fcf91f563147 | 227 | * @param[in] msgid Id of the message received. |
dudnwjs | 9:fcf91f563147 | 228 | * @param[in] param Pointer to the parameters of the message. |
dudnwjs | 9:fcf91f563147 | 229 | * @param[in] dest_id ID of the receiving task instance (TASK_GAP). |
dudnwjs | 9:fcf91f563147 | 230 | * @param[in] src_id ID of the sending task instance. |
dudnwjs | 9:fcf91f563147 | 231 | * @param[in] BMH Ble Message Handler class reference. |
dudnwjs | 9:fcf91f563147 | 232 | * |
dudnwjs | 9:fcf91f563147 | 233 | * @return If the message was consumed or not. |
dudnwjs | 9:fcf91f563147 | 234 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 235 | */ |
dudnwjs | 5:e11b23f9aacc | 236 | int gapc_connection_req_ind_handler(uint16_t msgid, |
dudnwjs | 5:e11b23f9aacc | 237 | struct gapc_connection_req_ind *param, |
dudnwjs | 5:e11b23f9aacc | 238 | uint16_t dest_id, |
dudnwjs | 5:e11b23f9aacc | 239 | uint16_t src_id, |
dudnwjs | 5:e11b23f9aacc | 240 | BleMsgHandler* BMH); |
dudnwjs | 9:fcf91f563147 | 241 | /** |
dudnwjs | 9:fcf91f563147 | 242 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 243 | * @brief Handles Discconnection indication event. |
dudnwjs | 9:fcf91f563147 | 244 | * |
dudnwjs | 9:fcf91f563147 | 245 | * @param[in] msgid Id of the message received. |
dudnwjs | 9:fcf91f563147 | 246 | * @param[in] param Pointer to the parameters of the message. |
dudnwjs | 9:fcf91f563147 | 247 | * @param[in] dest_id ID of the receiving task instance (TASK_GAP). |
dudnwjs | 9:fcf91f563147 | 248 | * @param[in] src_id ID of the sending task instance. |
dudnwjs | 9:fcf91f563147 | 249 | * @param[in] BMH Ble Message Handler class reference. |
dudnwjs | 9:fcf91f563147 | 250 | * |
dudnwjs | 9:fcf91f563147 | 251 | * @return If the message was consumed or not. |
dudnwjs | 9:fcf91f563147 | 252 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 253 | */ |
dudnwjs | 5:e11b23f9aacc | 254 | int gapc_disconnect_ind_handler(uint16_t msgid, |
dudnwjs | 5:e11b23f9aacc | 255 | struct gapc_disconnect_ind *param, |
dudnwjs | 5:e11b23f9aacc | 256 | uint16_t dest_id, |
dudnwjs | 5:e11b23f9aacc | 257 | uint16_t src_id, |
dudnwjs | 5:e11b23f9aacc | 258 | BleMsgHandler* BMH); |
dudnwjs | 9:fcf91f563147 | 259 | |
dudnwjs | 5:e11b23f9aacc | 260 | |
dudnwjs | 4:60be78a172c2 | 261 | |
dudnwjs | 4:60be78a172c2 | 262 | }//namespace |
dudnwjs | 9:fcf91f563147 | 263 | |
dudnwjs | 9:fcf91f563147 | 264 | /// @} dialog_fota module |
dudnwjs | 9:fcf91f563147 | 265 | |
dudnwjs | 4:60be78a172c2 | 266 | #endif//APP_TASK_H |