123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394 |
- #ifndef GAPBONDMGR_H
- #define GAPBONDMGR_H
- #ifdef __cplusplus
- extern "C"
- {
- #endif
- #include "gap.h"
- #if !defined ( GAP_BONDINGS_MAX )
- #define GAP_BONDINGS_MAX 10
- #endif
- #if !defined ( GAP_CHAR_CFG_MAX )
- #define GAP_CHAR_CFG_MAX 4
- #endif
- #define GAPBOND_PAIRING_MODE 0x400
- #define GAPBOND_INITIATE_WAIT 0x401
- #define GAPBOND_MITM_PROTECTION 0x402
- #define GAPBOND_IO_CAPABILITIES 0x403
- #define GAPBOND_OOB_ENABLED 0x404
- #define GAPBOND_OOB_DATA 0x405
- #define GAPBOND_BONDING_ENABLED 0x406
- #define GAPBOND_KEY_DIST_LIST 0x407
- #define GAPBOND_DEFAULT_PASSCODE 0x408
- #define GAPBOND_ERASE_ALLBONDS 0x409
- #define GAPBOND_AUTO_FAIL_PAIRING 0x40A
- #define GAPBOND_AUTO_FAIL_REASON 0x40B
- #define GAPBOND_KEYSIZE 0x40C
- #define GAPBOND_AUTO_SYNC_WL 0x40D
- #define GAPBOND_BOND_COUNT 0x40E
- #define GAPBOND_BOND_FAIL_ACTION 0x40F
- #define GAPBOND_ERASE_SINGLEBOND 0x410
- #define GAPBOND_PAIRING_MODE_NO_PAIRING 0x00
- #define GAPBOND_PAIRING_MODE_WAIT_FOR_REQ 0x01
- #define GAPBOND_PAIRING_MODE_INITIATE 0x02
- #define GAPBOND_IO_CAP_DISPLAY_ONLY 0x00
- #define GAPBOND_IO_CAP_DISPLAY_YES_NO 0x01
- #define GAPBOND_IO_CAP_KEYBOARD_ONLY 0x02
- #define GAPBOND_IO_CAP_NO_INPUT_NO_OUTPUT 0x03
- #define GAPBOND_IO_CAP_KEYBOARD_DISPLAY 0x04
- #define GAPBOND_KEYDIST_SENCKEY 0x01
- #define GAPBOND_KEYDIST_SIDKEY 0x02
- #define GAPBOND_KEYDIST_SSIGN 0x04
- #define GAPBOND_KEYDIST_MENCKEY 0x08
- #define GAPBOND_KEYDIST_MIDKEY 0x10
- #define GAPBOND_KEYDIST_MSIGN 0x20
- #define GAPBOND_PAIRING_STATE_STARTED 0x00
- #define GAPBOND_PAIRING_STATE_COMPLETE 0x01
- #define GAPBOND_PAIRING_STATE_BONDED 0x02
- #define SMP_PAIRING_FAILED_PASSKEY_ENTRY_FAILED 0x01
- #define SMP_PAIRING_FAILED_OOB_NOT_AVAIL 0x02
- #define SMP_PAIRING_FAILED_AUTH_REQ 0x03
- #define SMP_PAIRING_FAILED_CONFIRM_VALUE 0x04
- #define SMP_PAIRING_FAILED_NOT_SUPPORTED 0x05
- #define SMP_PAIRING_FAILED_ENC_KEY_SIZE 0x06
- #define SMP_PAIRING_FAILED_CMD_NOT_SUPPORTED 0x07
- #define SMP_PAIRING_FAILED_UNSPECIFIED 0x08
- #define SMP_PAIRING_FAILED_REPEATED_ATTEMPTS 0x09
- #define GAPBOND_FAIL_NO_ACTION 0x00
- #define GAPBOND_FAIL_INITIATE_PAIRING 0x01
- #define GAPBOND_FAIL_TERMINATE_LINK 0x02
- #define GAPBOND_FAIL_TERMINATE_ERASE_BONDS 0x03
- typedef void (*pfnPasscodeCB_t)
- (
- uint8 *deviceAddr,
- uint16 connectionHandle,
- uint8 uiInputs,
- uint8 uiOutputs
- );
- typedef void (*pfnPairStateCB_t)
- (
- uint16 connectionHandle,
- uint8 state,
- uint8 status
- );
- typedef struct
- {
- pfnPasscodeCB_t passcodeCB;
- pfnPairStateCB_t pairStateCB;
- } gapBondCBs_t;
- extern bStatus_t GAPBondMgr_SetParameter( uint16 param, uint8 len, void *pValue );
- extern bStatus_t GAPBondMgr_GetParameter( uint16 param, void *pValue );
- extern bStatus_t GAPBondMgr_LinkEst( uint8 addrType, uint8 *pDevAddr, uint16 connHandle, uint8 role );
- extern uint8 GAPBondMgr_ResolveAddr( uint8 addrType, uint8 *pDevAddr, uint8 *pResolvedAddr );
- extern bStatus_t GAPBondMgr_ServiceChangeInd( uint16 connectionHandle, uint8 setParam );
- extern bStatus_t GAPBondMgr_UpdateCharCfg( uint16 connectionHandle, uint16 attrHandle, uint16 value );
- extern void GAPBondMgr_Register( gapBondCBs_t *pCB );
- extern bStatus_t GAPBondMgr_PasscodeRsp( uint16 connectionHandle, uint8 status, uint32 passcode );
- extern uint8 GAPBondMgr_ProcessGAPMsg( gapEventHdr_t *pMsg );
- extern uint8 GAPBondMgr_CheckNVLen( uint8 id, uint8 len );
- extern void GAPBondMgr_Init( uint8 task_id );
- extern uint16 GAPBondMgr_ProcessEvent( uint8 task_id, uint16 events );
- #ifdef __cplusplus
- }
- #endif
- #endif
|