43 #define status_t bStatus_t 55 #define GAP_IS_ADDR_RPR(pAddr) ((pAddr[B_ADDR_LEN-1] & RANDOM_ADDR_HDR_MASK) \ 56 == PRIVATE_RESOLVE_ADDR_HDR) 66 #define GAP_IS_ADDR_RPN(pAddr) ((pAddr[B_ADDR_LEN-1] & RANDOM_ADDR_HDR_MASK) \ 67 == PRIVATE_NON_RESOLVE_ADDR_HDR) 77 #define GAP_IS_ADDR_RS(pAddr) ((pAddr[B_ADDR_LEN-1] & RANDOM_ADDR_HDR_MASK) \ 83 #define GAP_IS_ADDR_RAND(pAddr) (GAP_IS_ADDR_RPR(pAddr) | \ 84 GAP_IS_ADDR_RPN(pAddr) | \ 85 GAP_IS_ADDR_RS(pAddr)) 107 #define GAP_DEVICE_INIT_DONE_EVENT 0x00 111 #define GAP_LINK_ESTABLISHED_EVENT 0x05 115 #define GAP_LINK_TERMINATED_EVENT 0x06 121 #define GAP_LINK_PARAM_UPDATE_EVENT 0x07 128 #define GAP_SIGNATURE_UPDATED_EVENT 0x09 134 #define GAP_AUTHENTICATION_COMPLETE_EVENT 0x0A 140 #define GAP_PASSKEY_NEEDED_EVENT 0x0B 147 #define GAP_SLAVE_REQUESTED_SECURITY_EVENT 0x0C 153 #define GAP_BOND_COMPLETE_EVENT 0x0E 160 #define GAP_PAIRING_REQ_EVENT 0x0F 167 #define GAP_AUTHENTICATION_FAILURE_EVT 0x10 174 #define GAP_UPDATE_LINK_PARAM_REQ_EVENT 0x11 175 #define GAP_SCAN_SESSION_END_EVENT 0x12 180 #define GAP_CONNECTING_CANCELLED_EVENT 0x13 197 #define GAP_EVT_ADV_START_AFTER_ENABLE (uint32_t)BV(0) 203 #define GAP_EVT_ADV_END_AFTER_DISABLE (uint32_t)BV(1) 210 #define GAP_EVT_ADV_START (uint32_t)BV(2) 217 #define GAP_EVT_ADV_END (uint32_t)BV(3) 224 #define GAP_EVT_ADV_SET_TERMINATED (uint32_t)BV(4) 230 #define GAP_EVT_SCAN_REQ_RECEIVED (uint32_t)BV(5) 237 #define GAP_EVT_ADV_DATA_TRUNCATED (uint32_t)BV(6) 238 #define GAP_EVT_SCAN_ENABLED (uint32_t)BV(16) 246 #define GAP_EVT_SCAN_DISABLED (uint32_t)BV(17) 252 #define GAP_EVT_SCAN_PRD_ENDED (uint32_t)BV(18) 253 #define GAP_EVT_SCAN_DUR_ENDED (uint32_t)BV(19) 260 #define GAP_EVT_SCAN_INT_ENDED (uint32_t)BV(20) 261 #define GAP_EVT_SCAN_WND_ENDED (uint32_t)BV(21) 269 #define GAP_EVT_ADV_REPORT (uint32_t)BV(22) 275 #define GAP_EVT_ADV_REPORT_FULL (uint32_t)BV(23) 283 #define GAP_EVT_PRD_ADV_SYNC_ESTABLISHED (uint32_t)BV(24) 290 #define GAP_EVT_PRD_ADV_REPORT (uint32_t)BV(25) 297 #define GAP_EVT_PRD_ADV_SYNC_LOST (uint32_t)BV(26) 298 #define GAP_EVT_INSUFFICIENT_MEMORY (uint32_t)BV(31) 303 #define GAP_EVT_ADV_EVT_MASK (GAP_EVT_ADV_START_AFTER_ENABLE | \ 304 GAP_EVT_ADV_END_AFTER_DISABLE | \ 305 GAP_EVT_ADV_START | \ 307 GAP_EVT_ADV_SET_TERMINATED | \ 308 GAP_EVT_SCAN_REQ_RECEIVED | \ 309 GAP_EVT_ADV_DATA_TRUNCATED | \ 310 GAP_EVT_INSUFFICIENT_MEMORY) 313 #define GAP_EVT_SCAN_EVT_MASK (GAP_EVT_SCAN_ENABLED | \ 314 GAP_EVT_SCAN_DISABLED | \ 315 GAP_EVT_SCAN_PRD_ENDED | \ 316 GAP_EVT_SCAN_DUR_ENDED | \ 317 GAP_EVT_SCAN_INT_ENDED | \ 318 GAP_EVT_SCAN_WND_ENDED | \ 319 GAP_EVT_ADV_REPORT | \ 320 GAP_EVT_ADV_REPORT_FULL | \ 321 GAP_EVT_PRD_ADV_SYNC_ESTABLISHED | \ 322 GAP_EVT_PRD_ADV_REPORT | \ 323 GAP_EVT_PRD_ADV_SYNC_LOST | \ 324 GAP_EVT_INSUFFICIENT_MEMORY) 383 GAP_CONFIG_PARAM_COUNT
462 GAP_PARAM_AUTH_TASK_ID,
468 GAP_PARAM_DEPRECATED,
477 GAP_PARAM_GGS_PARAMS,
479 #if defined ( TESTMODES ) 483 GAP_PARAM_GAP_TESTCODE,
488 GAP_PARAM_SM_TESTCODE,
493 GAP_PARAM_GATT_TESTCODE,
498 GAP_PARAM_ATT_TESTCODE,
504 GAP_PARAM_L2CAP_TESTCODE,
526 #define GAP_PROFILE_BROADCASTER 0x01 528 #define GAP_PROFILE_OBSERVER 0x02 534 #define GAP_PROFILE_PERIPHERAL 0x04 539 #define GAP_PROFILE_CENTRAL 0x08 563 #if defined(BLE_V42_FEATURES) && (BLE_V42_FEATURES & PRIVACY_1_2_CFG) 568 #endif // PRIVACY_1_2_CFG 596 #define SET_ADDRTYPE_ID 0x02 598 #define MASK_ADDRTYPE_ID 0x01 606 #define RANDOM_ADDR_HDR_MASK 0xC0 608 #define STATIC_ADDR_HDR 0xC0 610 #define PRIVATE_NON_RESOLVE_ADDR_HDR 0x80 612 #define PRIVATE_RESOLVE_ADDR_HDR 0x40 622 #define GAP_ADTYPE_FLAGS 0x01 624 #define GAP_ADTYPE_16BIT_MORE 0x02 626 #define GAP_ADTYPE_16BIT_COMPLETE 0x03 628 #define GAP_ADTYPE_32BIT_MORE 0x04 630 #define GAP_ADTYPE_32BIT_COMPLETE 0x05 632 #define GAP_ADTYPE_128BIT_MORE 0x06 634 #define GAP_ADTYPE_128BIT_COMPLETE 0x07 636 #define GAP_ADTYPE_LOCAL_NAME_SHORT 0x08 638 #define GAP_ADTYPE_LOCAL_NAME_COMPLETE 0x09 640 #define GAP_ADTYPE_POWER_LEVEL 0x0A 642 #define GAP_ADTYPE_OOB_CLASS_OF_DEVICE 0x0D 644 #define GAP_ADTYPE_OOB_SIMPLE_PAIRING_HASHC 0x0E 646 #define GAP_ADTYPE_OOB_SIMPLE_PAIRING_RANDR 0x0F 648 #define GAP_ADTYPE_SM_TK 0x10 650 #define GAP_ADTYPE_SM_OOB_FLAG 0x11 656 #define GAP_ADTYPE_SLAVE_CONN_INTERVAL_RANGE 0x12 657 #define GAP_ADTYPE_SIGNED_DATA 0x13 659 #define GAP_ADTYPE_SERVICES_LIST_16BIT 0x14 661 #define GAP_ADTYPE_SERVICES_LIST_128BIT 0x15 663 #define GAP_ADTYPE_SERVICE_DATA 0x16 665 #define GAP_ADTYPE_PUBLIC_TARGET_ADDR 0x17 667 #define GAP_ADTYPE_RANDOM_TARGET_ADDR 0x18 669 #define GAP_ADTYPE_APPEARANCE 0x19 671 #define GAP_ADTYPE_ADV_INTERVAL 0x1A 673 #define GAP_ADTYPE_LE_BD_ADDR 0x1B 675 #define GAP_ADTYPE_LE_ROLE 0x1C 677 #define GAP_ADTYPE_SIMPLE_PAIRING_HASHC_256 0x1D 679 #define GAP_ADTYPE_SIMPLE_PAIRING_RANDR_256 0x1E 681 #define GAP_ADTYPE_SERVICE_DATA_32BIT 0x20 683 #define GAP_ADTYPE_SERVICE_DATA_128BIT 0x21 685 #define GAP_ADTYPE_3D_INFO_DATA 0x3D 691 #define GAP_ADTYPE_MANUFACTURER_SPECIFIC 0xFF 692 #define GAP_ADTYPE_FLAGS_LIMITED 0x01 694 #define GAP_ADTYPE_FLAGS_GENERAL 0x02 696 #define GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED 0x04 704 #define GAP_STATE_IDLE 0x00 705 #define GAP_STATE_ADV 0x01 706 #define GAP_STATE_SCAN 0x02 707 #define GAP_STATE_INIT 0x04 714 #define GAP_APPEARE_UNKNOWN 0x0000 715 #define GAP_APPEARE_GENERIC_PHONE 0x0040 716 #define GAP_APPEARE_GENERIC_COMPUTER 0x0080 717 #define GAP_APPEARE_GENERIC_WATCH 0x00C0 718 #define GAP_APPEARE_WATCH_SPORTS 0x00C1 719 #define GAP_APPEARE_GENERIC_CLOCK 0x0100 720 #define GAP_APPEARE_GENERIC_DISPLAY 0x0140 721 #define GAP_APPEARE_GENERIC_RC 0x0180 722 #define GAP_APPEARE_GENERIC_EYE_GALSSES 0x01C0 723 #define GAP_APPEARE_GENERIC_TAG 0x0200 724 #define GAP_APPEARE_GENERIC_KEYRING 0x0240 725 #define GAP_APPEARE_GENERIC_MEDIA_PLAYER 0x0280 726 #define GAP_APPEARE_GENERIC_BARCODE_SCANNER 0x02C0 727 #define GAP_APPEARE_GENERIC_THERMOMETER 0x0300 728 #define GAP_APPEARE_GENERIC_THERMO_EAR 0x0301 729 #define GAP_APPEARE_GENERIC_HR_SENSOR 0x0340 730 #define GAP_APPEARE_GENERIC_HRS_BELT 0x0341 731 #define GAP_APPEARE_GENERIC_BLOOD_PRESSURE 0x0380 732 #define GAP_APPEARE_GENERIC_BP_ARM 0x0381 733 #define GAP_APPEARE_GENERIC_BP_WRIST 0x0382 734 #define GAP_APPEARE_GENERIC_HID 0x03C0 735 #define GAP_APPEARE_HID_KEYBOARD 0x03C1 736 #define GAP_APPEARE_HID_MOUSE 0x03C2 737 #define GAP_APPEARE_HID_JOYSTIC 0x03C3 738 #define GAP_APPEARE_HID_GAMEPAD 0x03C4 739 #define GAP_APPEARE_HID_DIGITIZER_TYABLET 0x03C5 740 #define GAP_APPEARE_HID_DIGITAL_CARDREADER 0x03C6 741 #define GAP_APPEARE_HID_DIGITAL_PEN 0x03C7 742 #define GAP_APPEARE_HID_BARCODE_SCANNER 0x03C8 749 #define GAP_PRIVACY_MODE_NETWORK 0 750 #define GAP_PRIVACY_MODE_DEVICE 1 1058 uint8_t *deviceAddr,
1139 uint8_t* pRandomAddr);
1181 #if defined (BLE_V42_FEATURES) && (BLE_V42_FEATURES & PRIVACY_1_2_CFG) 1199 uint8_t *pAddr, uint8_t mode);
1200 #endif // BLE_V42_FEATURES & PRIVACY_1_2_CFG 1494 uint8_t startEncryption);
1507 extern void GAP_Init(uint8_t task_id);
uint8_t(* pfnSuppCentAddrRes_t)(uint8_t *deviceAddr, GAP_Peer_Addr_Types_t addrType)
Central Address Resolution (CAR) Support Callback Function.
Definition: gap.h:1057
GAP_Addr_Types_t
Address types used for identifying peer address type.
Definition: gap.h:572
osal_event_hdr_t hdr
GAP_MSG_EVENT and status
Definition: gap.h:819
This API allows the software components in the Z-Stack to be written independently of the specifics o...
GAP_Peer_Addr_Types_t
Address types used for specifying peer address type.
Definition: gap.h:586
uint8_t addrType
Device's address type for devAddr.
Definition: gap.h:821
This file contains the interface to the SM.
uint16_t connLatency
Connection Latency.
Definition: gap.h:836
No address provided.
Definition: gap.h:582
osal_event_hdr_t hdr
GAP_MSG_EVENT and status
Definition: gap.h:863
uint8_t opcode
GAP_BOND_COMPLETE_EVENT
Definition: gap.h:1008
uint8_t status
status from link layer, defined in ll.h
Definition: gap.h:908
smSecurityInfo_t * pSecurityInfo
security information from this device
Definition: gap.h:960
Random (static) Identity Address (corresponds to peer's RPA)
Definition: gap.h:579
uint8_t opcode
GAP_LINK_PARAM_UPDATE_EVENT
Definition: gap.h:907
bStatus_t GAP_TerminateAuth(uint16_t connectionHandle, uint8_t reason)
osal_event_hdr_t hdr
GAP_MSG_EVENT and status
Definition: gap.h:985
smSigningInfo_t * pSigningInfo
Signing information.
Definition: gap.h:961
uint8_t accepted
TRUE if host accepts parameter update, FALSE otherwise.
Definition: gap.h:852
osal_event_hdr_t hdr
GAP_MSG_EVENT and status
Definition: gap.h:798
Deny all parameter update requests.
Definition: gap.h:550
bStatus_t GAP_SetParamValue(uint16_t paramID, uint16_t paramValue)
osal_event_hdr_t hdr
GAP_MSG_EVENT and status
Definition: gap.h:767
uint16_t connectionHandle
Connection handle of the update.
Definition: gap.h:847
Gap_configParamIds_t
Definition: gap.h:342
uint8_t maxEncKeySize
Pairing Request Maximum Encryption Key Size field.
Definition: gap.h:1021
uint8_t opcode
GAP_DEVICE_INIT_DONE_EVENT
Definition: gap.h:799
uint16_t connectionHandle
connection Handle
Definition: gap.h:1040
uint16_t connectionHandle
Connection handle of the update.
Definition: gap.h:833
GAP event header format.
Definition: gap.h:765
uint16_t connInterval
Requested connection interval.
Definition: gap.h:910
uint16_t timeout
Connection Timeout (0x000A - 0x0C80 * 10 ms)
Definition: gap.h:786
uint16_t dataPktLen
HC_LE_Data_Packet_Length.
Definition: gap.h:801
Always Use Random Static Address.
Definition: gap.h:562
uint16_t intervalMin
Minimum value for the connection event (interval. 0x0006 - 0x0C80 * 1.25 ms)
Definition: gap.h:780
uint8_t uiInputs
Pairing User Interface Inputs - Ask user to input passcode.
Definition: gap.h:942
osal_event_hdr_t hdr
GAP_MSG_EVENT and status
Definition: gap.h:1007
bStatus_t GAP_TerminateLinkReq(uint16_t connectionHandle, uint8_t reason)
Random Device Address (controller unable to resolve)
Definition: gap.h:581
osal_event_hdr_t hdr
GAP_MSG_EVENT and status
Definition: gap.h:938
bStatus_t GAP_UpdateLinkParamReq(gapUpdateLinkParamReq_t *pParams)
void GAP_RegisterForMsgs(uint8_t taskID)
keyDist_t keyDist
Pairing Request Key Distribution field.
Definition: gap.h:1022
uint8_t ioCap
Pairing Request ioCap field.
Definition: gap.h:1018
uint16_t connectionHandle
connection Handle
Definition: gap.h:1009
uint16_t connInterval
Connection Interval.
Definition: gap.h:892
Gap_updateDecision_t
Definition: gap.h:547
Public Identity Address (corresponds to peer's RPA)
Definition: gap.h:577
osal_event_hdr_t hdr
GAP_MSG_EVENT and status
Definition: gap.h:886
uint8_t opcode
GAP_SIGNATURE_UPDATED_EVENT
Definition: gap.h:820
void(* pfnGapCB_t)(uint32_t event, void *pBuf, uintptr_t arg)
Definition: gap.h:1095
smIdentityInfo_t * pIdentityInfo
identity information
Definition: gap.h:963
uint16_t connLatency
Connection Latency.
Definition: gap.h:893
uint8_t * GAP_GetIRK(void)
uint8_t clockAccuracy
Clock Accuracy.
Definition: gap.h:895
uint8_t opcode
GAP_LINK_ESTABLISHED_EVENT
Definition: gap.h:887
uint8_t authReq
Definition: gap.h:994
void GAP_RegisterBondMgrCBs(gapBondMgrCBs_t *pCBs)
uint16_t connTimeout
Requested connection timeout.
Definition: gap.h:912
uint16_t intervalMin
Minimum Connection Interval.
Definition: gap.h:834
bStatus_t GAP_Bond(uint16_t connectionHandle, uint8_t authenticated, uint8_t secureConnections, smSecurityInfo_t *pParams, uint8_t startEncryption)
uint8_t uiOutputs
Pairing User Interface Outputs - Display passcode.
Definition: gap.h:943
uint16_t connTimeout
Connection Timeout.
Definition: gap.h:894
uint16_t connectionHandle
Connection handle.
Definition: gap.h:941
GAP_UPDATE_LINK_PARAM_REQ_EVENT message format.
Definition: gap.h:861
uint16_t GAP_ProcessEvent(uint8_t task_id, uint16_t events)
uint16_t connTimeout
Connection Timeout.
Definition: gap.h:837
smLinkSecurityReq_t secReqs
Pairing Control info.
Definition: gap.h:973
bStatus_t GAP_SendSlaveSecurityRequest(uint16_t connectionHandle, uint8_t authReq)
uint16_t GAP_GetParamValue(uint16_t paramID)
bStatus_t GAP_PasscodeUpdate(uint32_t passcode, uint16_t connectionHandle)
Always Use Resolvable Private Address with Random Identity Address.
Definition: gap.h:567
uint16_t intervalMin
Minimum Connection Interval.
Definition: gap.h:848
pfnSuppCentAddrRes_t suppCentAddrResCB
Supports Central Address Resolution.
Definition: gap.h:1077
osal_event_hdr_t hdr
GAP_MSG_EVENT and status
Definition: gap.h:956
Type definitions and macros for BLE stack.
uint32_t numComparison
Numeric Comparison value to be displayed.
Definition: gap.h:944
osal_event_hdr_t hdr
GAP_MSG_EVENT and status
Definition: gap.h:1038
uint16_t latency
Number of LL latency connection events (0x0000 - 0x03e8)
Definition: gap.h:784
uint8_t opcode
GAP_PAIRING_REQ_EVENT
Definition: gap.h:1039
Public Device Address.
Definition: gap.h:574
smSecurityInfo_t * pDevSecInfo
security information from connected device
Definition: gap.h:962
uint8_t GAP_NumActiveConnections(void)
void(* pfnGapIdleCB_t)()
GAP Idle Callback Function.
Definition: gap.h:1065
uint8_t opcode
GAP_SLAVE_REQUESTED_SECURITY_EVENT
Definition: gap.h:986
uint8_t reason
termination reason from LL, defined in ll.h
Definition: gap.h:925
Can be used by the application to set the SRK.
Definition: gap.h:380
uint16_t intervalMax
Maximum Connection Interval.
Definition: gap.h:849
OSAL Event Header.
Definition: osal.h:92
uint16_t connectionHandle
Connection handle of the update.
Definition: gap.h:909
uint8_t devAddrType
Device address type: GAP_Addr_Types_t.
Definition: gap.h:888
Gap_ParamIDs_t
Definition: gap.h:392
Always Use Public Address.
Definition: gap.h:561
bStatus_t GAP_UpdateLinkParamReqReply(gapUpdateLinkParamReqReply_t *pParams)
Can be used by the application to set the IRK.
Definition: gap.h:361
gapUpdateLinkParamReq_t req
Remote device's requested parameters.
Definition: gap.h:865
uint8_t opcode
GAP_PASSKEY_NEEDED_EVENT
Definition: gap.h:939
bStatus_t GAP_DeviceInit(uint8_t profileRole, uint8_t taskID, GAP_Addr_Modes_t addrMode, uint8_t *pRandomAddr)
uint8_t(* pfnGapDevPrivModeCB_t)(GAP_Peer_Addr_Types_t addrType, uint8_t *pAddr)
GAP Device Privacy Mode Callback Function.
Definition: gap.h:1069
uint8_t authState
TRUE if the pairing was authenticated (MITM)
Definition: gap.h:959
osal_event_hdr_t hdr
GAP_MSG_EVENT and status
Definition: gap.h:922
uint8_t opcode
GAP_LINK_TERMINATED_EVENT
Definition: gap.h:923
void GAP_Init(uint8_t task_id)
uint8_t opcode
GAP type of command. GAP Event IDs.
Definition: gap.h:768
uint8_t connRole
Role connection was formed as, GAP Profile Roles.
Definition: gap.h:891
#define B_ADDR_LEN
Default Public and Random Address Length.
Definition: bcomdef.h:115
uint8_t numDataPkts
HC_Total_Num_LE_Data_Packets.
Definition: gap.h:800
uint16_t connectionHandle
Connection Handle for this connection.
Definition: gap.h:890
Callback Registration Structure.
Definition: gap.h:1075
uint8_t GAP_isPairing(void)
uint8_t authReq
Pairing Request Auth Req field.
Definition: gap.h:1020
uint8_t * GAP_GetSRK(void)
uint16_t intervalMax
Maximum value for the connection event (interval. 0x0006 - 0x0C80 * 1.25 ms)
Definition: gap.h:782
pfnGapIdleCB_t gapIdleCB
GAP Idle callback.
Definition: gap.h:1078
uint8_t opcode
GAP_AUTHENTICATION_COMPLETE_EVENT
Definition: gap.h:957
uint8_t oobDataFlag
Pairing Request OOB Data Flag field.
Definition: gap.h:1019
uint16_t connectionHandle
Connection Handle from controller used to ref the device.
Definition: gap.h:958
Status_t bStatus_t
BLE Generic Status return.
Definition: bcomdef.h:242
Random or Random ID Address.
Definition: gap.h:589
uint8_t opcode
GAP_UPDATE_LINK_PARAM_REQ_EVENT
Definition: gap.h:864
Accept all parameter update requests.
Definition: gap.h:549
bStatus_t GAP_SetPrivacyMode(GAP_Peer_Addr_Types_t addrType, uint8_t *pAddr, uint8_t mode)
bStatus_t GapConfig_SetParameter(Gap_configParamIds_t param, void *pValue)
bStatus_t GAP_Signable(uint16_t connectionHandle, uint8_t authenticated, smSigningInfo_t *pParams)
uint16_t connLatency
Connection Latency.
Definition: gap.h:850
osal_event_hdr_t hdr
GAP_MSG_EVENT and status
Definition: gap.h:906
Always Use Resolvable Private Address with Public Identity Address.
Definition: gap.h:565
uint16_t connLatency
Requested connection latency.
Definition: gap.h:911
bStatus_t GAP_PasskeyUpdate(uint8_t *pPasskey, uint16_t connectionHandle)
gapPairingReq_t pairReq
The Pairing Request fields received.
Definition: gap.h:1041
Public or Public ID Address.
Definition: gap.h:588
bStatus_t GAP_Authenticate(gapAuthParams_t *pParams, gapPairingReq_t *pPairReq)
uint16_t connectionHandle
connection Handle
Definition: gap.h:924
uint16_t intervalMax
Maximum Connection Interval.
Definition: gap.h:835
uint32_t signCounter
new Signed Counter
Definition: gap.h:823
uint16_t connectionHandle
Connection Handle.
Definition: gap.h:987
GAP_Addr_Modes_t
Address modes to initialize the local device.
Definition: gap.h:559
uint16_t connTimeout
Connection Timeout.
Definition: gap.h:851
pfnGapDevPrivModeCB_t gapDevPrivModeCB
GAP Device Privacy Mode callback.
Definition: gap.h:1079
uint16_t connectionHandle
Connection Handle from controller,.
Definition: gap.h:972