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 KIM HyoengJun

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers dialog_fota_config.h Source File

dialog_fota_config.h

Go to the documentation of this file.
00001 /**
00002  * @file dialog_fota_config.h
00003  * @brief Compile configuration file.
00004  * Copyright 2015 SEVENCORE Co., Ltd.
00005  *
00006  * @author HyeongJun Kim 
00007  * @version 1.0.0  
00008  * @date 2015-08-20
00009 */
00010 #ifndef DIALOG_FOTA_CONFIG_H
00011 #define DIALOG_FOTA_CONFIG_H
00012 #include "mbed.h"
00013 /**
00014  ****************************************************************************************
00015  * @addtogroup dialog_fota module
00016  * @brief Compile configuration.
00017  *
00018  * @{
00019  ****************************************************************************************
00020  */
00021 namespace sevencore_fota{
00022 
00023 #define BD_ADDR_LEN         0x06
00024 #define ADV_DATA_LEN        0x1F
00025 #define SCAN_RSP_DATA_LEN   0x1F
00026 
00027 #define CO_ERROR_NO_ERROR                        0x00
00028 
00029 
00030 enum KE_TASK_TYPE
00031 {
00032     TASK_NONE = 0xFF,
00033 
00034     // Link Layer Tasks
00035     TASK_LLM          = 0   ,
00036     TASK_LLC          = 1   ,
00037     TASK_LLD          = 2   ,
00038     TASK_DBG          = 3   ,
00039 
00040     TASK_L2CM         = 4   ,
00041     TASK_L2CC         = 5   ,
00042     TASK_SMPM         = 6   ,
00043     TASK_SMPC         = 7   ,
00044     TASK_ATTM         = 8   ,   // Attribute Protocol Manager Task
00045     TASK_ATTC         = 9   ,   // Attribute Protocol Client Task
00046         
00047     TASK_ATTS         = 10  ,   // Attribute Protocol Server Task
00048     TASK_GATTM        = 11  ,   // Generic Attribute Profile Manager Task
00049     TASK_GATTC        = 12  ,   // Generic Attribute Profile Controller Task
00050     TASK_GAPM         = 13  ,   // Generic Access Profile Manager
00051     TASK_GAPC         = 14  ,   // Generic Access Profile Controller
00052     
00053     TASK_PROXM        = 15  ,   // Proximity Monitor Task
00054     TASK_PROXR        = 16  ,   // Proximity Reporter Task
00055     TASK_FINDL        = 17  ,   // Find Me Locator Task
00056     TASK_FINDT        = 18  ,   // Find Me Target Task
00057     TASK_HTPC         = 19  ,   // Health Thermometer Collector Task
00058     TASK_HTPT         = 20  ,   // Health Thermometer Sensor Task
00059     TASK_ACCEL        = 21  ,   // Accelerometer Sensor Task
00060     TASK_BLPS         = 22  ,   // Blood Pressure Sensor Task
00061     TASK_BLPC         = 23  ,   // Blood Pressure Collector Task
00062     TASK_HRPS         = 24  ,   // Heart Rate Sensor Task
00063     TASK_HRPC         = 25  ,   // Heart Rate Collector Task
00064     TASK_TIPS         = 26  ,   // Time Server Task
00065     TASK_TIPC         = 27  ,   // Time Client Task
00066     TASK_DISS         = 28  ,   // Device Information Service Server Task
00067     TASK_DISC         = 29  ,   // Device Information Service Client Task
00068     TASK_SCPPS        = 30  ,   // Scan Parameter Profile Server Task
00069     TASK_SCPPC        = 31  ,   // Scan Parameter Profile Client Task
00070     TASK_BASS         = 32  ,   // Battery Service Server Task
00071     TASK_BASC         = 33  ,   // Battery Service Client Task
00072     TASK_HOGPD        = 34  ,   // HID Device Task
00073     TASK_HOGPBH       = 35  ,   // HID Boot Host Task
00074     TASK_HOGPRH       = 36  ,   // HID Report Host Task
00075     TASK_GLPS         = 37  ,   // Glucose Profile Sensor Task
00076     TASK_GLPC         = 38  ,   // Glucose Profile Collector Task
00077     TASK_NBPS         = 39  ,   // Nebulizer Profile Server Task
00078     TASK_NBPC         = 40  ,   // Nebulizer Profile Client Task
00079     TASK_RSCPS        = 41  ,   // Running Speed and Cadence Profile Server Task
00080     TASK_RSCPC        = 42  ,   // Running Speed and Cadence Profile Collector Task
00081     TASK_CSCPS        = 43  ,   // Cycling Speed and Cadence Profile Server Task
00082     TASK_CSCPC        = 44  ,   // Cycling Speed and Cadence Profile Client Task
00083     TASK_ANPS         = 45  ,   // Alert Notification Profile Server Task
00084     TASK_ANPC         = 46  ,   // Alert Notification Profile Client Task
00085     TASK_PASPS        = 47  ,   // Phone Alert Status Profile Server Task
00086     TASK_PASPC        = 48  ,   // Phone Alert Status Profile Client Task
00087 
00088     TASK_LANS         = 49  ,   // Location and Navigation Profile Server Task
00089     TASK_APP          = 50  ,   // Do not Alter. 
00090 
00091     TASK_LANC         = 51  ,   // Location and Navigation Profile Client Task
00092 
00093     TASK_CPPS         = 52  ,   // Cycling Power Profile Server Task
00094     TASK_CPPC         = 53  ,   // Cycling Power Profile Client Task
00095     
00096     // Start of conditionally assigned task types
00097     TASK_FOTA_SERVER    = 54  ,
00098     
00099 #if (BLE_SAMPLE128)
00100     TASK_SAMPLE128    ,   // Sample128 Task
00101 #endif
00102 
00103 #if (BLE_SPOTA_RECEIVER)
00104     TASK_SPOTAR       ,   // SPOTA Receiver task
00105 #endif
00106 
00107 #if (BLE_STREAMDATA_DEVICE)
00108     TASK_STREAMDATAD  ,   // Stream Data Device Server task
00109 #endif
00110 
00111 #if (BLE_STREAMDATA_HOST)
00112     TASK_STREAMDATAH  ,   // Stream Data Device Server task
00113 #endif
00114 
00115 #if (BLE_ANC_CLIENT)
00116     TASK_ANCC         ,   // ANCS Client Task
00117 #endif
00118 
00119 #if (BLE_WPT_CLIENT)
00120     TASK_WPTC         ,   // A4WP Wireless Power Transfer Client Profile Task
00121 #endif
00122 
00123 #if (BLE_WPTS)
00124     TASK_WPTS         ,   // A4WP Wireless Power Transfer Server Profile Task
00125 #endif
00126 
00127 #if (BLE_APP_PTU)
00128      TASK_APP_PTU     ,   // A4WP Wireless Power Transfer Client App Task
00129 #endif
00130 
00131 #if (BLE_IEU)
00132     TASK_IEU          ,   // Integrated Environmantal Unit Task
00133 #endif
00134 
00135 #if (BLE_MPU)
00136     TASK_MPU          ,   // Motion Processing Unit Task
00137 #endif
00138 
00139 #if (BLE_WSS_SERVER)
00140     TASK_WSSS          ,   // Weight Scale Server Task
00141 #endif
00142 
00143 #if (BLE_UDS_SERVER)
00144     TASK_UDSS          ,   // User Data Server Task
00145 #endif
00146 
00147 #if (BLE_SPS_SERVER)
00148     TASK_SPS_SERVER    ,   // Serial Proert Service Server Task
00149 #endif
00150 
00151 #if (BLE_SPS_CLIENT)
00152     TASK_SPS_CLIENT    ,   // Serial Proert Service Server Task
00153 #endif
00154 
00155 #if (BLE_ADC_NOTIFY)
00156     TASK_ADC_NOTIFY    ,   // Serial Proert Service Server Task
00157 #endif
00158 
00159 #if (BLE_DEVICE_CONFIG)
00160     TASK_DEVICE_CONFIG    ,   // Serial Proert Service Server Task
00161 #endif
00162 
00163     // End of conditionally assigned task types
00164 
00165     TASK_HCI          = 60  ,
00166     TASK_HCIH         = 61  ,
00167 
00168     TASK_GTL          = 63  ,
00169 
00170 #if (USE_AES)
00171     TASK_AES          = 62  ,   // Task for asynchronous AES API
00172 #endif    
00173 
00174     TASK_MAX          = 64,  //MAX is 64. Do  not exceed. 
00175 };
00176 
00177 
00178 ///BD Address structure
00179 struct bd_addr
00180 {
00181     ///6-byte array address value
00182     uint8_t  addr[BD_ADDR_LEN];
00183 };
00184 
00185 
00186 ///Advertising report structure
00187 struct adv_report
00188 {
00189     ///Event type:
00190     /// - ADV_CONN_UNDIR: Connectable Undirected advertising
00191     /// - ADV_CONN_DIR: Connectable directed advertising
00192     /// - ADV_DISC_UNDIR: Discoverable undirected advertising
00193     /// - ADV_NONCONN_UNDIR: Non-connectable undirected advertising
00194     uint8_t        evt_type;
00195     ///Advertising address type: public/random
00196     uint8_t        adv_addr_type;
00197     ///Advertising address value
00198     struct bd_addr adv_addr;
00199     ///Data length in advertising packet
00200     uint8_t        data_len;
00201     ///Data of advertising packet
00202     uint8_t        data[ADV_DATA_LEN];
00203     ///RSSI value for advertising packet
00204     uint8_t        rssi;
00205 };
00206 
00207 /// Connection type
00208 enum prf_con_type
00209 {
00210     ///Discovery type connection
00211     PRF_CON_DISCOVERY = 0x00,
00212     /// Normal type connection
00213     PRF_CON_NORMAL    = 0x01,
00214 };
00215 
00216 }//namespace
00217 
00218 /// @} dialog_fota module
00219 
00220 #endif//DIALOG_FOTA_CONFIG_H