![]() |
![]() |
|
TI BLE5-Stack API Documentation
9.11.01
|
Macros | |
| #define | ECC_KEYLEN 32 |
| ECC Key Length: 256 bit keys. More... | |
| #define | GAP_BOND_DEV_CSRK_OFFSET 4 |
| NV ID for the bonding records' device CSRK. More... | |
| #define | GAP_BOND_DEV_IRK_OFFSET 3 |
| NV ID for the bonding records' device IRK. More... | |
| #define | GAP_BOND_DEV_LTK_OFFSET 2 |
| NV ID for the bonding records' device LTK information. More... | |
| #define | GAP_BOND_DEV_SIGN_COUNTER_OFFSET 5 |
| NV ID for the bonding records' device Sign Counter. More... | |
| #define | GAP_BOND_LOCAL_LTK_OFFSET 1 |
| NV ID for the bonding record's local LTK information. More... | |
| #define | GAP_BOND_REC_ID_OFFSET 0 |
| NV ID for the main bonding record. More... | |
| #define | GAP_BOND_REC_IDS 6 |
| #define | GAP_BONDED_STATE_AUTHENTICATED 0x01 |
| #define | GAP_BONDED_STATE_CAR 0x04 |
| #define | GAP_BONDED_STATE_NO_RECORD 0xFF |
| #define | GAP_BONDED_STATE_RPA_ONLY 0x10 |
| #define | GAP_BONDED_STATE_SECURECONNECTION 0x08 |
| #define | GAP_BONDED_STATE_SERVICE_CHANGED 0x02 |
| #define | GAP_BONDED_STATE_UNAUTHENTICATED 0x00 |
| #define | GAP_BONDINGS_MAX 10 |
| Maximum number of bonds that can be saved in NV. More... | |
| #define | GAP_CHAR_CFG_MAX 4 |
| Maximum number of characteristic configuration that can be saved in NV. More... | |
| #define | PASSKEY_LEN 6 |
| Passkey Character Length (ASCII Characters) More... | |
| #define | SM_AUTH_MITM_MASK(a) (((a) & 0x04) >> 2) |
| MITM Mask. More... | |
| #define | SM_AUTH_STATE_AUTHENTICATED 0x04 |
| Authenticate requested. More... | |
| #define | SM_AUTH_STATE_BONDING 0x01 |
| Bonding requested. More... | |
| #define | SM_AUTH_STATE_SECURECONNECTION 0x08 |
| Secure Connection requested. More... | |
| #define | SM_ECC_KEY_LEN 32 |
| ECC Key length in bytes. More... | |
| #define | SM_ECC_KEYS_NOT_AVAILABLE 0xFF |
| Initial state of recycled keys before they exist. More... | |
| #define | SM_ECC_KEYS_REGENERATE_ALWAYS 0x00 |
| Always regenerate the keys. More... | |
| #define | SM_ECC_KEYS_REGNENERATE_NEVER 0xFF |
| Never regenerate the keys. More... | |
| #define ECC_KEYLEN 32 |
ECC Key Length: 256 bit keys.
| #define GAP_BOND_DEV_CSRK_OFFSET 4 |
NV ID for the bonding records' device CSRK.
| #define GAP_BOND_DEV_IRK_OFFSET 3 |
NV ID for the bonding records' device IRK.
| #define GAP_BOND_DEV_LTK_OFFSET 2 |
NV ID for the bonding records' device LTK information.
| #define GAP_BOND_DEV_SIGN_COUNTER_OFFSET 5 |
NV ID for the bonding records' device Sign Counter.
| #define GAP_BOND_LOCAL_LTK_OFFSET 1 |
NV ID for the bonding record's local LTK information.
| #define GAP_BOND_REC_ID_OFFSET 0 |
NV ID for the main bonding record.
GAP Bond Manager NV layout
The NV definitions: BLE_NVID_GAP_BOND_START - starting NV ID gapBond_maxBonds - Maximum number of bonding allowed (32 is max for number of NV IDs allocated in bcomdef.h).
A single bonding entry consists of 6 components (NV items): Bond Record - defined as gapBondRec_t and uses GAP_BOND_REC_ID_OFFSET for an NV ID local LTK Info - defined as gapBondLTK_t and uses GAP_BOND_LOCAL_LTK_OFFSET for an NV ID device LTK Info - defined as gapBondLTK_t and uses GAP_BOND_DEV_LTK_OFFSET for an NV ID device IRK - defined as "uint8_t devIRK[KEYLEN]" and uses GAP_BOND_DEV_IRK_OFFSET for an NV ID device CSRK - defined as "uint8_t devCSRK[KEYLEN]" and uses GAP_BOND_DEV_CSRK_OFFSET for an NV ID device Sign Counter - defined as a uint32_t and uses GAP_BOND_DEV_SIGN_COUNTER_OFFSET for an NV ID
When the device is initialized for the first time, all (gapBond_maxBonds) NV items are created and initialized to all 0xFF's. A bonding record of all 0xFF's indicates that the bonding record is empty and free to use.
The calculation for each bonding records NV IDs: MAIN_RECORD_NV_ID = ((bondIdx * GAP_BOND_REC_IDS) + BLE_NVID_GAP_BOND_START) LOCAL_LTK_NV_ID = (((bondIdx * GAP_BOND_REC_IDS) + GAP_BOND_LOCAL_LTK_OFFSET) + BLE_NVID_GAP_BOND_START)
| #define GAP_BOND_REC_IDS 6 |
| #define GAP_BONDED_STATE_AUTHENTICATED 0x01 |
| #define GAP_BONDED_STATE_CAR 0x04 |
| #define GAP_BONDED_STATE_NO_RECORD 0xFF |
| #define GAP_BONDED_STATE_RPA_ONLY 0x10 |
| #define GAP_BONDED_STATE_SECURECONNECTION 0x08 |
| #define GAP_BONDED_STATE_SERVICE_CHANGED 0x02 |
| #define GAP_BONDED_STATE_UNAUTHENTICATED 0x00 |
| #define GAP_BONDINGS_MAX 10 |
Maximum number of bonds that can be saved in NV.
| #define GAP_CHAR_CFG_MAX 4 |
Maximum number of characteristic configuration that can be saved in NV.
| #define PASSKEY_LEN 6 |
Passkey Character Length (ASCII Characters)
| #define SM_AUTH_MITM_MASK | ( | a | ) | (((a) & 0x04) >> 2) |
MITM Mask.
| #define SM_AUTH_STATE_AUTHENTICATED 0x04 |
Authenticate requested.
| #define SM_AUTH_STATE_BONDING 0x01 |
Bonding requested.
| #define SM_AUTH_STATE_SECURECONNECTION 0x08 |
Secure Connection requested.
| #define SM_ECC_KEY_LEN 32 |
ECC Key length in bytes.
| #define SM_ECC_KEYS_NOT_AVAILABLE 0xFF |
Initial state of recycled keys before they exist.
| #define SM_ECC_KEYS_REGENERATE_ALWAYS 0x00 |
Always regenerate the keys.
| #define SM_ECC_KEYS_REGNENERATE_NEVER 0xFF |
Never regenerate the keys.