![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Fan Control Demo
Fork of mbed_fota by
dialog_fota/dialog_fota_config.h@13:e6b38e2ebda2, 2015-10-13 (annotated)
- Committer:
- dudnwjs
- Date:
- Tue Oct 13 06:33:39 2015 +0000
- Revision:
- 13:e6b38e2ebda2
- Parent:
- 12:e3d3676753cc
fan demo;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dudnwjs | 9:fcf91f563147 | 1 | /** |
dudnwjs | 9:fcf91f563147 | 2 | * @file dialog_fota_config.h |
dudnwjs | 9:fcf91f563147 | 3 | * @brief Compile configuration file. |
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 | 3:1e70387e1337 | 10 | #ifndef DIALOG_FOTA_CONFIG_H |
dudnwjs | 3:1e70387e1337 | 11 | #define DIALOG_FOTA_CONFIG_H |
dudnwjs | 4:60be78a172c2 | 12 | #include "mbed.h" |
dudnwjs | 9:fcf91f563147 | 13 | /** |
dudnwjs | 9:fcf91f563147 | 14 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 15 | * @addtogroup dialog_fota module |
dudnwjs | 9:fcf91f563147 | 16 | * @brief Compile configuration. |
dudnwjs | 9:fcf91f563147 | 17 | * |
dudnwjs | 9:fcf91f563147 | 18 | * @{ |
dudnwjs | 9:fcf91f563147 | 19 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 20 | */ |
dudnwjs | 3:1e70387e1337 | 21 | namespace sevencore_fota{ |
dudnwjs | 4:60be78a172c2 | 22 | |
dudnwjs | 4:60be78a172c2 | 23 | #define BD_ADDR_LEN 0x06 |
dudnwjs | 4:60be78a172c2 | 24 | #define ADV_DATA_LEN 0x1F |
dudnwjs | 4:60be78a172c2 | 25 | #define SCAN_RSP_DATA_LEN 0x1F |
dudnwjs | 5:e11b23f9aacc | 26 | |
dudnwjs | 4:60be78a172c2 | 27 | #define CO_ERROR_NO_ERROR 0x00 |
dudnwjs | 4:60be78a172c2 | 28 | |
dudnwjs | 4:60be78a172c2 | 29 | |
dudnwjs | 3:1e70387e1337 | 30 | enum KE_TASK_TYPE |
dudnwjs | 3:1e70387e1337 | 31 | { |
dudnwjs | 3:1e70387e1337 | 32 | TASK_NONE = 0xFF, |
dudnwjs | 3:1e70387e1337 | 33 | |
dudnwjs | 3:1e70387e1337 | 34 | // Link Layer Tasks |
dudnwjs | 3:1e70387e1337 | 35 | TASK_LLM = 0 , |
dudnwjs | 3:1e70387e1337 | 36 | TASK_LLC = 1 , |
dudnwjs | 3:1e70387e1337 | 37 | TASK_LLD = 2 , |
dudnwjs | 3:1e70387e1337 | 38 | TASK_DBG = 3 , |
dudnwjs | 3:1e70387e1337 | 39 | |
dudnwjs | 3:1e70387e1337 | 40 | TASK_L2CM = 4 , |
dudnwjs | 3:1e70387e1337 | 41 | TASK_L2CC = 5 , |
dudnwjs | 3:1e70387e1337 | 42 | TASK_SMPM = 6 , |
dudnwjs | 3:1e70387e1337 | 43 | TASK_SMPC = 7 , |
dudnwjs | 3:1e70387e1337 | 44 | TASK_ATTM = 8 , // Attribute Protocol Manager Task |
dudnwjs | 3:1e70387e1337 | 45 | TASK_ATTC = 9 , // Attribute Protocol Client Task |
dudnwjs | 3:1e70387e1337 | 46 | |
dudnwjs | 3:1e70387e1337 | 47 | TASK_ATTS = 10 , // Attribute Protocol Server Task |
dudnwjs | 3:1e70387e1337 | 48 | TASK_GATTM = 11 , // Generic Attribute Profile Manager Task |
dudnwjs | 3:1e70387e1337 | 49 | TASK_GATTC = 12 , // Generic Attribute Profile Controller Task |
dudnwjs | 3:1e70387e1337 | 50 | TASK_GAPM = 13 , // Generic Access Profile Manager |
dudnwjs | 3:1e70387e1337 | 51 | TASK_GAPC = 14 , // Generic Access Profile Controller |
dudnwjs | 3:1e70387e1337 | 52 | |
dudnwjs | 3:1e70387e1337 | 53 | TASK_PROXM = 15 , // Proximity Monitor Task |
dudnwjs | 3:1e70387e1337 | 54 | TASK_PROXR = 16 , // Proximity Reporter Task |
dudnwjs | 3:1e70387e1337 | 55 | TASK_FINDL = 17 , // Find Me Locator Task |
dudnwjs | 3:1e70387e1337 | 56 | TASK_FINDT = 18 , // Find Me Target Task |
dudnwjs | 3:1e70387e1337 | 57 | TASK_HTPC = 19 , // Health Thermometer Collector Task |
dudnwjs | 3:1e70387e1337 | 58 | TASK_HTPT = 20 , // Health Thermometer Sensor Task |
dudnwjs | 3:1e70387e1337 | 59 | TASK_ACCEL = 21 , // Accelerometer Sensor Task |
dudnwjs | 3:1e70387e1337 | 60 | TASK_BLPS = 22 , // Blood Pressure Sensor Task |
dudnwjs | 3:1e70387e1337 | 61 | TASK_BLPC = 23 , // Blood Pressure Collector Task |
dudnwjs | 3:1e70387e1337 | 62 | TASK_HRPS = 24 , // Heart Rate Sensor Task |
dudnwjs | 3:1e70387e1337 | 63 | TASK_HRPC = 25 , // Heart Rate Collector Task |
dudnwjs | 3:1e70387e1337 | 64 | TASK_TIPS = 26 , // Time Server Task |
dudnwjs | 3:1e70387e1337 | 65 | TASK_TIPC = 27 , // Time Client Task |
dudnwjs | 3:1e70387e1337 | 66 | TASK_DISS = 28 , // Device Information Service Server Task |
dudnwjs | 3:1e70387e1337 | 67 | TASK_DISC = 29 , // Device Information Service Client Task |
dudnwjs | 3:1e70387e1337 | 68 | TASK_SCPPS = 30 , // Scan Parameter Profile Server Task |
dudnwjs | 3:1e70387e1337 | 69 | TASK_SCPPC = 31 , // Scan Parameter Profile Client Task |
dudnwjs | 3:1e70387e1337 | 70 | TASK_BASS = 32 , // Battery Service Server Task |
dudnwjs | 3:1e70387e1337 | 71 | TASK_BASC = 33 , // Battery Service Client Task |
dudnwjs | 3:1e70387e1337 | 72 | TASK_HOGPD = 34 , // HID Device Task |
dudnwjs | 3:1e70387e1337 | 73 | TASK_HOGPBH = 35 , // HID Boot Host Task |
dudnwjs | 3:1e70387e1337 | 74 | TASK_HOGPRH = 36 , // HID Report Host Task |
dudnwjs | 3:1e70387e1337 | 75 | TASK_GLPS = 37 , // Glucose Profile Sensor Task |
dudnwjs | 3:1e70387e1337 | 76 | TASK_GLPC = 38 , // Glucose Profile Collector Task |
dudnwjs | 3:1e70387e1337 | 77 | TASK_NBPS = 39 , // Nebulizer Profile Server Task |
dudnwjs | 3:1e70387e1337 | 78 | TASK_NBPC = 40 , // Nebulizer Profile Client Task |
dudnwjs | 3:1e70387e1337 | 79 | TASK_RSCPS = 41 , // Running Speed and Cadence Profile Server Task |
dudnwjs | 3:1e70387e1337 | 80 | TASK_RSCPC = 42 , // Running Speed and Cadence Profile Collector Task |
dudnwjs | 3:1e70387e1337 | 81 | TASK_CSCPS = 43 , // Cycling Speed and Cadence Profile Server Task |
dudnwjs | 3:1e70387e1337 | 82 | TASK_CSCPC = 44 , // Cycling Speed and Cadence Profile Client Task |
dudnwjs | 3:1e70387e1337 | 83 | TASK_ANPS = 45 , // Alert Notification Profile Server Task |
dudnwjs | 3:1e70387e1337 | 84 | TASK_ANPC = 46 , // Alert Notification Profile Client Task |
dudnwjs | 3:1e70387e1337 | 85 | TASK_PASPS = 47 , // Phone Alert Status Profile Server Task |
dudnwjs | 3:1e70387e1337 | 86 | TASK_PASPC = 48 , // Phone Alert Status Profile Client Task |
dudnwjs | 3:1e70387e1337 | 87 | |
dudnwjs | 3:1e70387e1337 | 88 | TASK_LANS = 49 , // Location and Navigation Profile Server Task |
dudnwjs | 3:1e70387e1337 | 89 | TASK_APP = 50 , // Do not Alter. |
dudnwjs | 3:1e70387e1337 | 90 | |
dudnwjs | 3:1e70387e1337 | 91 | TASK_LANC = 51 , // Location and Navigation Profile Client Task |
dudnwjs | 3:1e70387e1337 | 92 | |
dudnwjs | 3:1e70387e1337 | 93 | TASK_CPPS = 52 , // Cycling Power Profile Server Task |
dudnwjs | 3:1e70387e1337 | 94 | TASK_CPPC = 53 , // Cycling Power Profile Client Task |
dudnwjs | 3:1e70387e1337 | 95 | |
dudnwjs | 3:1e70387e1337 | 96 | // Start of conditionally assigned task types |
dudnwjs | 5:e11b23f9aacc | 97 | TASK_FOTA_SERVER = 54 , |
dudnwjs | 12:e3d3676753cc | 98 | TASK_FAN_CONTROL = 55 , |
dudnwjs | 3:1e70387e1337 | 99 | |
dudnwjs | 3:1e70387e1337 | 100 | #if (BLE_SAMPLE128) |
dudnwjs | 3:1e70387e1337 | 101 | TASK_SAMPLE128 , // Sample128 Task |
dudnwjs | 3:1e70387e1337 | 102 | #endif |
dudnwjs | 3:1e70387e1337 | 103 | |
dudnwjs | 3:1e70387e1337 | 104 | #if (BLE_SPOTA_RECEIVER) |
dudnwjs | 3:1e70387e1337 | 105 | TASK_SPOTAR , // SPOTA Receiver task |
dudnwjs | 3:1e70387e1337 | 106 | #endif |
dudnwjs | 3:1e70387e1337 | 107 | |
dudnwjs | 3:1e70387e1337 | 108 | #if (BLE_STREAMDATA_DEVICE) |
dudnwjs | 3:1e70387e1337 | 109 | TASK_STREAMDATAD , // Stream Data Device Server task |
dudnwjs | 3:1e70387e1337 | 110 | #endif |
dudnwjs | 3:1e70387e1337 | 111 | |
dudnwjs | 3:1e70387e1337 | 112 | #if (BLE_STREAMDATA_HOST) |
dudnwjs | 3:1e70387e1337 | 113 | TASK_STREAMDATAH , // Stream Data Device Server task |
dudnwjs | 3:1e70387e1337 | 114 | #endif |
dudnwjs | 3:1e70387e1337 | 115 | |
dudnwjs | 3:1e70387e1337 | 116 | #if (BLE_ANC_CLIENT) |
dudnwjs | 3:1e70387e1337 | 117 | TASK_ANCC , // ANCS Client Task |
dudnwjs | 3:1e70387e1337 | 118 | #endif |
dudnwjs | 3:1e70387e1337 | 119 | |
dudnwjs | 3:1e70387e1337 | 120 | #if (BLE_WPT_CLIENT) |
dudnwjs | 3:1e70387e1337 | 121 | TASK_WPTC , // A4WP Wireless Power Transfer Client Profile Task |
dudnwjs | 3:1e70387e1337 | 122 | #endif |
dudnwjs | 3:1e70387e1337 | 123 | |
dudnwjs | 3:1e70387e1337 | 124 | #if (BLE_WPTS) |
dudnwjs | 3:1e70387e1337 | 125 | TASK_WPTS , // A4WP Wireless Power Transfer Server Profile Task |
dudnwjs | 3:1e70387e1337 | 126 | #endif |
dudnwjs | 3:1e70387e1337 | 127 | |
dudnwjs | 3:1e70387e1337 | 128 | #if (BLE_APP_PTU) |
dudnwjs | 3:1e70387e1337 | 129 | TASK_APP_PTU , // A4WP Wireless Power Transfer Client App Task |
dudnwjs | 3:1e70387e1337 | 130 | #endif |
dudnwjs | 3:1e70387e1337 | 131 | |
dudnwjs | 3:1e70387e1337 | 132 | #if (BLE_IEU) |
dudnwjs | 3:1e70387e1337 | 133 | TASK_IEU , // Integrated Environmantal Unit Task |
dudnwjs | 3:1e70387e1337 | 134 | #endif |
dudnwjs | 3:1e70387e1337 | 135 | |
dudnwjs | 3:1e70387e1337 | 136 | #if (BLE_MPU) |
dudnwjs | 3:1e70387e1337 | 137 | TASK_MPU , // Motion Processing Unit Task |
dudnwjs | 3:1e70387e1337 | 138 | #endif |
dudnwjs | 3:1e70387e1337 | 139 | |
dudnwjs | 3:1e70387e1337 | 140 | #if (BLE_WSS_SERVER) |
dudnwjs | 3:1e70387e1337 | 141 | TASK_WSSS , // Weight Scale Server Task |
dudnwjs | 3:1e70387e1337 | 142 | #endif |
dudnwjs | 3:1e70387e1337 | 143 | |
dudnwjs | 3:1e70387e1337 | 144 | #if (BLE_UDS_SERVER) |
dudnwjs | 3:1e70387e1337 | 145 | TASK_UDSS , // User Data Server Task |
dudnwjs | 3:1e70387e1337 | 146 | #endif |
dudnwjs | 3:1e70387e1337 | 147 | |
dudnwjs | 3:1e70387e1337 | 148 | #if (BLE_SPS_SERVER) |
dudnwjs | 3:1e70387e1337 | 149 | TASK_SPS_SERVER , // Serial Proert Service Server Task |
dudnwjs | 3:1e70387e1337 | 150 | #endif |
dudnwjs | 3:1e70387e1337 | 151 | |
dudnwjs | 3:1e70387e1337 | 152 | #if (BLE_SPS_CLIENT) |
dudnwjs | 3:1e70387e1337 | 153 | TASK_SPS_CLIENT , // Serial Proert Service Server Task |
dudnwjs | 3:1e70387e1337 | 154 | #endif |
dudnwjs | 3:1e70387e1337 | 155 | |
dudnwjs | 3:1e70387e1337 | 156 | #if (BLE_ADC_NOTIFY) |
dudnwjs | 3:1e70387e1337 | 157 | TASK_ADC_NOTIFY , // Serial Proert Service Server Task |
dudnwjs | 3:1e70387e1337 | 158 | #endif |
dudnwjs | 3:1e70387e1337 | 159 | |
dudnwjs | 3:1e70387e1337 | 160 | #if (BLE_DEVICE_CONFIG) |
dudnwjs | 3:1e70387e1337 | 161 | TASK_DEVICE_CONFIG , // Serial Proert Service Server Task |
dudnwjs | 3:1e70387e1337 | 162 | #endif |
dudnwjs | 3:1e70387e1337 | 163 | |
dudnwjs | 3:1e70387e1337 | 164 | // End of conditionally assigned task types |
dudnwjs | 3:1e70387e1337 | 165 | |
dudnwjs | 3:1e70387e1337 | 166 | TASK_HCI = 60 , |
dudnwjs | 3:1e70387e1337 | 167 | TASK_HCIH = 61 , |
dudnwjs | 3:1e70387e1337 | 168 | |
dudnwjs | 3:1e70387e1337 | 169 | TASK_GTL = 63 , |
dudnwjs | 3:1e70387e1337 | 170 | |
dudnwjs | 3:1e70387e1337 | 171 | #if (USE_AES) |
dudnwjs | 3:1e70387e1337 | 172 | TASK_AES = 62 , // Task for asynchronous AES API |
dudnwjs | 3:1e70387e1337 | 173 | #endif |
dudnwjs | 3:1e70387e1337 | 174 | |
dudnwjs | 3:1e70387e1337 | 175 | TASK_MAX = 64, //MAX is 64. Do not exceed. |
dudnwjs | 3:1e70387e1337 | 176 | }; |
dudnwjs | 3:1e70387e1337 | 177 | |
dudnwjs | 3:1e70387e1337 | 178 | |
dudnwjs | 4:60be78a172c2 | 179 | ///BD Address structure |
dudnwjs | 4:60be78a172c2 | 180 | struct bd_addr |
dudnwjs | 4:60be78a172c2 | 181 | { |
dudnwjs | 4:60be78a172c2 | 182 | ///6-byte array address value |
dudnwjs | 4:60be78a172c2 | 183 | uint8_t addr[BD_ADDR_LEN]; |
dudnwjs | 4:60be78a172c2 | 184 | }; |
dudnwjs | 3:1e70387e1337 | 185 | |
dudnwjs | 4:60be78a172c2 | 186 | |
dudnwjs | 4:60be78a172c2 | 187 | ///Advertising report structure |
dudnwjs | 4:60be78a172c2 | 188 | struct adv_report |
dudnwjs | 4:60be78a172c2 | 189 | { |
dudnwjs | 4:60be78a172c2 | 190 | ///Event type: |
dudnwjs | 4:60be78a172c2 | 191 | /// - ADV_CONN_UNDIR: Connectable Undirected advertising |
dudnwjs | 4:60be78a172c2 | 192 | /// - ADV_CONN_DIR: Connectable directed advertising |
dudnwjs | 4:60be78a172c2 | 193 | /// - ADV_DISC_UNDIR: Discoverable undirected advertising |
dudnwjs | 4:60be78a172c2 | 194 | /// - ADV_NONCONN_UNDIR: Non-connectable undirected advertising |
dudnwjs | 4:60be78a172c2 | 195 | uint8_t evt_type; |
dudnwjs | 4:60be78a172c2 | 196 | ///Advertising address type: public/random |
dudnwjs | 4:60be78a172c2 | 197 | uint8_t adv_addr_type; |
dudnwjs | 4:60be78a172c2 | 198 | ///Advertising address value |
dudnwjs | 4:60be78a172c2 | 199 | struct bd_addr adv_addr; |
dudnwjs | 4:60be78a172c2 | 200 | ///Data length in advertising packet |
dudnwjs | 4:60be78a172c2 | 201 | uint8_t data_len; |
dudnwjs | 4:60be78a172c2 | 202 | ///Data of advertising packet |
dudnwjs | 4:60be78a172c2 | 203 | uint8_t data[ADV_DATA_LEN]; |
dudnwjs | 4:60be78a172c2 | 204 | ///RSSI value for advertising packet |
dudnwjs | 4:60be78a172c2 | 205 | uint8_t rssi; |
dudnwjs | 4:60be78a172c2 | 206 | }; |
dudnwjs | 4:60be78a172c2 | 207 | |
dudnwjs | 5:e11b23f9aacc | 208 | /// Connection type |
dudnwjs | 5:e11b23f9aacc | 209 | enum prf_con_type |
dudnwjs | 5:e11b23f9aacc | 210 | { |
dudnwjs | 5:e11b23f9aacc | 211 | ///Discovery type connection |
dudnwjs | 5:e11b23f9aacc | 212 | PRF_CON_DISCOVERY = 0x00, |
dudnwjs | 5:e11b23f9aacc | 213 | /// Normal type connection |
dudnwjs | 5:e11b23f9aacc | 214 | PRF_CON_NORMAL = 0x01, |
dudnwjs | 5:e11b23f9aacc | 215 | }; |
dudnwjs | 5:e11b23f9aacc | 216 | |
dudnwjs | 4:60be78a172c2 | 217 | }//namespace |
dudnwjs | 3:1e70387e1337 | 218 | |
dudnwjs | 9:fcf91f563147 | 219 | /// @} dialog_fota module |
dudnwjs | 9:fcf91f563147 | 220 | |
dudnwjs | 3:1e70387e1337 | 221 | #endif//DIALOG_FOTA_CONFIG_H |