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

diss_task.h

Go to the documentation of this file.
00001 /**
00002  * @file diss_task.h
00003  * @brief Device Information Service Server 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 DISS_TASK_H
00011 #define DISS_TASK_H
00012 
00013 /**
00014  ****************************************************************************************
00015  * @addtogroup dialog_fota module
00016  * @brief Device Information Service Server Header
00017  *
00018  * @{
00019  ****************************************************************************************
00020  */
00021 namespace sevencore_fota{
00022 
00023 #define STR_MAX_LEN     (18)
00024 
00025 
00026 ///Attribute Table Indexes
00027 enum
00028 {
00029     DIS_MANUFACTURER_NAME_CHAR,
00030     DIS_MODEL_NB_STR_CHAR,
00031     DIS_SERIAL_NB_STR_CHAR,
00032     DIS_HARD_REV_STR_CHAR,
00033     DIS_FIRM_REV_STR_CHAR,
00034     DIS_SW_REV_STR_CHAR,
00035     DIS_SYSTEM_ID_CHAR,
00036     DIS_IEEE_CHAR,
00037     DIS_PNP_ID_CHAR,
00038 
00039     DIS_CHAR_MAX,
00040 };
00041 
00042 
00043 /// Messages for Device Information Service Server
00044 enum
00045 {
00046     ///Add a DIS instance into the database
00047     DISS_CREATE_DB_REQ = 28672,
00048     ///Inform APP of database creation status
00049     DISS_CREATE_DB_CFM,
00050     ///Set the value of an attribute
00051     DISS_SET_CHAR_VAL_REQ,
00052 
00053     ///Start the Device Information Service Task - at connection
00054     DISS_ENABLE_REQ,
00055 
00056     /// Inform the application that the profile service role task has been disabled after a disconnection
00057     DISS_DISABLE_IND,
00058 
00059     ///Error indication to Host
00060     DISS_ERROR_IND,
00061 };
00062 
00063 ///Database Configuration Flags
00064 enum
00065 {
00066     ///Indicate if Manufacturer Name String Char. is supported
00067     DIS_MANUFACTURER_NAME_CHAR_SUP       = 0x0001,
00068     ///Indicate if Model Number String Char. is supported
00069     DIS_MODEL_NB_STR_CHAR_SUP            = 0x0002,
00070     ///Indicate if Serial Number String Char. is supported
00071     DIS_SERIAL_NB_STR_CHAR_SUP           = 0x0004,
00072     ///Indicate if Hardware Revision String Char. supports indications
00073     DIS_HARD_REV_STR_CHAR_SUP            = 0x0008,
00074     ///Indicate if Firmware Revision String Char. is writable
00075     DIS_FIRM_REV_STR_CHAR_SUP            = 0x0010,
00076     ///Indicate if Software Revision String Char. is writable
00077     DIS_SW_REV_STR_CHAR_SUP              = 0x0020,
00078     ///Indicate if System ID Char. is writable
00079     DIS_SYSTEM_ID_CHAR_SUP               = 0x0040,
00080     ///Indicate if IEEE Char. is writable
00081     DIS_IEEE_CHAR_SUP                    = 0x0080,
00082     ///Indicate if PnP ID Char. is writable
00083     DIS_PNP_ID_CHAR_SUP                  = 0x0100,
00084 
00085     ///All features are supported
00086     DIS_ALL_FEAT_SUP                     = 0x01FF,
00087 };
00088   
00089 /// Parameters of the @ref DISS_CREATE_DB_CFM message
00090 struct diss_create_db_cfm
00091 {
00092     ///Status
00093     uint8_t status;
00094 };
00095 
00096 /// Parameters of the @ref DISS_SET_CHAR_VAL_REQ message - shall be dynamically allocated
00097 struct diss_set_char_val_req
00098 {
00099     /// Characteristic Code
00100     uint8_t char_code;
00101     /// Value length
00102     uint8_t val_len;
00103     /// Value
00104     uint8_t val[STR_MAX_LEN];
00105 };
00106 
00107 /// Parameters of the @ref DISS_CREATE_DB_REQ message
00108 struct diss_create_db_req
00109 {
00110     ///Database configuration
00111     uint16_t features;
00112 };
00113 
00114 /// Parameters of the @ref DISS_ENABLE_REQ message
00115 struct diss_enable_req
00116 {
00117     ///Connection handle
00118     uint16_t conhdl;
00119     /// security level: b0= nothing, b1=unauthenticated, b2=authenticated, b3=authorized; b1 or b2 and b3 can go together
00120     uint8_t sec_lvl;
00121     ///Type of connection
00122     uint8_t con_type;
00123 };
00124 
00125 }//namespace
00126 
00127 /// @} dialog_fota module
00128 
00129 #endif//DISS_TASK_H