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 fota_server_task.h Source File

fota_server_task.h

Go to the documentation of this file.
00001 /**
00002  * @file fota_server_task.h
00003  * @brief Fota Server Task Header.
00004  * Copyright 2015 SEVENCORE Co., Ltd.
00005  *
00006  * @author HyeongJun Kim 
00007  * @version 1.0.0  
00008  * @date 2015-08-20
00009 */
00010 #ifndef FOTA_SERVER_TASK_H
00011 #define FOTA_SERVER_TASK_H
00012 
00013 /**
00014  ****************************************************************************************
00015  * @addtogroup dialog_fota module
00016  * @brief Fota Server Task Header.
00017  *
00018  * @{
00019  ****************************************************************************************
00020  */
00021 namespace sevencore_fota{
00022     
00023 #define APP_FOTA_SERVER_FIRMWARE_VERSION       ("01-00-00")
00024 #define APP_FOTA_SERVER_FIRMWARE_VERSION_LEN   (8)
00025 #define APP_FOTA_SERVER_FIRMWARE_NEW_VERSION            ("00-00-00")
00026 #define APP_FOTA_SERVER_FIRMWARE_NEW_VERSION_LEN        (8)
00027     
00028 ///Attribue Table Indexes
00029 enum
00030 {
00031     FOTA_SERVER_FIRMWARE_VERSION_CHAR,
00032     FOTA_SERVER_FIRMWARE_NEW_VERSION_CHAR,
00033     FOTA_SERVER_FIRMWARE_DATA_CHAR,
00034     FOTA_SERVER_SEQUENCE_NUMBER_CHAR,
00035     FOTA_SERVER_CHECKSUM_DATA_CHAR,
00036     FOTA_SERVER_FIRMWARE_DATA_CHECK_CHAR,
00037     FOTA_SERVER_FIRMWARE_UPGRADE_TYPE_CHAR,
00038     FOTA_SERVER_FIRMWARE_STATUS_CHAR,
00039     FOTA_SERVER_RESET_CHAR,
00040     
00041     FOTA_SERVER_CHAR_MAX,
00042 };
00043 
00044 /// Messages for Fota Server
00045 enum
00046 {
00047     /// Start fota_server. Device connection
00048     FOTA_SERVER_ENABLE_REQ = 55296,
00049     ///Create DataBase
00050     FOTA_SERVER_CREATE_DB_REQ,
00051     ///Inform APP of database creation status
00052     FOTA_SERVER_CREATE_DB_CFM,
00053     /// Disable confirm.
00054     FOTA_SERVER_DISABLE_IND,
00055     //Set Request of The Attribute Value of  Fota Service Characteristics  
00056     FOTA_SERVER_SET_CHAR_VAL_REQ,
00057     /// Error Indication
00058     FOTA_SERVER_ERROR_IND,
00059 };   
00060 /// include service entry element
00061 struct att_incl_desc
00062 {
00063     /// start handle value of included service
00064     unsigned short start_hdl;
00065     /// end handle value of included service
00066     unsigned short end_hdl;
00067     /// attribute value UUID
00068     unsigned short uuid;
00069 };
00070 
00071 /// Parameters of the @ref FOTA_SERVER_CREATE_DB_REQ message
00072 struct fota_server_create_db_req
00073 {
00074     /// Indicate if TXPS is supported or not
00075     uint16_t features;
00076     /// Include Service Info
00077     struct att_incl_desc ext_diss_ref;
00078     
00079 };    
00080 
00081 /// Parameters of the @ref FOTA_SERVER_CREATE_DB_CFM message
00082 struct fota_server_create_db_cfm
00083 {
00084     /// Status
00085     uint8_t status;
00086 };
00087 
00088 /// Parameters of the @ref FOTA_SERVER_SET_CHAR_VAL_REQ message - shall be dynamically allocated
00089 struct fota_server_set_char_val_req
00090 {
00091     /// Characteristic Code
00092     uint8_t char_code;
00093     /// Value length
00094     uint8_t val_len;
00095     /// Value
00096     uint8_t val[18];
00097 };
00098 
00099 /// Parameters of the @ref FOTA_SERVER_ENABLE_REQ message
00100 struct fota_server_enable_req
00101 {
00102     /// Connection Handle
00103     uint16_t conhdl;
00104     /// Security level
00105     uint8_t sec_lvl;
00106 };
00107 
00108 /// Parameters of the @ref FOTA_SERVER_DATA_FLASH_IND message - shall be dynamically allocated
00109 struct fota_server_data_flash_ind
00110 {
00111     // Firmware code size
00112     uint16_t code_size;
00113     // Firmware Version
00114     uint8_t version[8];
00115 };
00116 
00117     
00118     
00119 }//namespace
00120 
00121 /// @} dialog_fota module
00122 #endif//FOTA_SERVER_TASK_H