BLE-Stack APIs
3.00.00
|
This module implements the Generic Access Protocol (GAP) More...
Modules | |
GAP Callbacks | |
GAP Constants | |
GAP Structures | |
Files | |
file | gap.h |
GAP layer interface. | |
Functions | |
bStatus_t | GAP_Authenticate (gapAuthParams_t *pParams, gapPairingReq_t *pPairReq) |
Start Authentication. More... | |
bStatus_t | GAP_Bond (uint16 connectionHandle, uint8 authenticated, uint8 secureConnections, smSecurityInfo_t *pParams, uint8 startEncryption) |
Set up the connection's bound paramaters. More... | |
bStatus_t | GAP_ConfigDeviceAddr (uint8 addrMode, uint8 *pStaticAddr) |
Configure Device Address. More... | |
bStatus_t | GAP_DeviceDiscoveryCancel (uint8 taskID) |
Cancel an existing device discovery request. More... | |
bStatus_t | GAP_DeviceDiscoveryRequest (gapDevDiscReq_t *pParams) |
Start a device discovery scan. More... | |
bStatus_t | GAP_DeviceInit (uint8 taskID, uint8 profileRole, uint8 maxScanResponses, uint8 *pIRK, uint8 *pSRK, uint32 *pSignCounter) |
GAP Device Initialiation. More... | |
bStatus_t | GAP_EndDiscoverable (uint8 taskID) |
Stops advertising. More... | |
bStatus_t | GAP_EstablishLinkReq (gapEstLinkReq_t *pParams) |
Establish a link to a slave device. More... | |
gapAdvDataToken_t * | GAP_GetAdvToken (uint8 adType) |
Get Advertising Token. More... | |
uint16 | GAP_GetParamValue (gapParamIDs_t paramID) |
Get a GAP Parameter value. More... | |
uint8 | GAP_isPairing (void) |
Check if GAP is currently pairing. More... | |
bStatus_t | GAP_MakeDiscoverable (uint8 taskID, gapAdvertisingParams_t *pParams) |
Setup or change advertising. Also starts advertising. More... | |
uint8 | GAP_NumActiveConnections (void) |
Returns the number of active connections. More... | |
bStatus_t | GAP_PasscodeUpdate (uint32 passcode, uint16 connectionHandle) |
Update the passkey in a numeric value (not string). More... | |
bStatus_t | GAP_PasskeyUpdate (uint8 *pPasskey, uint16 connectionHandle) |
Update the passkey in string format. More... | |
void | GAP_RegisterBondMgrCBs (gapBondMgrCBs_t *pCBs) |
Register bond manager call backs. More... | |
void | GAP_RegisterForMsgs (uint8 taskID) |
Register for GAP Messages. More... | |
gapAdvDataToken_t * | GAP_RemoveAdvToken (uint8 adType) |
Remove Advertising Token. More... | |
bStatus_t | GAP_ResolvePrivateAddr (uint8 *pIRK, uint8 *pAddr) |
Resolves a private address against an IRK. More... | |
bStatus_t | GAP_SendSlaveSecurityRequest (uint16 connectionHandle, uint8 authReq) |
Generate a Slave Requested Security message to the master. More... | |
bStatus_t | GAP_SetAdvToken (gapAdvDataToken_t *pToken) |
Set Advertising Token. More... | |
bStatus_t | GAP_SetParamValue (gapParamIDs_t paramID, uint16 paramValue) |
Set a GAP Parameter value. More... | |
bStatus_t | GAP_Signable (uint16 connectionHandle, uint8 authenticated, smSigningInfo_t *pParams) |
Set up the connection to accept signed data. More... | |
bStatus_t | GAP_TerminateAuth (uint16 connectionHandle, uint8 reason) |
Terminate Authnetication. More... | |
bStatus_t | GAP_TerminateLinkReq (uint8 taskID, uint16 connectionHandle, uint8 reason) |
Terminate a link connection. More... | |
bStatus_t | GAP_UpdateAdvertisingData (uint8 taskID, uint8 adType, uint8 dataLen, uint8 *pAdvertData) |
Setup or change advertising and scan response data. More... | |
bStatus_t | GAP_UpdateAdvTokens (void) |
Update Advertising Token. More... | |
bStatus_t | GAP_UpdateLinkParamReq (gapUpdateLinkParamReq_t *pParams) |
Update the link parameters to a Master or Slave device. More... | |
bStatus_t | GAP_UpdateLinkParamReqReply (gapUpdateLinkParamReqReply_t *pParams) |
Reply to a Connection Parameter Update Request sent from a remote device. More... | |
This module implements the Generic Access Protocol (GAP)
bStatus_t GAP_Authenticate | ( | gapAuthParams_t * | pParams, |
gapPairingReq_t * | pPairReq | ||
) |
Start Authentication.
Start the Authentication process with the requested device. This function is used to Initiate/Allow pairing. Called by both master and slave device (Central and Peripheral).
pParams | - Authentication parameters |
pPairReq | - Enter these parameters if the Pairing Request was already received. NULL, if waiting for Pairing Request or if initiating. |
bStatus_t GAP_Bond | ( | uint16 | connectionHandle, |
uint8 | authenticated, | ||
uint8 | secureConnections, | ||
smSecurityInfo_t * | pParams, | ||
uint8 | startEncryption | ||
) |
Set up the connection's bound paramaters.
connectionHandle | - connection handle of the signing information |
authenticated | - TRUE if bond is authenticated. |
secureConnections | - TRUE if bond has Secure Connections strength. |
pParams | - the connected device's security parameters |
startEncryption | - whether or not to start encryption |
bStatus_t GAP_ConfigDeviceAddr | ( | uint8 | addrMode, |
uint8 * | pStaticAddr | ||
) |
Configure Device Address.
Setup the device's address type. If ADDRMODE_PRIVATE_RESOLVE is selected, the address will change periodically.
addrMode | - GAP Addressing Modes |
pStaticAddr | - Only used with ADDRMODE_STATIC or ADDRMODE_PRIVATE_NONRESOLVE type. NULL to auto generate otherwise the application can specify the address value |
bStatus_t GAP_DeviceDiscoveryCancel | ( | uint8 | taskID | ) |
Cancel an existing device discovery request.
taskID | - task to receive event |
bStatus_t GAP_DeviceDiscoveryRequest | ( | gapDevDiscReq_t * | pParams | ) |
Start a device discovery scan.
pParams | - Device Discovery parameters |
bStatus_t GAP_DeviceInit | ( | uint8 | taskID, |
uint8 | profileRole, | ||
uint8 | maxScanResponses, | ||
uint8 * | pIRK, | ||
uint8 * | pSRK, | ||
uint32 * | pSignCounter | ||
) |
GAP Device Initialiation.
Setup the device. Call just once on initialization.
taskID | - task to receive event |
profileRole | - GAP Profile Roles: GAP Profile Roles |
maxScanResponses | - maximum number to scan responses we can receive during a device discovery. |
pIRK | - pointer to Identity Root Key, NULLKEY (all zeroes) if the app wants the GAP to generate the key. |
pSRK | - pointer to Sign Resolving Key, NULLKEY if the app wants the GAP to generate the key. |
pSignCounter | - 32 bit value used in the SM Signing algorithm that shall be initialized to zero and incremented with every new signing. This variable must also be maintained by the application. |
bStatus_t GAP_EndDiscoverable | ( | uint8 | taskID | ) |
Stops advertising.
taskID | - task to receive event |
bStatus_t GAP_EstablishLinkReq | ( | gapEstLinkReq_t * | pParams | ) |
Establish a link to a slave device.
pParams | - link establishment parameters |
gapAdvDataToken_t* GAP_GetAdvToken | ( | uint8 | adType | ) |
Get Advertising Token.
Called to read a GAP Advertisement/Scan Response data token.
adType | - Advertisement type to get |
uint16 GAP_GetParamValue | ( | gapParamIDs_t | paramID | ) |
Get a GAP Parameter value.
paramID | - parameter ID: GAP Parameter IDs |
uint8 GAP_isPairing | ( | void | ) |
Check if GAP is currently pairing.
bStatus_t GAP_MakeDiscoverable | ( | uint8 | taskID, |
gapAdvertisingParams_t * | pParams | ||
) |
Setup or change advertising. Also starts advertising.
taskID | - task to receive event |
pParams | - advertising parameters |
uint8 GAP_NumActiveConnections | ( | void | ) |
Returns the number of active connections.
bStatus_t GAP_PasscodeUpdate | ( | uint32 | passcode, |
uint16 | connectionHandle | ||
) |
Update the passkey in a numeric value (not string).
passcode | - not string - range: 0 - 999,999. |
connectionHandle | - connection handle. |
bStatus_t GAP_PasskeyUpdate | ( | uint8 * | pPasskey, |
uint16 | connectionHandle | ||
) |
Update the passkey in string format.
pPasskey | - new passkey - pointer to numeric string (ie. "019655" ) This string's range is "000000" to "999999" |
connectionHandle | - connection handle. |
void GAP_RegisterBondMgrCBs | ( | gapBondMgrCBs_t * | pCBs | ) |
Register bond manager call backs.
pCBs | - pointer to Bond Manager Callbacks. |
void GAP_RegisterForMsgs | ( | uint8 | taskID | ) |
Register for GAP Messages.
Register a task ID to receive extra (unprocessed) HCI status and complete, and Host events.
taskID | - Default task ID to send events. |
gapAdvDataToken_t* GAP_RemoveAdvToken | ( | uint8 | adType | ) |
Remove Advertising Token.
Called to remove a GAP Advertisement/Scan Response data token.
adType | - Advertisement type to remove |
bStatus_t GAP_ResolvePrivateAddr | ( | uint8 * | pIRK, |
uint8 * | pAddr | ||
) |
Resolves a private address against an IRK.
pIRK | - pointer to the IRK |
pAddr | - pointer to the Resolvable Private address |
bStatus_t GAP_SendSlaveSecurityRequest | ( | uint16 | connectionHandle, |
uint8 | authReq | ||
) |
Generate a Slave Requested Security message to the master.
This API can be used to initiate security as a slave.
connectionHandle | - connection handle. |
authReq | - Authentication Requirements: Bit 2: MITM, Bits 0-1: bonding (0 - no bonding, 1 - bonding) Bit 3: Secure Connections |
bStatus_t GAP_SetAdvToken | ( | gapAdvDataToken_t * | pToken | ) |
Set Advertising Token.
Called to setup a GAP Advertisement / Scan Response data token.
pToken | - Advertisement/Scan response token to write. |
bStatus_t GAP_SetParamValue | ( | gapParamIDs_t | paramID, |
uint16 | paramValue | ||
) |
Set a GAP Parameter value.
Use this function to change the default GAP parameter values.
paramID | - parameter ID: GAP Parameter IDs |
paramValue | - new param value |
bStatus_t GAP_Signable | ( | uint16 | connectionHandle, |
uint8 | authenticated, | ||
smSigningInfo_t * | pParams | ||
) |
Set up the connection to accept signed data.
connectionHandle | - connection handle of the signing information |
authenticated | - TRUE if the signing information is authenticated, FALSE otherwise |
pParams | - signing parameters |
bStatus_t GAP_TerminateAuth | ( | uint16 | connectionHandle, |
uint8 | reason | ||
) |
Terminate Authnetication.
Send a Pairing Failed message and end any existing pairing.
connectionHandle | - connection handle. |
reason | - Pairing Failed reason code. |
bStatus_t GAP_TerminateLinkReq | ( | uint8 | taskID, |
uint16 | connectionHandle, | ||
uint8 | reason | ||
) |
Terminate a link connection.
taskID | - requesting app's task id. |
connectionHandle | - connection handle of link to terminate or GAP Special Connection Handles |
reason | - terminate reason. |
bStatus_t GAP_UpdateAdvertisingData | ( | uint8 | taskID, |
uint8 | adType, | ||
uint8 | dataLen, | ||
uint8 * | pAdvertData | ||
) |
Setup or change advertising and scan response data.
taskID | - task to receive event |
adType | - TRUE - advertisement data, FALSE - scan response data |
dataLen | - Octet length of advertData |
pAdvertData | - advertising or scan response data |
bStatus_t GAP_UpdateAdvTokens | ( | void | ) |
Update Advertising Token.
Called to rebuild and load Advertisement and Scan Response data from existing GAP Advertisement Tokens.
bStatus_t GAP_UpdateLinkParamReq | ( | gapUpdateLinkParamReq_t * | pParams | ) |
Update the link parameters to a Master or Slave device.
pParams | - link update parameters |
bStatus_t GAP_UpdateLinkParamReqReply | ( | gapUpdateLinkParamReqReply_t * | pParams | ) |
Reply to a Connection Parameter Update Request sent from a remote device.
pParams | - local device's desired connection parameters. |