TI BLE5-Stack API Documentation  1.01.12.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 6
46 #if GAP_BONDINGS_MAX > 6
47 #warning "Setting bond list size to be bigger than 6 is not supported"
48 #endif
49 #endif
50 
51 #if !defined ( GAP_CHAR_CFG_MAX )
52 #define GAP_CHAR_CFG_MAX 4
54 #endif
55 
75 #define GAPBOND_PAIRING_MODE 0x400
76 
86 #define GAPBOND_MITM_PROTECTION 0x402
87 
97 #define GAPBOND_IO_CAPABILITIES 0x403
98 
108 #define GAPBOND_OOB_ENABLED 0x404
109 
120 #define GAPBOND_OOB_DATA 0x405
121 
131 #define GAPBOND_BONDING_ENABLED 0x406
132 
145 #define GAPBOND_KEY_DIST_LIST 0x407
146 
152 #define GAPBOND_ERASE_ALLBONDS 0x409
153 
155 #define GAPBOND_AUTO_FAIL_PAIRING 0x40A
156 #define GAPBOND_AUTO_FAIL_REASON 0x40B
157 
168 #define GAPBOND_KEYSIZE 0x40C
169 
183 #define GAPBOND_AUTO_SYNC_WL 0x40D
184 
192 #define GAPBOND_BOND_COUNT 0x40E
193 
204 #define GAPBOND_BOND_FAIL_ACTION 0x40F
205 
215 #define GAPBOND_ERASE_SINGLEBOND 0x410
216 
230 #define GAPBOND_SECURE_CONNECTION 0x411
231 
250 #define GAPBOND_ECCKEY_REGEN_POLICY 0x412
251 
273 #define GAPBOND_ECC_KEYS 0x413
274 
288 #define GAPBOND_LRU_BOND_REPLACEMENT 0x418
289 
298 #define GAPBOND_ERASE_LOCAL_INFO 0x41A
299 
310 #define GAPBOND_PAIRING_MODE_NO_PAIRING 0x00
312 #define GAPBOND_PAIRING_MODE_WAIT_FOR_REQ 0x01
314 #define GAPBOND_PAIRING_MODE_INITIATE 0x02
316 
322 #define GAPBOND_IO_CAP_DISPLAY_ONLY 0x00
324 #define GAPBOND_IO_CAP_DISPLAY_YES_NO 0x01
326 #define GAPBOND_IO_CAP_KEYBOARD_ONLY 0x02
328 #define GAPBOND_IO_CAP_NO_INPUT_NO_OUTPUT 0x03
330 #define GAPBOND_IO_CAP_KEYBOARD_DISPLAY 0x04
332 
338 #define GAPBOND_KEYDIST_SENCKEY 0x01
340 #define GAPBOND_KEYDIST_SIDKEY 0x02
342 #define GAPBOND_KEYDIST_SSIGN 0x04
344 #define GAPBOND_KEYDIST_SLINK 0x08
346 #define GAPBOND_KEYDIST_MENCKEY 0x10
348 #define GAPBOND_KEYDIST_MIDKEY 0x20
350 #define GAPBOND_KEYDIST_MSIGN 0x40
352 #define GAPBOND_KEYDIST_MLINK 0x80
354 
373 #define GAPBOND_PAIRING_STATE_STARTED 0x00
374 
394 #define GAPBOND_PAIRING_STATE_COMPLETE 0x01
395 
413 #define GAPBOND_PAIRING_STATE_ENCRYPTED 0x02
414 #define GAPBOND_PAIRING_STATE_BOND_SAVED 0x03
416 #define GAPBOND_PAIRING_STATE_CAR_READ 0x04
418 #define GAPBOND_PAIRING_STATE_RPAO_READ 0x05
420 
435 #define SMP_PAIRING_FAILED_PASSKEY_ENTRY_FAILED 0x01
436 #define SMP_PAIRING_FAILED_OOB_NOT_AVAIL 0x02
438 
442 #define SMP_PAIRING_FAILED_AUTH_REQ 0x03
443 #define SMP_PAIRING_FAILED_CONFIRM_VALUE 0x04
445 #define SMP_PAIRING_FAILED_NOT_SUPPORTED 0x05
447 
451 #define SMP_PAIRING_FAILED_ENC_KEY_SIZE 0x06
452 #define SMP_PAIRING_FAILED_CMD_NOT_SUPPORTED 0x07
454 #define SMP_PAIRING_FAILED_UNSPECIFIED 0x08
456 
460 #define SMP_PAIRING_FAILED_REPEATED_ATTEMPTS 0x09
461 
465 #define SMP_PAIRING_FAILED_INVALID_PARAMETERS 0x0A
466 
470 #define SMP_PAIRING_FAILED_DHKEY_CHECK_FAILED 0x0B
471 
475 #define SMP_PAIRING_FAILED_NUM_COMPARISON_FAILED 0x0C
476 
482 #define GAPBOND_FAIL_NO_ACTION 0x00
484 #define GAPBOND_FAIL_INITIATE_PAIRING 0x01
486 #define GAPBOND_FAIL_TERMINATE_LINK 0x02
488 
492 #define GAPBOND_FAIL_TERMINATE_ERASE_BONDS 0x03
493 
499 #define GAPBOND_SECURE_CONNECTION_NONE 0x00
501 #define GAPBOND_SECURE_CONNECTION_ALLOW 0x01
503 #define GAPBOND_SECURE_CONNECTION_ONLY 0x02
505 
515 #define GAPBOND_REGENERATE_ALWAYS 0x00
517 #define GAPBOND_REGENERATE_NEVER 0xFF
519 
521 #define ECC_KEYLEN 32
523 
526 /*-------------------------------------------------------------------
527  * TYPEDEFS
528  */
529 
553 typedef void (*pfnPasscodeCB_t)
554 (
555  uint8_t *deviceAddr,
556  uint16_t connectionHandle,
557  uint8_t uiInputs,
558  uint8_t uiOutputs,
559  uint32_t numComparison
560 );
561 
573 typedef void (*pfnPairStateCB_t)
574 (
575  uint16_t connectionHandle,
576  uint8_t state,
577  uint8_t status
578 );
579 
586 typedef struct
587 {
590 } gapBondCBs_t;
591 
599 typedef struct
601 {
602  uint8_t privateKey[ECC_KEYLEN];
603  uint8_t publicKeyX[ECC_KEYLEN];
604  uint8_t publicKeyY[ECC_KEYLEN];
606 
608 /*-------------------------------------------------------------------
609  * API's
610  */
611 
617 extern void GAPBondMgr_Register(gapBondCBs_t *pCB);
618 
635 extern bStatus_t GAPBondMgr_SetParameter(uint16_t param, uint8_t len,
636  void *pValue);
637 
652 extern bStatus_t GAPBondMgr_GetParameter(uint16_t param, void *pValue);
653 
672 extern bStatus_t GAPBondMgr_Pair(uint16_t connHandle);
673 
702 extern bStatus_t GAPBondMgr_FindAddr(uint8_t *pDevAddr,
703  GAP_Peer_Addr_Types_t addrType,
704  uint8_t *pIdx,
705  GAP_Peer_Addr_Types_t *pIdentityAddrType,
706  uint8_t *pIdentityAddr);
707 
720 extern bStatus_t GAPBondMgr_ServiceChangeInd(uint16_t connectionHandle,
721  uint8_t setParam);
722 
737 extern bStatus_t GAPBondMgr_PasscodeRsp(uint16_t connectionHandle,
738  uint8_t status, uint32_t passcode);
739 
740 /*-------------------------------------------------------------------
741 -------------------------------------------------------------------*/
742 
743 #ifdef __cplusplus
744 }
745 #endif
746 
747 #endif /* GAPBONDMGR_H */
748 
GAP_Peer_Addr_Types_t
Address types used for specifying peer address type.
Definition: gap.h:588
Public and Private ECC Keys.
Definition: gapbondmgr.h:600
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:574
pfnPasscodeCB_t passcodeCB
Passcode callback.
Definition: gapbondmgr.h:588
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:586
void(* pfnPasscodeCB_t)(uint8_t *deviceAddr, uint16_t connectionHandle, uint8_t uiInputs, uint8_t uiOutputs, uint32_t numComparison)
Definition: gapbondmgr.h:554
GAP layer interface.
bStatus_t GAPBondMgr_ServiceChangeInd(uint16_t connectionHandle, uint8_t setParam)
uint32_t len
Image length in bytes.
Definition: oad_image_header.h:529
bStatus_t GAPBondMgr_SetParameter(uint16_t param, uint8_t len, void *pValue)
Status_t bStatus_t
BLE Generic Status return.
Definition: bcomdef.h:249
#define ECC_KEYLEN
ECC Key Length: 256 bit keys.
Definition: gapbondmgr.h:522
pfnPairStateCB_t pairStateCB
Pairing state callback.
Definition: gapbondmgr.h:589
© Copyright 1995-2021, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale