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
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.
dialog_fota/fota_server_task.h@5:e11b23f9aacc, 2015-07-13 (annotated)
- Committer:
- dudnwjs
- Date:
- Mon Jul 13 06:32:05 2015 +0000
- Revision:
- 5:e11b23f9aacc
- Child:
- 6:8dd20294b2aa
Fota Service Add complete
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dudnwjs | 5:e11b23f9aacc | 1 | #ifndef FOTA_SERVER_TASK_H |
dudnwjs | 5:e11b23f9aacc | 2 | #define FOTA_SERVER_TASK_H |
dudnwjs | 5:e11b23f9aacc | 3 | |
dudnwjs | 5:e11b23f9aacc | 4 | |
dudnwjs | 5:e11b23f9aacc | 5 | namespace sevencore_fota{ |
dudnwjs | 5:e11b23f9aacc | 6 | |
dudnwjs | 5:e11b23f9aacc | 7 | #define APP_FOTA_SERVER_FIRMWARE_VERSION ("01-00-00") |
dudnwjs | 5:e11b23f9aacc | 8 | #define APP_FOTA_SERVER_FIRMWARE_VERSION_LEN (8) |
dudnwjs | 5:e11b23f9aacc | 9 | #define APP_FOTA_SERVER_FIRMWARE_NEW_VERSION ("00-00-00") |
dudnwjs | 5:e11b23f9aacc | 10 | #define APP_FOTA_SERVER_FIRMWARE_NEW_VERSION_LEN (8) |
dudnwjs | 5:e11b23f9aacc | 11 | |
dudnwjs | 5:e11b23f9aacc | 12 | //Attribue Table Indexes |
dudnwjs | 5:e11b23f9aacc | 13 | enum |
dudnwjs | 5:e11b23f9aacc | 14 | { |
dudnwjs | 5:e11b23f9aacc | 15 | FOTA_SERVER_FIRMWARE_VERSION_CHAR, |
dudnwjs | 5:e11b23f9aacc | 16 | FOTA_SERVER_FIRMWARE_NEW_VERSION_CHAR, |
dudnwjs | 5:e11b23f9aacc | 17 | FOTA_SERVER_FIRMWARE_DATA_CHAR, |
dudnwjs | 5:e11b23f9aacc | 18 | FOTA_SERVER_SEQUENCE_NUMBER_CHAR, |
dudnwjs | 5:e11b23f9aacc | 19 | FOTA_SERVER_CHECKSUM_DATA_CHAR, |
dudnwjs | 5:e11b23f9aacc | 20 | FOTA_SERVER_FIRMWARE_DATA_CHECK_CHAR, |
dudnwjs | 5:e11b23f9aacc | 21 | FOTA_SERVER_FIRMWARE_UPGRADE_TYPE_CHAR, |
dudnwjs | 5:e11b23f9aacc | 22 | FOTA_SERVER_FIRMWARE_STATUS_CHAR, |
dudnwjs | 5:e11b23f9aacc | 23 | FOTA_SERVER_RESET_CHAR, |
dudnwjs | 5:e11b23f9aacc | 24 | |
dudnwjs | 5:e11b23f9aacc | 25 | FOTA_SERVER_CHAR_MAX, |
dudnwjs | 5:e11b23f9aacc | 26 | }; |
dudnwjs | 5:e11b23f9aacc | 27 | |
dudnwjs | 5:e11b23f9aacc | 28 | /// Messages for Fota Server |
dudnwjs | 5:e11b23f9aacc | 29 | enum |
dudnwjs | 5:e11b23f9aacc | 30 | { |
dudnwjs | 5:e11b23f9aacc | 31 | /// Start fota_server. Device connection |
dudnwjs | 5:e11b23f9aacc | 32 | FOTA_SERVER_ENABLE_REQ = 55296, |
dudnwjs | 5:e11b23f9aacc | 33 | ///Create DataBase |
dudnwjs | 5:e11b23f9aacc | 34 | FOTA_SERVER_CREATE_DB_REQ, |
dudnwjs | 5:e11b23f9aacc | 35 | ///Inform APP of database creation status |
dudnwjs | 5:e11b23f9aacc | 36 | FOTA_SERVER_CREATE_DB_CFM, |
dudnwjs | 5:e11b23f9aacc | 37 | /// Disable confirm. |
dudnwjs | 5:e11b23f9aacc | 38 | FOTA_SERVER_DISABLE_IND, |
dudnwjs | 5:e11b23f9aacc | 39 | //Set Request of The Attribute Value of Fota Service Characteristics |
dudnwjs | 5:e11b23f9aacc | 40 | FOTA_SERVER_SET_CHAR_VAL_REQ, |
dudnwjs | 5:e11b23f9aacc | 41 | /// Error Indication |
dudnwjs | 5:e11b23f9aacc | 42 | FOTA_SERVER_ERROR_IND, |
dudnwjs | 5:e11b23f9aacc | 43 | }; |
dudnwjs | 5:e11b23f9aacc | 44 | /// include service entry element |
dudnwjs | 5:e11b23f9aacc | 45 | struct att_incl_desc |
dudnwjs | 5:e11b23f9aacc | 46 | { |
dudnwjs | 5:e11b23f9aacc | 47 | /// start handle value of included service |
dudnwjs | 5:e11b23f9aacc | 48 | unsigned short start_hdl; |
dudnwjs | 5:e11b23f9aacc | 49 | /// end handle value of included service |
dudnwjs | 5:e11b23f9aacc | 50 | unsigned short end_hdl; |
dudnwjs | 5:e11b23f9aacc | 51 | /// attribute value UUID |
dudnwjs | 5:e11b23f9aacc | 52 | unsigned short uuid; |
dudnwjs | 5:e11b23f9aacc | 53 | }; |
dudnwjs | 5:e11b23f9aacc | 54 | |
dudnwjs | 5:e11b23f9aacc | 55 | /// Parameters of the @ref FOTA_SERVER_CREATE_DB_REQ message |
dudnwjs | 5:e11b23f9aacc | 56 | struct fota_server_create_db_req |
dudnwjs | 5:e11b23f9aacc | 57 | { |
dudnwjs | 5:e11b23f9aacc | 58 | /// Indicate if TXPS is supported or not |
dudnwjs | 5:e11b23f9aacc | 59 | uint16_t features; |
dudnwjs | 5:e11b23f9aacc | 60 | /// Include Service Info |
dudnwjs | 5:e11b23f9aacc | 61 | struct att_incl_desc ext_diss_ref; |
dudnwjs | 5:e11b23f9aacc | 62 | |
dudnwjs | 5:e11b23f9aacc | 63 | }; |
dudnwjs | 5:e11b23f9aacc | 64 | |
dudnwjs | 5:e11b23f9aacc | 65 | /// Parameters of the @ref FOTA_SERVER_CREATE_DB_CFM message |
dudnwjs | 5:e11b23f9aacc | 66 | struct fota_server_create_db_cfm |
dudnwjs | 5:e11b23f9aacc | 67 | { |
dudnwjs | 5:e11b23f9aacc | 68 | /// Status |
dudnwjs | 5:e11b23f9aacc | 69 | uint8_t status; |
dudnwjs | 5:e11b23f9aacc | 70 | }; |
dudnwjs | 5:e11b23f9aacc | 71 | |
dudnwjs | 5:e11b23f9aacc | 72 | /// Parameters of the @ref FOTA_SERVER_SET_CHAR_VAL_REQ message - shall be dynamically allocated |
dudnwjs | 5:e11b23f9aacc | 73 | struct fota_server_set_char_val_req |
dudnwjs | 5:e11b23f9aacc | 74 | { |
dudnwjs | 5:e11b23f9aacc | 75 | /// Characteristic Code |
dudnwjs | 5:e11b23f9aacc | 76 | uint8_t char_code; |
dudnwjs | 5:e11b23f9aacc | 77 | /// Value length |
dudnwjs | 5:e11b23f9aacc | 78 | uint8_t val_len; |
dudnwjs | 5:e11b23f9aacc | 79 | /// Value |
dudnwjs | 5:e11b23f9aacc | 80 | uint8_t val[18]; |
dudnwjs | 5:e11b23f9aacc | 81 | }; |
dudnwjs | 5:e11b23f9aacc | 82 | |
dudnwjs | 5:e11b23f9aacc | 83 | /// Parameters of the @ref FOTA_SERVER_ENABLE_REQ message |
dudnwjs | 5:e11b23f9aacc | 84 | struct fota_server_enable_req |
dudnwjs | 5:e11b23f9aacc | 85 | { |
dudnwjs | 5:e11b23f9aacc | 86 | /// Connection Handle |
dudnwjs | 5:e11b23f9aacc | 87 | uint16_t conhdl; |
dudnwjs | 5:e11b23f9aacc | 88 | /// Security level |
dudnwjs | 5:e11b23f9aacc | 89 | uint8_t sec_lvl; |
dudnwjs | 5:e11b23f9aacc | 90 | }; |
dudnwjs | 5:e11b23f9aacc | 91 | |
dudnwjs | 5:e11b23f9aacc | 92 | |
dudnwjs | 5:e11b23f9aacc | 93 | }//namespace |
dudnwjs | 5:e11b23f9aacc | 94 | #endif//FOTA_SERVER_TASK_H |