sevencore fota solution development project
dialog_fota/fota_server_task.h@10:18044afe4364, 2015-08-24 (annotated)
- Committer:
- dudnwjs
- Date:
- Mon Aug 24 03:11:00 2015 +0000
- Revision:
- 10:18044afe4364
- Parent:
- 9:fcf91f563147
Add header comment;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dudnwjs | 10:18044afe4364 | 1 | /** |
dudnwjs | 10:18044afe4364 | 2 | * @file fota_server_task.h |
dudnwjs | 10:18044afe4364 | 3 | * @brief Fota Server Task Header. |
dudnwjs | 10:18044afe4364 | 4 | * Copyright 2015 SEVENCORE Co., Ltd. |
dudnwjs | 10:18044afe4364 | 5 | * |
dudnwjs | 10:18044afe4364 | 6 | * @author HyeongJun Kim |
dudnwjs | 10:18044afe4364 | 7 | * @version 1.0.0 |
dudnwjs | 10:18044afe4364 | 8 | * @date 2015-08-20 |
dudnwjs | 10:18044afe4364 | 9 | */ |
dudnwjs | 5:e11b23f9aacc | 10 | #ifndef FOTA_SERVER_TASK_H |
dudnwjs | 5:e11b23f9aacc | 11 | #define FOTA_SERVER_TASK_H |
dudnwjs | 5:e11b23f9aacc | 12 | |
dudnwjs | 9:fcf91f563147 | 13 | /** |
dudnwjs | 9:fcf91f563147 | 14 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 15 | * @addtogroup dialog_fota module |
dudnwjs | 9:fcf91f563147 | 16 | * @brief Fota Server Task Header. |
dudnwjs | 9:fcf91f563147 | 17 | * |
dudnwjs | 9:fcf91f563147 | 18 | * @{ |
dudnwjs | 9:fcf91f563147 | 19 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 20 | */ |
dudnwjs | 5:e11b23f9aacc | 21 | namespace sevencore_fota{ |
dudnwjs | 5:e11b23f9aacc | 22 | |
dudnwjs | 5:e11b23f9aacc | 23 | #define APP_FOTA_SERVER_FIRMWARE_VERSION ("01-00-00") |
dudnwjs | 5:e11b23f9aacc | 24 | #define APP_FOTA_SERVER_FIRMWARE_VERSION_LEN (8) |
dudnwjs | 5:e11b23f9aacc | 25 | #define APP_FOTA_SERVER_FIRMWARE_NEW_VERSION ("00-00-00") |
dudnwjs | 5:e11b23f9aacc | 26 | #define APP_FOTA_SERVER_FIRMWARE_NEW_VERSION_LEN (8) |
dudnwjs | 5:e11b23f9aacc | 27 | |
dudnwjs | 9:fcf91f563147 | 28 | ///Attribue Table Indexes |
dudnwjs | 5:e11b23f9aacc | 29 | enum |
dudnwjs | 5:e11b23f9aacc | 30 | { |
dudnwjs | 5:e11b23f9aacc | 31 | FOTA_SERVER_FIRMWARE_VERSION_CHAR, |
dudnwjs | 5:e11b23f9aacc | 32 | FOTA_SERVER_FIRMWARE_NEW_VERSION_CHAR, |
dudnwjs | 5:e11b23f9aacc | 33 | FOTA_SERVER_FIRMWARE_DATA_CHAR, |
dudnwjs | 5:e11b23f9aacc | 34 | FOTA_SERVER_SEQUENCE_NUMBER_CHAR, |
dudnwjs | 5:e11b23f9aacc | 35 | FOTA_SERVER_CHECKSUM_DATA_CHAR, |
dudnwjs | 5:e11b23f9aacc | 36 | FOTA_SERVER_FIRMWARE_DATA_CHECK_CHAR, |
dudnwjs | 5:e11b23f9aacc | 37 | FOTA_SERVER_FIRMWARE_UPGRADE_TYPE_CHAR, |
dudnwjs | 5:e11b23f9aacc | 38 | FOTA_SERVER_FIRMWARE_STATUS_CHAR, |
dudnwjs | 5:e11b23f9aacc | 39 | FOTA_SERVER_RESET_CHAR, |
dudnwjs | 5:e11b23f9aacc | 40 | |
dudnwjs | 5:e11b23f9aacc | 41 | FOTA_SERVER_CHAR_MAX, |
dudnwjs | 5:e11b23f9aacc | 42 | }; |
dudnwjs | 5:e11b23f9aacc | 43 | |
dudnwjs | 5:e11b23f9aacc | 44 | /// Messages for Fota Server |
dudnwjs | 5:e11b23f9aacc | 45 | enum |
dudnwjs | 5:e11b23f9aacc | 46 | { |
dudnwjs | 5:e11b23f9aacc | 47 | /// Start fota_server. Device connection |
dudnwjs | 5:e11b23f9aacc | 48 | FOTA_SERVER_ENABLE_REQ = 55296, |
dudnwjs | 5:e11b23f9aacc | 49 | ///Create DataBase |
dudnwjs | 5:e11b23f9aacc | 50 | FOTA_SERVER_CREATE_DB_REQ, |
dudnwjs | 5:e11b23f9aacc | 51 | ///Inform APP of database creation status |
dudnwjs | 5:e11b23f9aacc | 52 | FOTA_SERVER_CREATE_DB_CFM, |
dudnwjs | 5:e11b23f9aacc | 53 | /// Disable confirm. |
dudnwjs | 5:e11b23f9aacc | 54 | FOTA_SERVER_DISABLE_IND, |
dudnwjs | 5:e11b23f9aacc | 55 | //Set Request of The Attribute Value of Fota Service Characteristics |
dudnwjs | 5:e11b23f9aacc | 56 | FOTA_SERVER_SET_CHAR_VAL_REQ, |
dudnwjs | 5:e11b23f9aacc | 57 | /// Error Indication |
dudnwjs | 5:e11b23f9aacc | 58 | FOTA_SERVER_ERROR_IND, |
dudnwjs | 5:e11b23f9aacc | 59 | }; |
dudnwjs | 5:e11b23f9aacc | 60 | /// include service entry element |
dudnwjs | 5:e11b23f9aacc | 61 | struct att_incl_desc |
dudnwjs | 5:e11b23f9aacc | 62 | { |
dudnwjs | 5:e11b23f9aacc | 63 | /// start handle value of included service |
dudnwjs | 5:e11b23f9aacc | 64 | unsigned short start_hdl; |
dudnwjs | 5:e11b23f9aacc | 65 | /// end handle value of included service |
dudnwjs | 5:e11b23f9aacc | 66 | unsigned short end_hdl; |
dudnwjs | 5:e11b23f9aacc | 67 | /// attribute value UUID |
dudnwjs | 5:e11b23f9aacc | 68 | unsigned short uuid; |
dudnwjs | 5:e11b23f9aacc | 69 | }; |
dudnwjs | 5:e11b23f9aacc | 70 | |
dudnwjs | 5:e11b23f9aacc | 71 | /// Parameters of the @ref FOTA_SERVER_CREATE_DB_REQ message |
dudnwjs | 5:e11b23f9aacc | 72 | struct fota_server_create_db_req |
dudnwjs | 5:e11b23f9aacc | 73 | { |
dudnwjs | 5:e11b23f9aacc | 74 | /// Indicate if TXPS is supported or not |
dudnwjs | 5:e11b23f9aacc | 75 | uint16_t features; |
dudnwjs | 5:e11b23f9aacc | 76 | /// Include Service Info |
dudnwjs | 5:e11b23f9aacc | 77 | struct att_incl_desc ext_diss_ref; |
dudnwjs | 5:e11b23f9aacc | 78 | |
dudnwjs | 5:e11b23f9aacc | 79 | }; |
dudnwjs | 5:e11b23f9aacc | 80 | |
dudnwjs | 5:e11b23f9aacc | 81 | /// Parameters of the @ref FOTA_SERVER_CREATE_DB_CFM message |
dudnwjs | 5:e11b23f9aacc | 82 | struct fota_server_create_db_cfm |
dudnwjs | 5:e11b23f9aacc | 83 | { |
dudnwjs | 5:e11b23f9aacc | 84 | /// Status |
dudnwjs | 5:e11b23f9aacc | 85 | uint8_t status; |
dudnwjs | 5:e11b23f9aacc | 86 | }; |
dudnwjs | 5:e11b23f9aacc | 87 | |
dudnwjs | 5:e11b23f9aacc | 88 | /// Parameters of the @ref FOTA_SERVER_SET_CHAR_VAL_REQ message - shall be dynamically allocated |
dudnwjs | 5:e11b23f9aacc | 89 | struct fota_server_set_char_val_req |
dudnwjs | 5:e11b23f9aacc | 90 | { |
dudnwjs | 5:e11b23f9aacc | 91 | /// Characteristic Code |
dudnwjs | 5:e11b23f9aacc | 92 | uint8_t char_code; |
dudnwjs | 5:e11b23f9aacc | 93 | /// Value length |
dudnwjs | 5:e11b23f9aacc | 94 | uint8_t val_len; |
dudnwjs | 5:e11b23f9aacc | 95 | /// Value |
dudnwjs | 5:e11b23f9aacc | 96 | uint8_t val[18]; |
dudnwjs | 5:e11b23f9aacc | 97 | }; |
dudnwjs | 5:e11b23f9aacc | 98 | |
dudnwjs | 5:e11b23f9aacc | 99 | /// Parameters of the @ref FOTA_SERVER_ENABLE_REQ message |
dudnwjs | 5:e11b23f9aacc | 100 | struct fota_server_enable_req |
dudnwjs | 5:e11b23f9aacc | 101 | { |
dudnwjs | 5:e11b23f9aacc | 102 | /// Connection Handle |
dudnwjs | 5:e11b23f9aacc | 103 | uint16_t conhdl; |
dudnwjs | 5:e11b23f9aacc | 104 | /// Security level |
dudnwjs | 5:e11b23f9aacc | 105 | uint8_t sec_lvl; |
dudnwjs | 5:e11b23f9aacc | 106 | }; |
dudnwjs | 6:8dd20294b2aa | 107 | |
dudnwjs | 6:8dd20294b2aa | 108 | /// Parameters of the @ref FOTA_SERVER_DATA_FLASH_IND message - shall be dynamically allocated |
dudnwjs | 6:8dd20294b2aa | 109 | struct fota_server_data_flash_ind |
dudnwjs | 6:8dd20294b2aa | 110 | { |
dudnwjs | 6:8dd20294b2aa | 111 | // Firmware code size |
dudnwjs | 6:8dd20294b2aa | 112 | uint16_t code_size; |
dudnwjs | 6:8dd20294b2aa | 113 | // Firmware Version |
dudnwjs | 6:8dd20294b2aa | 114 | uint8_t version[8]; |
dudnwjs | 6:8dd20294b2aa | 115 | }; |
dudnwjs | 6:8dd20294b2aa | 116 | |
dudnwjs | 5:e11b23f9aacc | 117 | |
dudnwjs | 5:e11b23f9aacc | 118 | |
dudnwjs | 5:e11b23f9aacc | 119 | }//namespace |
dudnwjs | 9:fcf91f563147 | 120 | |
dudnwjs | 9:fcf91f563147 | 121 | /// @} dialog_fota module |
dudnwjs | 5:e11b23f9aacc | 122 | #endif//FOTA_SERVER_TASK_H |