TI BLE5-Stack API Documentation  1.01.01.00
gapbondmgr.h
Go to the documentation of this file.
1 /******************************************************************************
2 
3  Group: WCS, BTS
4  $Target Device: DEVICES $
5 
6  ******************************************************************************
7  $License: BSD3 2010 $
8  ******************************************************************************
9  $Release Name: PACKAGE NAME $
10  $Release Date: PACKAGE RELEASE DATE $
11  *****************************************************************************/
12 
21 #ifndef GAPBONDMGR_H
22 #define GAPBONDMGR_H
23 
24 #ifdef __cplusplus
25 extern "C"
26 {
27 #endif
28 
29 /*-------------------------------------------------------------------
30  * INCLUDES
31  */
32 #include "gap.h"
33 
34 /*-------------------------------------------------------------------
35  * CONSTANTS
36  */
37 
43 #if !defined ( GAP_BONDINGS_MAX )
44 #define GAP_BONDINGS_MAX 10
46 #endif
47 
48 #if !defined ( GAP_CHAR_CFG_MAX )
49 #define GAP_CHAR_CFG_MAX 4
51 #endif
52 
72 #define GAPBOND_PAIRING_MODE 0x400
73 
83 #define GAPBOND_MITM_PROTECTION 0x402
84 
94 #define GAPBOND_IO_CAPABILITIES 0x403
95 
105 #define GAPBOND_OOB_ENABLED 0x404
106 
117 #define GAPBOND_OOB_DATA 0x405
118 
128 #define GAPBOND_BONDING_ENABLED 0x406
129 
142 #define GAPBOND_KEY_DIST_LIST 0x407
143 
149 #define GAPBOND_ERASE_ALLBONDS 0x409
150 
152 #define GAPBOND_AUTO_FAIL_PAIRING 0x40A
153 #define GAPBOND_AUTO_FAIL_REASON 0x40B
154 
165 #define GAPBOND_KEYSIZE 0x40C
166 
180 #define GAPBOND_AUTO_SYNC_WL 0x40D
181 
189 #define GAPBOND_BOND_COUNT 0x40E
190 
201 #define GAPBOND_BOND_FAIL_ACTION 0x40F
202 
212 #define GAPBOND_ERASE_SINGLEBOND 0x410
213 
223 #define GAPBOND_SECURE_CONNECTION 0x411
224 
243 #define GAPBOND_ECCKEY_REGEN_POLICY 0x412
244 
266 #define GAPBOND_ECC_KEYS 0x413
267 
281 #define GAPBOND_LRU_BOND_REPLACEMENT 0x418
282 
291 #define GAPBOND_ERASE_LOCAL_INFO 0x41A
292 
303 #define GAPBOND_PAIRING_MODE_NO_PAIRING 0x00
305 #define GAPBOND_PAIRING_MODE_WAIT_FOR_REQ 0x01
307 #define GAPBOND_PAIRING_MODE_INITIATE 0x02
309 
315 #define GAPBOND_IO_CAP_DISPLAY_ONLY 0x00
317 #define GAPBOND_IO_CAP_DISPLAY_YES_NO 0x01
319 #define GAPBOND_IO_CAP_KEYBOARD_ONLY 0x02
321 #define GAPBOND_IO_CAP_NO_INPUT_NO_OUTPUT 0x03
323 #define GAPBOND_IO_CAP_KEYBOARD_DISPLAY 0x04
325 
331 #define GAPBOND_KEYDIST_SENCKEY 0x01
333 #define GAPBOND_KEYDIST_SIDKEY 0x02
335 #define GAPBOND_KEYDIST_SSIGN 0x04
337 #define GAPBOND_KEYDIST_SLINK 0x08
339 #define GAPBOND_KEYDIST_MENCKEY 0x10
341 #define GAPBOND_KEYDIST_MIDKEY 0x20
343 #define GAPBOND_KEYDIST_MSIGN 0x40
345 #define GAPBOND_KEYDIST_MLINK 0x80
347 
366 #define GAPBOND_PAIRING_STATE_STARTED 0x00
367 
387 #define GAPBOND_PAIRING_STATE_COMPLETE 0x01
388 
406 #define GAPBOND_PAIRING_STATE_ENCRYPTED 0x02
407 #define GAPBOND_PAIRING_STATE_BOND_SAVED 0x03
409 #define GAPBOND_PAIRING_STATE_CAR_READ 0x04
411 #define GAPBOND_PAIRING_STATE_RPAO_READ 0x05
413 
428 #define SMP_PAIRING_FAILED_PASSKEY_ENTRY_FAILED 0x01
429 #define SMP_PAIRING_FAILED_OOB_NOT_AVAIL 0x02
431 
435 #define SMP_PAIRING_FAILED_AUTH_REQ 0x03
436 #define SMP_PAIRING_FAILED_CONFIRM_VALUE 0x04
438 #define SMP_PAIRING_FAILED_NOT_SUPPORTED 0x05
440 
444 #define SMP_PAIRING_FAILED_ENC_KEY_SIZE 0x06
445 #define SMP_PAIRING_FAILED_CMD_NOT_SUPPORTED 0x07
447 #define SMP_PAIRING_FAILED_UNSPECIFIED 0x08
449 
453 #define SMP_PAIRING_FAILED_REPEATED_ATTEMPTS 0x09
454 
458 #define SMP_PAIRING_FAILED_INVALID_PARAMETERS 0x0A
459 
463 #define SMP_PAIRING_FAILED_DHKEY_CHECK_FAILED 0x0B
464 
468 #define SMP_PAIRING_FAILED_NUM_COMPARISON_FAILED 0x0C
469 
475 #define GAPBOND_FAIL_NO_ACTION 0x00
477 #define GAPBOND_FAIL_INITIATE_PAIRING 0x01
479 #define GAPBOND_FAIL_TERMINATE_LINK 0x02
481 
485 #define GAPBOND_FAIL_TERMINATE_ERASE_BONDS 0x03
486 
492 #define GAPBOND_SECURE_CONNECTION_NONE 0x00
494 #define GAPBOND_SECURE_CONNECTION_ALLOW 0x01
496 #define GAPBOND_SECURE_CONNECTION_ONLY 0x02
498 
508 #define GAPBOND_REGENERATE_ALWAYS 0x00
510 #define GAPBOND_REGENERATE_NEVER 0xFF
512 
514 #define ECC_KEYLEN 32
516 
519 /*-------------------------------------------------------------------
520  * TYPEDEFS
521  */
522 
546 typedef void (*pfnPasscodeCB_t)
547 (
548  uint8_t *deviceAddr,
549  uint16_t connectionHandle,
550  uint8_t uiInputs,
551  uint8_t uiOutputs,
552  uint32_t numComparison
553 );
554 
566 typedef void (*pfnPairStateCB_t)
567 (
568  uint16_t connectionHandle,
569  uint8_t state,
570  uint8_t status
571 );
572 
579 typedef struct
580 {
583 } gapBondCBs_t;
584 
592 typedef struct
594 {
595  uint8_t privateKey[ECC_KEYLEN];
596  uint8_t publicKeyX[ECC_KEYLEN];
597  uint8_t publicKeyY[ECC_KEYLEN];
599 
601 /*-------------------------------------------------------------------
602  * API's
603  */
604 
610 extern void GAPBondMgr_Register(gapBondCBs_t *pCB);
611 
628 extern bStatus_t GAPBondMgr_SetParameter(uint16_t param, uint8_t len,
629  void *pValue);
630 
645 extern bStatus_t GAPBondMgr_GetParameter(uint16_t param, void *pValue);
646 
665 extern bStatus_t GAPBondMgr_Pair(uint16_t connHandle);
666 
695 extern bStatus_t GAPBondMgr_FindAddr(uint8_t *pDevAddr,
696  GAP_Peer_Addr_Types_t addrType,
697  uint8_t *pIdx,
698  GAP_Peer_Addr_Types_t *pIdentityAddrType,
699  uint8_t *pIdentityAddr);
700 
713 extern bStatus_t GAPBondMgr_ServiceChangeInd(uint16_t connectionHandle,
714  uint8_t setParam);
715 
730 extern bStatus_t GAPBondMgr_PasscodeRsp(uint16_t connectionHandle,
731  uint8_t status, uint32_t passcode);
732 
733 /*-------------------------------------------------------------------
734 -------------------------------------------------------------------*/
735 
736 #ifdef __cplusplus
737 }
738 #endif
739 
740 #endif /* GAPBONDMGR_H */
741 
GAP_Peer_Addr_Types_t
Address types used for specifying peer address type.
Definition: gap.h:586
Public and Private ECC Keys.
Definition: gapbondmgr.h:593
bStatus_t GAPBondMgr_Pair(uint16_t connHandle)
bStatus_t GAPBondMgr_GetParameter(uint16_t param, void *pValue)
bStatus_t GAPBondMgr_PasscodeRsp(uint16_t connectionHandle, uint8_t status, uint32_t passcode)
void(* pfnPairStateCB_t)(uint16_t connectionHandle, uint8_t state, uint8_t status)
Definition: gapbondmgr.h:567
pfnPasscodeCB_t passcodeCB
Passcode callback.
Definition: gapbondmgr.h:581
bStatus_t GAPBondMgr_FindAddr(uint8_t *pDevAddr, GAP_Peer_Addr_Types_t addrType, uint8_t *pIdx, GAP_Peer_Addr_Types_t *pIdentityAddrType, uint8_t *pIdentityAddr)
Search for an address in the bonding table. If the address is a random private resolvable address...
void GAPBondMgr_Register(gapBondCBs_t *pCB)
Definition: gapbondmgr.h:579
void(* pfnPasscodeCB_t)(uint8_t *deviceAddr, uint16_t connectionHandle, uint8_t uiInputs, uint8_t uiOutputs, uint32_t numComparison)
Definition: gapbondmgr.h:547
GAP layer interface.
bStatus_t GAPBondMgr_ServiceChangeInd(uint16_t connectionHandle, uint8_t setParam)
bStatus_t GAPBondMgr_SetParameter(uint16_t param, uint8_t len, void *pValue)
Status_t bStatus_t
BLE Generic Status return.
Definition: bcomdef.h:242
#define ECC_KEYLEN
ECC Key Length: 256 bit keys.
Definition: gapbondmgr.h:515
pfnPairStateCB_t pairStateCB
Pairing state callback.
Definition: gapbondmgr.h:582
Copyright 2018, Texas Instruments Incorporated