![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Fan Control Demo
Fork of mbed_fota by
dialog_fota/gapm_task.h@13:e6b38e2ebda2, 2015-10-13 (annotated)
- Committer:
- dudnwjs
- Date:
- Tue Oct 13 06:33:39 2015 +0000
- Revision:
- 13:e6b38e2ebda2
- Parent:
- 10:18044afe4364
fan demo;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dudnwjs | 10:18044afe4364 | 1 | /** |
dudnwjs | 10:18044afe4364 | 2 | * @file gapm_task.h |
dudnwjs | 10:18044afe4364 | 3 | * @brief Generic Access Profile Manager 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 | 3:1e70387e1337 | 10 | #ifndef GAPM_TASK_H |
dudnwjs | 3:1e70387e1337 | 11 | #define GAPM_TASK_H |
dudnwjs | 3:1e70387e1337 | 12 | |
dudnwjs | 4:60be78a172c2 | 13 | #include "dialog_fota_config.h" |
dudnwjs | 5:e11b23f9aacc | 14 | #include "gap.h" |
dudnwjs | 4:60be78a172c2 | 15 | |
dudnwjs | 9:fcf91f563147 | 16 | /** |
dudnwjs | 9:fcf91f563147 | 17 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 18 | * @addtogroup dialog_fota module |
dudnwjs | 9:fcf91f563147 | 19 | * @brief Generic Access Profile Manager Task Header. |
dudnwjs | 9:fcf91f563147 | 20 | * |
dudnwjs | 9:fcf91f563147 | 21 | * @{ |
dudnwjs | 9:fcf91f563147 | 22 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 23 | */ |
dudnwjs | 3:1e70387e1337 | 24 | namespace sevencore_fota{ |
dudnwjs | 3:1e70387e1337 | 25 | |
dudnwjs | 4:60be78a172c2 | 26 | /// Advertising or scanning report information event |
dudnwjs | 4:60be78a172c2 | 27 | struct gapm_adv_report_ind |
dudnwjs | 4:60be78a172c2 | 28 | { |
dudnwjs | 4:60be78a172c2 | 29 | /// Advertising report structure |
dudnwjs | 4:60be78a172c2 | 30 | struct adv_report report; |
dudnwjs | 4:60be78a172c2 | 31 | }; |
dudnwjs | 4:60be78a172c2 | 32 | |
dudnwjs | 3:1e70387e1337 | 33 | /// Reset link layer and the host command |
dudnwjs | 3:1e70387e1337 | 34 | struct gapm_reset_cmd |
dudnwjs | 3:1e70387e1337 | 35 | { |
dudnwjs | 3:1e70387e1337 | 36 | /// GAPM requested operation: |
dudnwjs | 3:1e70387e1337 | 37 | /// - GAPM_RESET: Reset BLE subsystem: LL and HL. |
dudnwjs | 3:1e70387e1337 | 38 | uint8_t operation; |
dudnwjs | 3:1e70387e1337 | 39 | }; |
dudnwjs | 4:60be78a172c2 | 40 | /// Command complete event data structure |
dudnwjs | 4:60be78a172c2 | 41 | struct gapm_cmp_evt |
dudnwjs | 4:60be78a172c2 | 42 | { |
dudnwjs | 4:60be78a172c2 | 43 | /// GAP requested operation |
dudnwjs | 4:60be78a172c2 | 44 | uint8_t operation; |
dudnwjs | 4:60be78a172c2 | 45 | /// Status of the request |
dudnwjs | 4:60be78a172c2 | 46 | uint8_t status; |
dudnwjs | 4:60be78a172c2 | 47 | }; |
dudnwjs | 4:60be78a172c2 | 48 | |
dudnwjs | 4:60be78a172c2 | 49 | /// Air operation default parameters |
dudnwjs | 4:60be78a172c2 | 50 | struct gapm_air_operation |
dudnwjs | 4:60be78a172c2 | 51 | { |
dudnwjs | 4:60be78a172c2 | 52 | /// Operation code. |
dudnwjs | 4:60be78a172c2 | 53 | uint8_t code; |
dudnwjs | 4:60be78a172c2 | 54 | |
dudnwjs | 4:60be78a172c2 | 55 | |
dudnwjs | 4:60be78a172c2 | 56 | /** Own BD address source of the device: |
dudnwjs | 4:60be78a172c2 | 57 | * - GAPM_PUBLIC_ADDR: Public Address |
dudnwjs | 4:60be78a172c2 | 58 | * - GAPM_PROVIDED_RND_ADDR: Provided random address |
dudnwjs | 4:60be78a172c2 | 59 | * - GAPM_GEN_STATIC_RND_ADDR: Generated static random address |
dudnwjs | 4:60be78a172c2 | 60 | * - GAPM_GEN_RSLV_ADDR: Generated resolvable private random address |
dudnwjs | 4:60be78a172c2 | 61 | * - GAPM_GEN_NON_RSLV_ADDR: Generated non-resolvable private random address |
dudnwjs | 4:60be78a172c2 | 62 | * - GAPM_PROVIDED_RECON_ADDR: Provided Reconnection address (only for GAPM_ADV_DIRECT) |
dudnwjs | 4:60be78a172c2 | 63 | */ |
dudnwjs | 4:60be78a172c2 | 64 | uint8_t addr_src; |
dudnwjs | 4:60be78a172c2 | 65 | |
dudnwjs | 4:60be78a172c2 | 66 | /// Dummy data use to retrieve internal operation state (should be set to 0). |
dudnwjs | 4:60be78a172c2 | 67 | uint16_t state; |
dudnwjs | 4:60be78a172c2 | 68 | |
dudnwjs | 4:60be78a172c2 | 69 | /// Duration of resolvable address before regenerate it. |
dudnwjs | 4:60be78a172c2 | 70 | uint16_t renew_dur; |
dudnwjs | 4:60be78a172c2 | 71 | |
dudnwjs | 4:60be78a172c2 | 72 | /// Provided own static private random address (addr_src = 1 or 5) |
dudnwjs | 4:60be78a172c2 | 73 | struct bd_addr addr; |
dudnwjs | 4:60be78a172c2 | 74 | }; |
dudnwjs | 4:60be78a172c2 | 75 | |
dudnwjs | 4:60be78a172c2 | 76 | /// Advertising data that contains information set by host. |
dudnwjs | 4:60be78a172c2 | 77 | struct gapm_adv_host |
dudnwjs | 4:60be78a172c2 | 78 | { |
dudnwjs | 4:60be78a172c2 | 79 | /// Advertising mode : |
dudnwjs | 4:60be78a172c2 | 80 | /// - GAP_NON_DISCOVERABLE: Non discoverable mode |
dudnwjs | 4:60be78a172c2 | 81 | /// - GAP_GEN_DISCOVERABLE: General discoverable mode |
dudnwjs | 4:60be78a172c2 | 82 | /// - GAP_LIM_DISCOVERABLE: Limited discoverable mode |
dudnwjs | 4:60be78a172c2 | 83 | /// - GAP_BROADCASTER_MODE: Broadcaster mode |
dudnwjs | 4:60be78a172c2 | 84 | uint8_t mode; |
dudnwjs | 4:60be78a172c2 | 85 | |
dudnwjs | 4:60be78a172c2 | 86 | /// Advertising filter policy: |
dudnwjs | 4:60be78a172c2 | 87 | /// - ADV_ALLOW_SCAN_ANY_CON_ANY: Allow both scan and connection requests from anyone |
dudnwjs | 4:60be78a172c2 | 88 | /// - ADV_ALLOW_SCAN_WLST_CON_ANY: Allow both scan req from White List devices only and |
dudnwjs | 4:60be78a172c2 | 89 | /// connection req from anyone |
dudnwjs | 4:60be78a172c2 | 90 | /// - ADV_ALLOW_SCAN_ANY_CON_WLST: Allow both scan req from anyone and connection req |
dudnwjs | 4:60be78a172c2 | 91 | /// from White List devices only |
dudnwjs | 4:60be78a172c2 | 92 | /// - ADV_ALLOW_SCAN_WLST_CON_WLST: Allow scan and connection requests from White List |
dudnwjs | 4:60be78a172c2 | 93 | /// devices only |
dudnwjs | 4:60be78a172c2 | 94 | uint8_t adv_filt_policy; |
dudnwjs | 4:60be78a172c2 | 95 | |
dudnwjs | 4:60be78a172c2 | 96 | /// Advertising data length - maximum 28 bytes, 3 bytes are reserved to set |
dudnwjs | 4:60be78a172c2 | 97 | /// Advertising AD type flags, shall not be set in advertising data |
dudnwjs | 4:60be78a172c2 | 98 | uint8_t adv_data_len; |
dudnwjs | 4:60be78a172c2 | 99 | /// Advertising data |
dudnwjs | 4:60be78a172c2 | 100 | uint8_t adv_data[ADV_DATA_LEN-3]; |
dudnwjs | 4:60be78a172c2 | 101 | /// Scan response data length- maximum 31 bytes |
dudnwjs | 4:60be78a172c2 | 102 | uint8_t scan_rsp_data_len; |
dudnwjs | 4:60be78a172c2 | 103 | /// Scan response data |
dudnwjs | 4:60be78a172c2 | 104 | uint8_t scan_rsp_data[SCAN_RSP_DATA_LEN]; |
dudnwjs | 4:60be78a172c2 | 105 | }; |
dudnwjs | 4:60be78a172c2 | 106 | |
dudnwjs | 4:60be78a172c2 | 107 | /// Set advertising mode Command |
dudnwjs | 4:60be78a172c2 | 108 | struct gapm_start_advertise_cmd |
dudnwjs | 4:60be78a172c2 | 109 | { |
dudnwjs | 4:60be78a172c2 | 110 | /// GAPM requested operation: |
dudnwjs | 4:60be78a172c2 | 111 | /// - GAPM_ADV_NON_CONN: Start non connectable advertising |
dudnwjs | 4:60be78a172c2 | 112 | /// - GAPM_ADV_UNDIRECT: Start undirected connectable advertising |
dudnwjs | 4:60be78a172c2 | 113 | /// - GAPM_ADV_DIRECT: Start directed connectable advertising |
dudnwjs | 4:60be78a172c2 | 114 | struct gapm_air_operation op; |
dudnwjs | 4:60be78a172c2 | 115 | |
dudnwjs | 4:60be78a172c2 | 116 | /// Minimum interval for advertising |
dudnwjs | 4:60be78a172c2 | 117 | uint16_t intv_min; |
dudnwjs | 4:60be78a172c2 | 118 | /// Maximum interval for advertising |
dudnwjs | 4:60be78a172c2 | 119 | uint16_t intv_max; |
dudnwjs | 4:60be78a172c2 | 120 | |
dudnwjs | 4:60be78a172c2 | 121 | ///Advertising channel map |
dudnwjs | 4:60be78a172c2 | 122 | uint8_t channel_map; |
dudnwjs | 4:60be78a172c2 | 123 | |
dudnwjs | 4:60be78a172c2 | 124 | /// Advertising information |
dudnwjs | 4:60be78a172c2 | 125 | union gapm_adv_info |
dudnwjs | 4:60be78a172c2 | 126 | { |
dudnwjs | 4:60be78a172c2 | 127 | /// Host information advertising data (GAPM_ADV_NON_CONN and GAPM_ADV_UNDIRECT) |
dudnwjs | 4:60be78a172c2 | 128 | struct gapm_adv_host host; |
dudnwjs | 4:60be78a172c2 | 129 | /// Direct address information (GAPM_ADV_DIRECT) |
dudnwjs | 4:60be78a172c2 | 130 | /// (used only if reconnection address isn't set or privacy disabled) |
dudnwjs | 4:60be78a172c2 | 131 | struct gap_bdaddr direct; |
dudnwjs | 4:60be78a172c2 | 132 | } info; |
dudnwjs | 4:60be78a172c2 | 133 | }; |
dudnwjs | 4:60be78a172c2 | 134 | |
dudnwjs | 4:60be78a172c2 | 135 | /// Set device configuration command |
dudnwjs | 4:60be78a172c2 | 136 | struct gapm_set_dev_config_cmd |
dudnwjs | 4:60be78a172c2 | 137 | { |
dudnwjs | 4:60be78a172c2 | 138 | /// GAPM requested operation: |
dudnwjs | 4:60be78a172c2 | 139 | /// - GAPM_SET_DEV_CONFIG: Set device configuration |
dudnwjs | 4:60be78a172c2 | 140 | uint8_t operation; |
dudnwjs | 4:60be78a172c2 | 141 | /// Device Role: Central, Peripheral, Observer or Broadcaster |
dudnwjs | 4:60be78a172c2 | 142 | uint8_t role; |
dudnwjs | 4:60be78a172c2 | 143 | /// Device IRK used for resolvable random BD address generation (LSB first) |
dudnwjs | 4:60be78a172c2 | 144 | struct gap_sec_key irk; |
dudnwjs | 4:60be78a172c2 | 145 | |
dudnwjs | 4:60be78a172c2 | 146 | /// Device Appearance (0x0000 - Unknown appearance) |
dudnwjs | 4:60be78a172c2 | 147 | uint16_t appearance; |
dudnwjs | 4:60be78a172c2 | 148 | /// Device Appearance write permission requirements for peer device (@see gapm_write_att_perm) |
dudnwjs | 4:60be78a172c2 | 149 | uint8_t appearance_write_perm; |
dudnwjs | 4:60be78a172c2 | 150 | /// Device Name write permission requirements for peer device (@see gapm_write_att_perm) |
dudnwjs | 4:60be78a172c2 | 151 | uint8_t name_write_perm; |
dudnwjs | 4:60be78a172c2 | 152 | |
dudnwjs | 4:60be78a172c2 | 153 | /// Maximal MTU |
dudnwjs | 4:60be78a172c2 | 154 | uint16_t max_mtu; |
dudnwjs | 4:60be78a172c2 | 155 | |
dudnwjs | 4:60be78a172c2 | 156 | /// Peripheral only: ***************************************************************** |
dudnwjs | 4:60be78a172c2 | 157 | /// Slave preferred Minimum of connection interval |
dudnwjs | 4:60be78a172c2 | 158 | uint16_t con_intv_min; |
dudnwjs | 4:60be78a172c2 | 159 | /// Slave preferred Maximum of connection interval |
dudnwjs | 4:60be78a172c2 | 160 | uint16_t con_intv_max; |
dudnwjs | 4:60be78a172c2 | 161 | /// Slave preferred Connection latency |
dudnwjs | 4:60be78a172c2 | 162 | uint16_t con_latency; |
dudnwjs | 4:60be78a172c2 | 163 | /// Slave preferred Link supervision timeout |
dudnwjs | 4:60be78a172c2 | 164 | uint16_t superv_to; |
dudnwjs | 4:60be78a172c2 | 165 | |
dudnwjs | 4:60be78a172c2 | 166 | /// Privacy settings bit field (0b1 = enabled, 0b0 = disabled) |
dudnwjs | 4:60be78a172c2 | 167 | /// - [bit 0]: Privacy Support |
dudnwjs | 4:60be78a172c2 | 168 | /// - [bit 1]: Multiple Bond Support (Peripheral only); If enabled, privacy flag is |
dudnwjs | 4:60be78a172c2 | 169 | /// read only. |
dudnwjs | 4:60be78a172c2 | 170 | /// - [bit 2]: Reconnection address visible. |
dudnwjs | 4:60be78a172c2 | 171 | uint8_t flags; |
dudnwjs | 4:60be78a172c2 | 172 | }; |
dudnwjs | 4:60be78a172c2 | 173 | |
dudnwjs | 3:1e70387e1337 | 174 | /// GAP Manager Message Interface |
dudnwjs | 3:1e70387e1337 | 175 | enum gapm_msg_id |
dudnwjs | 3:1e70387e1337 | 176 | { |
dudnwjs | 3:1e70387e1337 | 177 | /* Default event */ |
dudnwjs | 3:1e70387e1337 | 178 | /// Command Complete event |
dudnwjs | 3:1e70387e1337 | 179 | GAPM_CMP_EVT = 13312, |
dudnwjs | 3:1e70387e1337 | 180 | /// Event triggered to inform that lower layers are ready |
dudnwjs | 3:1e70387e1337 | 181 | GAPM_DEVICE_READY_IND, |
dudnwjs | 3:1e70387e1337 | 182 | |
dudnwjs | 3:1e70387e1337 | 183 | /* Default commands */ |
dudnwjs | 3:1e70387e1337 | 184 | /// Reset link layer and the host command |
dudnwjs | 3:1e70387e1337 | 185 | GAPM_RESET_CMD, |
dudnwjs | 3:1e70387e1337 | 186 | /// Cancel ongoing operation |
dudnwjs | 3:1e70387e1337 | 187 | GAPM_CANCEL_CMD, |
dudnwjs | 3:1e70387e1337 | 188 | |
dudnwjs | 3:1e70387e1337 | 189 | /* Device Configuration */ |
dudnwjs | 3:1e70387e1337 | 190 | /// Set device configuration command |
dudnwjs | 3:1e70387e1337 | 191 | GAPM_SET_DEV_CONFIG_CMD, |
dudnwjs | 3:1e70387e1337 | 192 | /// Set device name command |
dudnwjs | 3:1e70387e1337 | 193 | GAPM_SET_DEV_NAME_CMD, |
dudnwjs | 3:1e70387e1337 | 194 | /// Set device channel map |
dudnwjs | 3:1e70387e1337 | 195 | GAPM_SET_CHANNEL_MAP_CMD, |
dudnwjs | 3:1e70387e1337 | 196 | |
dudnwjs | 3:1e70387e1337 | 197 | /* Local device information */ |
dudnwjs | 3:1e70387e1337 | 198 | /// Get local device info command |
dudnwjs | 3:1e70387e1337 | 199 | GAPM_GET_DEV_INFO_CMD, |
dudnwjs | 3:1e70387e1337 | 200 | /// Local device name indication event |
dudnwjs | 3:1e70387e1337 | 201 | GAPM_DEV_NAME_IND, |
dudnwjs | 3:1e70387e1337 | 202 | /// Local device appearance indication event |
dudnwjs | 3:1e70387e1337 | 203 | GAPM_APPEARANCE_IND, |
dudnwjs | 3:1e70387e1337 | 204 | /// Local device version indication event |
dudnwjs | 3:1e70387e1337 | 205 | GAPM_DEV_VERSION_IND, |
dudnwjs | 3:1e70387e1337 | 206 | /// Local device BD Address indication event |
dudnwjs | 3:1e70387e1337 | 207 | GAPM_DEV_BDADDR_IND, |
dudnwjs | 3:1e70387e1337 | 208 | |
dudnwjs | 3:1e70387e1337 | 209 | /* White List */ |
dudnwjs | 3:1e70387e1337 | 210 | /// White List Management Command |
dudnwjs | 3:1e70387e1337 | 211 | GAPM_WHITE_LIST_MGT_CMD, |
dudnwjs | 3:1e70387e1337 | 212 | /// White List Size indication event |
dudnwjs | 3:1e70387e1337 | 213 | GAPM_WHITE_LIST_SIZE_IND, |
dudnwjs | 3:1e70387e1337 | 214 | |
dudnwjs | 3:1e70387e1337 | 215 | /* Air Operations */ |
dudnwjs | 3:1e70387e1337 | 216 | /// Set advertising mode Command |
dudnwjs | 3:1e70387e1337 | 217 | GAPM_START_ADVERTISE_CMD, |
dudnwjs | 3:1e70387e1337 | 218 | |
dudnwjs | 3:1e70387e1337 | 219 | /// Set Scan mode Command |
dudnwjs | 3:1e70387e1337 | 220 | GAPM_START_SCAN_CMD, |
dudnwjs | 3:1e70387e1337 | 221 | /// Advertising or scanning report information event |
dudnwjs | 3:1e70387e1337 | 222 | GAPM_ADV_REPORT_IND, |
dudnwjs | 3:1e70387e1337 | 223 | |
dudnwjs | 3:1e70387e1337 | 224 | /// Set connection initialization Command |
dudnwjs | 3:1e70387e1337 | 225 | GAPM_START_CONNECTION_CMD, |
dudnwjs | 3:1e70387e1337 | 226 | /// Name of peer device indication |
dudnwjs | 3:1e70387e1337 | 227 | GAPM_PEER_NAME_IND, |
dudnwjs | 3:1e70387e1337 | 228 | /// Confirm connection to a specific device (Connection Operation in Selective mode) |
dudnwjs | 3:1e70387e1337 | 229 | GAPM_CONNECTION_CFM, |
dudnwjs | 3:1e70387e1337 | 230 | |
dudnwjs | 3:1e70387e1337 | 231 | /* Privacy update events */ |
dudnwjs | 3:1e70387e1337 | 232 | /// Privacy flag value has been updated |
dudnwjs | 3:1e70387e1337 | 233 | GAPM_UPDATED_PRIVACY_IND, |
dudnwjs | 3:1e70387e1337 | 234 | /// Reconnection address has been updated |
dudnwjs | 3:1e70387e1337 | 235 | GAPM_UPDATED_RECON_ADDR_IND, |
dudnwjs | 3:1e70387e1337 | 236 | |
dudnwjs | 3:1e70387e1337 | 237 | /* Security / Encryption Toolbox */ |
dudnwjs | 3:1e70387e1337 | 238 | /// Resolve address command |
dudnwjs | 3:1e70387e1337 | 239 | GAPM_RESOLV_ADDR_CMD, |
dudnwjs | 3:1e70387e1337 | 240 | /// Indicate that resolvable random address has been solved |
dudnwjs | 3:1e70387e1337 | 241 | GAPM_ADDR_SOLVED_IND, |
dudnwjs | 3:1e70387e1337 | 242 | /// Generate a random address. |
dudnwjs | 3:1e70387e1337 | 243 | GAPM_GEN_RAND_ADDR_CMD, |
dudnwjs | 3:1e70387e1337 | 244 | /// Use the AES-128 block in the controller |
dudnwjs | 3:1e70387e1337 | 245 | GAPM_USE_ENC_BLOCK_CMD, |
dudnwjs | 3:1e70387e1337 | 246 | /// AES-128 block result indication |
dudnwjs | 3:1e70387e1337 | 247 | GAPM_USE_ENC_BLOCK_IND, |
dudnwjs | 3:1e70387e1337 | 248 | /// Generate a 8-byte random number |
dudnwjs | 3:1e70387e1337 | 249 | GAPM_GEN_RAND_NB_CMD, |
dudnwjs | 3:1e70387e1337 | 250 | /// Random Number Indication |
dudnwjs | 3:1e70387e1337 | 251 | GAPM_GEN_RAND_NB_IND, |
dudnwjs | 3:1e70387e1337 | 252 | |
dudnwjs | 3:1e70387e1337 | 253 | /* Debug */ |
dudnwjs | 3:1e70387e1337 | 254 | /// Indication containing information about memory usage. |
dudnwjs | 3:1e70387e1337 | 255 | GAPM_DBG_MEM_INFO_IND, |
dudnwjs | 3:1e70387e1337 | 256 | |
dudnwjs | 3:1e70387e1337 | 257 | /* Local device information -cont */ |
dudnwjs | 3:1e70387e1337 | 258 | /// Advertising channel Tx power level |
dudnwjs | 3:1e70387e1337 | 259 | GAPM_DEV_ADV_TX_POWER_IND, |
dudnwjs | 3:1e70387e1337 | 260 | |
dudnwjs | 3:1e70387e1337 | 261 | /* Internal messages for timer events, not part of API*/ |
dudnwjs | 3:1e70387e1337 | 262 | /// Limited discoverable timeout indication |
dudnwjs | 3:1e70387e1337 | 263 | GAPM_LIM_DISC_TO_IND, |
dudnwjs | 3:1e70387e1337 | 264 | /// Scan timeout indication |
dudnwjs | 3:1e70387e1337 | 265 | GAPM_SCAN_TO_IND, |
dudnwjs | 3:1e70387e1337 | 266 | /// Address renewal timeout indication |
dudnwjs | 3:1e70387e1337 | 267 | GAPM_ADDR_RENEW_TO_IND, |
dudnwjs | 3:1e70387e1337 | 268 | }; |
dudnwjs | 3:1e70387e1337 | 269 | |
dudnwjs | 3:1e70387e1337 | 270 | /// GAP Manager operation type - application interface |
dudnwjs | 3:1e70387e1337 | 271 | enum gapm_operation |
dudnwjs | 3:1e70387e1337 | 272 | { |
dudnwjs | 3:1e70387e1337 | 273 | /* No Operation (if nothing has been requested) */ |
dudnwjs | 3:1e70387e1337 | 274 | /* ************************************************ */ |
dudnwjs | 3:1e70387e1337 | 275 | /// No operation. |
dudnwjs | 3:1e70387e1337 | 276 | GAPM_NO_OP = 0x00, |
dudnwjs | 3:1e70387e1337 | 277 | |
dudnwjs | 3:1e70387e1337 | 278 | /* Default operations */ |
dudnwjs | 3:1e70387e1337 | 279 | /* ************************************************ */ |
dudnwjs | 3:1e70387e1337 | 280 | /// Reset BLE subsystem: LL and HL. |
dudnwjs | 3:1e70387e1337 | 281 | GAPM_RESET, |
dudnwjs | 3:1e70387e1337 | 282 | /// Cancel currently executed operation. |
dudnwjs | 3:1e70387e1337 | 283 | GAPM_CANCEL, |
dudnwjs | 3:1e70387e1337 | 284 | |
dudnwjs | 3:1e70387e1337 | 285 | /* Configuration operations */ |
dudnwjs | 3:1e70387e1337 | 286 | /* ************************************************ */ |
dudnwjs | 3:1e70387e1337 | 287 | /// Set device configuration |
dudnwjs | 3:1e70387e1337 | 288 | GAPM_SET_DEV_CONFIG, |
dudnwjs | 3:1e70387e1337 | 289 | /// Set device name |
dudnwjs | 3:1e70387e1337 | 290 | GAPM_SET_DEV_NAME, |
dudnwjs | 3:1e70387e1337 | 291 | /// Set device channel map |
dudnwjs | 3:1e70387e1337 | 292 | GAPM_SET_CHANNEL_MAP, |
dudnwjs | 3:1e70387e1337 | 293 | |
dudnwjs | 3:1e70387e1337 | 294 | /* Retrieve device information */ |
dudnwjs | 3:1e70387e1337 | 295 | /* ************************************************ */ |
dudnwjs | 3:1e70387e1337 | 296 | /// Get Local device name |
dudnwjs | 3:1e70387e1337 | 297 | GAPM_GET_DEV_NAME, |
dudnwjs | 3:1e70387e1337 | 298 | /// Get Local device version |
dudnwjs | 3:1e70387e1337 | 299 | GAPM_GET_DEV_VERSION, |
dudnwjs | 3:1e70387e1337 | 300 | /// Get Local device BD Address |
dudnwjs | 3:1e70387e1337 | 301 | GAPM_GET_DEV_BDADDR, |
dudnwjs | 3:1e70387e1337 | 302 | |
dudnwjs | 3:1e70387e1337 | 303 | /* Operation on White list */ |
dudnwjs | 3:1e70387e1337 | 304 | /* ************************************************ */ |
dudnwjs | 3:1e70387e1337 | 305 | /// Get White List Size. |
dudnwjs | 3:1e70387e1337 | 306 | GAPM_GET_WLIST_SIZE, |
dudnwjs | 3:1e70387e1337 | 307 | /// Add devices in white list. |
dudnwjs | 3:1e70387e1337 | 308 | GAPM_ADD_DEV_IN_WLIST, |
dudnwjs | 3:1e70387e1337 | 309 | /// Remove devices form white list. |
dudnwjs | 3:1e70387e1337 | 310 | GAPM_RMV_DEV_FRM_WLIST, |
dudnwjs | 3:1e70387e1337 | 311 | /// Clear all devices from white list. |
dudnwjs | 3:1e70387e1337 | 312 | GAPM_CLEAR_WLIST, |
dudnwjs | 3:1e70387e1337 | 313 | |
dudnwjs | 3:1e70387e1337 | 314 | /* Advertise mode operations */ |
dudnwjs | 3:1e70387e1337 | 315 | /* ************************************************ */ |
dudnwjs | 3:1e70387e1337 | 316 | /// Start non connectable advertising |
dudnwjs | 3:1e70387e1337 | 317 | GAPM_ADV_NON_CONN, |
dudnwjs | 3:1e70387e1337 | 318 | /// Start undirected connectable advertising |
dudnwjs | 3:1e70387e1337 | 319 | GAPM_ADV_UNDIRECT, |
dudnwjs | 3:1e70387e1337 | 320 | /// Start directed connectable advertising |
dudnwjs | 3:1e70387e1337 | 321 | GAPM_ADV_DIRECT, |
dudnwjs | 3:1e70387e1337 | 322 | |
dudnwjs | 3:1e70387e1337 | 323 | /* Scan mode operations */ |
dudnwjs | 3:1e70387e1337 | 324 | /* ************************************************ */ |
dudnwjs | 3:1e70387e1337 | 325 | /// Start active scan operation |
dudnwjs | 3:1e70387e1337 | 326 | GAPM_SCAN_ACTIVE, |
dudnwjs | 3:1e70387e1337 | 327 | /// Start passive scan operation |
dudnwjs | 3:1e70387e1337 | 328 | GAPM_SCAN_PASSIVE, |
dudnwjs | 3:1e70387e1337 | 329 | |
dudnwjs | 3:1e70387e1337 | 330 | /* Connection mode operations */ |
dudnwjs | 3:1e70387e1337 | 331 | /* ************************************************ */ |
dudnwjs | 3:1e70387e1337 | 332 | /// Direct connection operation |
dudnwjs | 3:1e70387e1337 | 333 | GAPM_CONNECTION_DIRECT, |
dudnwjs | 3:1e70387e1337 | 334 | /// Automatic connection operation |
dudnwjs | 3:1e70387e1337 | 335 | GAPM_CONNECTION_AUTO, |
dudnwjs | 3:1e70387e1337 | 336 | /// Selective connection operation |
dudnwjs | 3:1e70387e1337 | 337 | GAPM_CONNECTION_SELECTIVE, |
dudnwjs | 3:1e70387e1337 | 338 | /// Name Request operation (requires to start a direct connection) |
dudnwjs | 3:1e70387e1337 | 339 | GAPM_CONNECTION_NAME_REQUEST, |
dudnwjs | 3:1e70387e1337 | 340 | |
dudnwjs | 3:1e70387e1337 | 341 | /* Security / Encryption Toolbox */ |
dudnwjs | 3:1e70387e1337 | 342 | /* ************************************************ */ |
dudnwjs | 3:1e70387e1337 | 343 | /// Resolve device address |
dudnwjs | 3:1e70387e1337 | 344 | GAPM_RESOLV_ADDR, |
dudnwjs | 3:1e70387e1337 | 345 | /// Generate a random address |
dudnwjs | 3:1e70387e1337 | 346 | GAPM_GEN_RAND_ADDR, |
dudnwjs | 3:1e70387e1337 | 347 | /// Use the controller's AES-128 block |
dudnwjs | 3:1e70387e1337 | 348 | GAPM_USE_ENC_BLOCK, |
dudnwjs | 3:1e70387e1337 | 349 | /// Generate a 8-byte random number |
dudnwjs | 3:1e70387e1337 | 350 | GAPM_GEN_RAND_NB, |
dudnwjs | 3:1e70387e1337 | 351 | |
dudnwjs | 3:1e70387e1337 | 352 | /* DEBUG */ |
dudnwjs | 3:1e70387e1337 | 353 | /* ************************************************ */ |
dudnwjs | 3:1e70387e1337 | 354 | /// Get memory usage |
dudnwjs | 3:1e70387e1337 | 355 | GAPM_DBG_GET_MEM_INFO, |
dudnwjs | 3:1e70387e1337 | 356 | /// Perform a platform reset |
dudnwjs | 3:1e70387e1337 | 357 | GAPM_PLF_RESET, |
dudnwjs | 3:1e70387e1337 | 358 | |
dudnwjs | 3:1e70387e1337 | 359 | /* Retrieve device information - cont */ |
dudnwjs | 3:1e70387e1337 | 360 | /* ************************************************ */ |
dudnwjs | 3:1e70387e1337 | 361 | /// Get device advertising power level |
dudnwjs | 3:1e70387e1337 | 362 | GAPM_GET_DEV_ADV_TX_POWER, |
dudnwjs | 3:1e70387e1337 | 363 | |
dudnwjs | 3:1e70387e1337 | 364 | /// Last GAPM operation flag |
dudnwjs | 3:1e70387e1337 | 365 | GAPM_LAST |
dudnwjs | 3:1e70387e1337 | 366 | }; |
dudnwjs | 3:1e70387e1337 | 367 | |
dudnwjs | 4:60be78a172c2 | 368 | /// Own BD address source of the device |
dudnwjs | 4:60be78a172c2 | 369 | enum gapm_own_addr_src |
dudnwjs | 4:60be78a172c2 | 370 | { |
dudnwjs | 4:60be78a172c2 | 371 | /// Public Address |
dudnwjs | 4:60be78a172c2 | 372 | GAPM_PUBLIC_ADDR, |
dudnwjs | 4:60be78a172c2 | 373 | /// Provided random address |
dudnwjs | 4:60be78a172c2 | 374 | GAPM_PROVIDED_RND_ADDR, |
dudnwjs | 4:60be78a172c2 | 375 | /// Provided static random address |
dudnwjs | 4:60be78a172c2 | 376 | GAPM_GEN_STATIC_RND_ADDR, |
dudnwjs | 4:60be78a172c2 | 377 | /// Generated resolvable private random address |
dudnwjs | 4:60be78a172c2 | 378 | GAPM_GEN_RSLV_ADDR, |
dudnwjs | 4:60be78a172c2 | 379 | /// Generated non-resolvable private random address |
dudnwjs | 4:60be78a172c2 | 380 | GAPM_GEN_NON_RSLV_ADDR, |
dudnwjs | 4:60be78a172c2 | 381 | /// Provided Reconnection address |
dudnwjs | 4:60be78a172c2 | 382 | GAPM_PROVIDED_RECON_ADDR, |
dudnwjs | 4:60be78a172c2 | 383 | }; |
dudnwjs | 4:60be78a172c2 | 384 | |
dudnwjs | 4:60be78a172c2 | 385 | /// Device Attribute write permission requirement |
dudnwjs | 4:60be78a172c2 | 386 | enum gapm_write_att_perm |
dudnwjs | 4:60be78a172c2 | 387 | { |
dudnwjs | 4:60be78a172c2 | 388 | /// Disable write access |
dudnwjs | 4:60be78a172c2 | 389 | GAPM_WRITE_DISABLE = 0, |
dudnwjs | 4:60be78a172c2 | 390 | /// Enable write access |
dudnwjs | 4:60be78a172c2 | 391 | GAPM_WRITE_ENABLE = 8, |
dudnwjs | 4:60be78a172c2 | 392 | /// Write access requires unauthenticated link |
dudnwjs | 4:60be78a172c2 | 393 | GAPM_WRITE_UNAUTH = 16, |
dudnwjs | 4:60be78a172c2 | 394 | /// Write access requires authenticated link |
dudnwjs | 4:60be78a172c2 | 395 | GAPM_WRITE_AUTH = 24, |
dudnwjs | 4:60be78a172c2 | 396 | }; |
dudnwjs | 4:60be78a172c2 | 397 | |
dudnwjs | 3:1e70387e1337 | 398 | }//namespace |
dudnwjs | 3:1e70387e1337 | 399 | |
dudnwjs | 9:fcf91f563147 | 400 | /// @} dialog_fota module |
dudnwjs | 9:fcf91f563147 | 401 | |
dudnwjs | 3:1e70387e1337 | 402 | #endif//GAPM_TASK_H |