KIM HyoengJun / Mbed 2 deprecated mbed_fota_robot_control

Dependencies:   mbed-rtos mbed mbed_fota_fan_control

Fork of mbed_fota_lamp_control 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     //Flash new firmware data on flash memory
00058     FOTA_SERVER_DATA_FLASH_IND,
00059     /// Error Indication
00060     FOTA_SERVER_ERROR_IND,
00061 };   
00062 /// include service entry element
00063 struct att_incl_desc
00064 {
00065     /// start handle value of included service
00066     unsigned short start_hdl;
00067     /// end handle value of included service
00068     unsigned short end_hdl;
00069     /// attribute value UUID
00070     unsigned short uuid;
00071 };
00072 
00073 /// Parameters of the @ref FOTA_SERVER_CREATE_DB_REQ message
00074 struct fota_server_create_db_req
00075 {
00076     /// Indicate if TXPS is supported or not
00077     uint16_t features;
00078     /// Include Service Info
00079     struct att_incl_desc ext_diss_ref;
00080     
00081 };    
00082 
00083 /// Parameters of the @ref FOTA_SERVER_CREATE_DB_CFM message
00084 struct fota_server_create_db_cfm
00085 {
00086     /// Status
00087     uint8_t status;
00088 };
00089 
00090 /// Parameters of the @ref FOTA_SERVER_SET_CHAR_VAL_REQ message - shall be dynamically allocated
00091 struct fota_server_set_char_val_req
00092 {
00093     /// Characteristic Code
00094     uint8_t char_code;
00095     /// Value length
00096     uint8_t val_len;
00097     /// Value
00098     uint8_t val[18];
00099 };
00100 
00101 /// Parameters of the @ref FOTA_SERVER_ENABLE_REQ message
00102 struct fota_server_enable_req
00103 {
00104     /// Connection Handle
00105     uint16_t conhdl;
00106     /// Security level
00107     uint8_t sec_lvl;
00108 };
00109 
00110 /// Parameters of the @ref FOTA_SERVER_DATA_FLASH_IND message - shall be dynamically allocated
00111 struct fota_server_data_flash_ind
00112 {
00113     // Firmware code size
00114     uint16_t code_size;
00115     // Firmware Version
00116     uint8_t version[8];
00117 };
00118 
00119     
00120     
00121 }//namespace
00122 
00123 /// @} dialog_fota module
00124 #endif//FOTA_SERVER_TASK_H