![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
BLE fota Robot Demo
Dependencies: mbed-rtos mbed mbed_fota_fan_control
Fork of mbed_fota_lamp_control by
dialog_fota/gap.h@9:fcf91f563147, 2015-08-24 (annotated)
- Committer:
- dudnwjs
- Date:
- Mon Aug 24 02:29:16 2015 +0000
- Revision:
- 9:fcf91f563147
- Parent:
- 5:e11b23f9aacc
- Child:
- 10:18044afe4364
Add comment for form doxygen;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dudnwjs | 5:e11b23f9aacc | 1 | #ifndef GAP_H |
dudnwjs | 5:e11b23f9aacc | 2 | #define GAP_H |
dudnwjs | 5:e11b23f9aacc | 3 | #include "dialog_fota_config.h" |
dudnwjs | 5:e11b23f9aacc | 4 | |
dudnwjs | 9:fcf91f563147 | 5 | /** |
dudnwjs | 9:fcf91f563147 | 6 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 7 | * @addtogroup dialog_fota module |
dudnwjs | 9:fcf91f563147 | 8 | * @brief Generic Access Profile. |
dudnwjs | 9:fcf91f563147 | 9 | * |
dudnwjs | 9:fcf91f563147 | 10 | * @{ |
dudnwjs | 9:fcf91f563147 | 11 | **************************************************************************************** |
dudnwjs | 9:fcf91f563147 | 12 | */ |
dudnwjs | 9:fcf91f563147 | 13 | |
dudnwjs | 5:e11b23f9aacc | 14 | namespace sevencore_fota{ |
dudnwjs | 5:e11b23f9aacc | 15 | |
dudnwjs | 5:e11b23f9aacc | 16 | #define KEY_LEN 0x10 |
dudnwjs | 5:e11b23f9aacc | 17 | |
dudnwjs | 5:e11b23f9aacc | 18 | |
dudnwjs | 5:e11b23f9aacc | 19 | /// Generic Security key structure |
dudnwjs | 5:e11b23f9aacc | 20 | struct gap_sec_key |
dudnwjs | 5:e11b23f9aacc | 21 | { |
dudnwjs | 5:e11b23f9aacc | 22 | /// Key value MSB -> LSB |
dudnwjs | 5:e11b23f9aacc | 23 | uint8_t key[KEY_LEN]; |
dudnwjs | 5:e11b23f9aacc | 24 | }; |
dudnwjs | 5:e11b23f9aacc | 25 | |
dudnwjs | 5:e11b23f9aacc | 26 | /// Address information about a device address |
dudnwjs | 5:e11b23f9aacc | 27 | struct gap_bdaddr |
dudnwjs | 5:e11b23f9aacc | 28 | { |
dudnwjs | 5:e11b23f9aacc | 29 | /// BD Address of device |
dudnwjs | 5:e11b23f9aacc | 30 | struct bd_addr addr; |
dudnwjs | 5:e11b23f9aacc | 31 | /// Address type of the device 0=public/1=private random |
dudnwjs | 5:e11b23f9aacc | 32 | uint8_t addr_type; |
dudnwjs | 5:e11b23f9aacc | 33 | }; |
dudnwjs | 5:e11b23f9aacc | 34 | |
dudnwjs | 5:e11b23f9aacc | 35 | /// Advertising mode |
dudnwjs | 5:e11b23f9aacc | 36 | enum gap_adv_mode |
dudnwjs | 5:e11b23f9aacc | 37 | { |
dudnwjs | 5:e11b23f9aacc | 38 | /// Mode in non-discoverable |
dudnwjs | 5:e11b23f9aacc | 39 | GAP_NON_DISCOVERABLE, |
dudnwjs | 5:e11b23f9aacc | 40 | /// Mode in general discoverable |
dudnwjs | 5:e11b23f9aacc | 41 | GAP_GEN_DISCOVERABLE, |
dudnwjs | 5:e11b23f9aacc | 42 | /// Mode in limited discoverable |
dudnwjs | 5:e11b23f9aacc | 43 | GAP_LIM_DISCOVERABLE, |
dudnwjs | 5:e11b23f9aacc | 44 | /// Broadcaster mode which is a non discoverable and non connectable mode. |
dudnwjs | 5:e11b23f9aacc | 45 | GAP_BROADCASTER_MODE, |
dudnwjs | 5:e11b23f9aacc | 46 | }; |
dudnwjs | 9:fcf91f563147 | 47 | |
dudnwjs | 9:fcf91f563147 | 48 | /// Role GAP |
dudnwjs | 5:e11b23f9aacc | 49 | enum gap_role |
dudnwjs | 5:e11b23f9aacc | 50 | { |
dudnwjs | 5:e11b23f9aacc | 51 | /// No role set yet |
dudnwjs | 5:e11b23f9aacc | 52 | GAP_NO_ROLE = 0x00, |
dudnwjs | 5:e11b23f9aacc | 53 | |
dudnwjs | 5:e11b23f9aacc | 54 | /// Observer role |
dudnwjs | 5:e11b23f9aacc | 55 | GAP_OBSERVER_SCA = 0x01, |
dudnwjs | 5:e11b23f9aacc | 56 | |
dudnwjs | 5:e11b23f9aacc | 57 | /// Broadcaster role |
dudnwjs | 5:e11b23f9aacc | 58 | GAP_BROADCASTER_ADV = 0x02, |
dudnwjs | 5:e11b23f9aacc | 59 | |
dudnwjs | 5:e11b23f9aacc | 60 | /// Master/Central role |
dudnwjs | 5:e11b23f9aacc | 61 | GAP_CENTRAL_MST = (0x04 | GAP_OBSERVER_SCA), |
dudnwjs | 5:e11b23f9aacc | 62 | |
dudnwjs | 5:e11b23f9aacc | 63 | /// Peripheral/Slave role |
dudnwjs | 5:e11b23f9aacc | 64 | GAP_PERIPHERAL_SLV = (0x08 | GAP_BROADCASTER_ADV), |
dudnwjs | 5:e11b23f9aacc | 65 | }; |
dudnwjs | 5:e11b23f9aacc | 66 | /// Authentication mask |
dudnwjs | 5:e11b23f9aacc | 67 | enum gap_auth_mask |
dudnwjs | 5:e11b23f9aacc | 68 | { |
dudnwjs | 5:e11b23f9aacc | 69 | /// No Flag set |
dudnwjs | 5:e11b23f9aacc | 70 | GAP_AUTH_NONE = 0, |
dudnwjs | 5:e11b23f9aacc | 71 | /// Bond authentication |
dudnwjs | 5:e11b23f9aacc | 72 | GAP_AUTH_BOND = (1 << 0), |
dudnwjs | 5:e11b23f9aacc | 73 | /// Man In the middle protection |
dudnwjs | 5:e11b23f9aacc | 74 | GAP_AUTH_MITM = (1 << 2), |
dudnwjs | 5:e11b23f9aacc | 75 | }; |
dudnwjs | 5:e11b23f9aacc | 76 | |
dudnwjs | 5:e11b23f9aacc | 77 | |
dudnwjs | 5:e11b23f9aacc | 78 | /// Authentication Requirements |
dudnwjs | 5:e11b23f9aacc | 79 | enum gap_auth |
dudnwjs | 5:e11b23f9aacc | 80 | { |
dudnwjs | 5:e11b23f9aacc | 81 | /// No MITM No Bonding |
dudnwjs | 5:e11b23f9aacc | 82 | GAP_AUTH_REQ_NO_MITM_NO_BOND = (GAP_AUTH_NONE), |
dudnwjs | 5:e11b23f9aacc | 83 | /// No MITM Bonding |
dudnwjs | 5:e11b23f9aacc | 84 | GAP_AUTH_REQ_NO_MITM_BOND = (GAP_AUTH_BOND), |
dudnwjs | 5:e11b23f9aacc | 85 | /// MITM No Bonding |
dudnwjs | 5:e11b23f9aacc | 86 | GAP_AUTH_REQ_MITM_NO_BOND = (GAP_AUTH_MITM), |
dudnwjs | 5:e11b23f9aacc | 87 | /// MITM and Bonding |
dudnwjs | 5:e11b23f9aacc | 88 | GAP_AUTH_REQ_MITM_BOND = (GAP_AUTH_MITM | GAP_AUTH_BOND), |
dudnwjs | 5:e11b23f9aacc | 89 | GAP_AUTH_REQ_LAST |
dudnwjs | 5:e11b23f9aacc | 90 | }; |
dudnwjs | 5:e11b23f9aacc | 91 | |
dudnwjs | 5:e11b23f9aacc | 92 | /// Authorization setting |
dudnwjs | 5:e11b23f9aacc | 93 | enum gap_authz |
dudnwjs | 5:e11b23f9aacc | 94 | { |
dudnwjs | 5:e11b23f9aacc | 95 | /// Authorization not set, application informed when authorization requested |
dudnwjs | 5:e11b23f9aacc | 96 | GAP_AUTHZ_NOT_SET = 0x00, |
dudnwjs | 5:e11b23f9aacc | 97 | /// Authorization request automatically accepted |
dudnwjs | 5:e11b23f9aacc | 98 | GAP_AUTHZ_ACCEPT = 0x01, |
dudnwjs | 5:e11b23f9aacc | 99 | /// Authorization request automatically rejected |
dudnwjs | 5:e11b23f9aacc | 100 | GAP_AUTHZ_REJECT = 0x02, |
dudnwjs | 5:e11b23f9aacc | 101 | }; |
dudnwjs | 9:fcf91f563147 | 102 | |
dudnwjs | 9:fcf91f563147 | 103 | }//namespace |
dudnwjs | 5:e11b23f9aacc | 104 | |
dudnwjs | 9:fcf91f563147 | 105 | /// @} dialog_fota module |
dudnwjs | 9:fcf91f563147 | 106 | |
dudnwjs | 5:e11b23f9aacc | 107 | #endif//GAP_H |