TI BLE-Stack for Bluetooth 4.2 API Documentation  3.01.00.07
Modules | Files | Functions
GAPRole (Central)

This module implements the Central GAP Role. More...

Modules

 Central GAPRole Callbacks
 
 Central GAPRole Constants
 
 Central GAPRole Structs
 

Files

file  central.h
 Central layer interface.
 

Functions

bStatus_t GAPCentralRole_CancelDiscovery (void)
 Cancel a device discovery scan. More...
 
bStatus_t GAPCentralRole_EstablishLink (uint8_t highDutyCycle, uint8_t whiteList, uint8_t addrTypePeer, uint8_t *peerAddr)
 Establish a link to a peer device. More...
 
bStatus_t GAPCentralRole_GetParameter (uint16_t param, void *pValue)
 Get a parameter in the Central Profile. More...
 
bStatus_t GAPCentralRole_SetParameter (uint16_t param, uint8_t len, void *pValue)
 Set a parameter in the Central Profile. More...
 
bStatus_t GAPCentralRole_StartDevice (gapCentralRoleCB_t *pAppCallbacks)
 Start the device in Central role. This function is typically called once during system startup. More...
 
bStatus_t GAPCentralRole_StartDiscovery (uint8_t mode, uint8_t activeScan, uint8_t whiteList)
 Start a device discovery scan. More...
 
bStatus_t GAPCentralRole_TerminateLink (uint16_t connHandle)
 Terminate a link. More...
 
bStatus_t GAPCentralRole_UpdateLink (uint16_t connHandle, uint16_t connIntervalMin, uint16_t connIntervalMax, uint16_t connLatency, uint16_t connTimeout)
 Update the link connection parameters. More...
 

Detailed Description

This module implements the Central GAP Role.

Function Documentation

§ GAPCentralRole_CancelDiscovery()

bStatus_t GAPCentralRole_CancelDiscovery ( void  )

Cancel a device discovery scan.

Returns
SUCCESS : Cancel started.
bleInvalidTaskID : Not the task that started discovery.
bleIncorrectMode : Not in discovery mode.

§ GAPCentralRole_EstablishLink()

bStatus_t GAPCentralRole_EstablishLink ( uint8_t  highDutyCycle,
uint8_t  whiteList,
uint8_t  addrTypePeer,
uint8_t *  peerAddr 
)

Establish a link to a peer device.

Parameters
highDutyCycleTRUE to high duty cycle scan, FALSE if not
whiteListdetermines use of the white list: GAP White List Options
addrTypePeerDevice Address Type
peerAddrpeer device address
Returns
SUCCESS : started establish link process.
bleIncorrectMode : invalid profile role.
bleNotReady : a scan is in progress.
bleAlreadyInRequestedMode : can't process now.
bleNoResources : too many links.

§ GAPCentralRole_GetParameter()

bStatus_t GAPCentralRole_GetParameter ( uint16_t  param,
void *  pValue 
)

Get a parameter in the Central Profile.

Parameters
paramprofile parameter ID: Central GAPRole Parameters
pValuepointer to buffer to contain the read data
Returns
SUCCESS : Operation successful.
INVALIDPARAMETER : Invalid parameter ID.

§ GAPCentralRole_SetParameter()

bStatus_t GAPCentralRole_SetParameter ( uint16_t  param,
uint8_t  len,
void *  pValue 
)

Set a parameter in the Central Profile.

Parameters
paramprofile parameter ID: Central GAPRole Parameters
lenlength of data to write
pValuepointer to data to write. This is dependent on the parameter ID and WILL be cast to the appropriate data type.
Returns
SUCCESS : Operation successful.
INVALIDPARAMETER : Invalid parameter ID.
bleInvalidRange : len is invalid for the given param

§ GAPCentralRole_StartDevice()

bStatus_t GAPCentralRole_StartDevice ( gapCentralRoleCB_t pAppCallbacks)

Start the device in Central role. This function is typically called once during system startup.

Parameters
pAppCallbackspointer to application callbacks
Returns
SUCCESS : Operation successful.
bleAlreadyInRequestedMode : Device already started.

§ GAPCentralRole_StartDiscovery()

bStatus_t GAPCentralRole_StartDiscovery ( uint8_t  mode,
uint8_t  activeScan,
uint8_t  whiteList 
)

Start a device discovery scan.

Parameters
modediscovery mode: GAP Device Discovery Modes
activeScanTRUE to perform active scan
whiteListTRUE to only scan for devices in the white list
Returns
SUCCESS : Discovery discovery has started.
bleIncorrectMode : Invalid profile role.
bleAlreadyInRequestedMode : Device discovery already started
HCI_ERROR_CODE_INVALID_HCI_CMD_PARAMS : bad parameter

§ GAPCentralRole_TerminateLink()

bStatus_t GAPCentralRole_TerminateLink ( uint16_t  connHandle)

Terminate a link.

Parameters
connHandleconnection handle of link to terminate or GAP Special Connection Handles
Returns
SUCCESS : Terminate started.
bleIncorrectMode : No link to terminate.
HCI_ERROR_CODE_CONTROLLER_BUSY : terminate procedure has already started

§ GAPCentralRole_UpdateLink()

bStatus_t GAPCentralRole_UpdateLink ( uint16_t  connHandle,
uint16_t  connIntervalMin,
uint16_t  connIntervalMax,
uint16_t  connLatency,
uint16_t  connTimeout 
)

Update the link connection parameters.

Parameters
connHandleconnection handle
connIntervalMinminimum connection interval in 1.25ms units
connIntervalMaxmaximum connection interval in 1.25ms units
connLatencynumber of LL latency connection events
connTimeoutconnection timeout in 10ms units
Returns
SUCCESS : Connection update started started.
bleNotConnected : No connection to update.
INVALIDPARAMETER : connection parameters are invalid
HCI_ERROR_CODE_INVALID_HCI_CMD_PARAMS : connection parameters do not meet Bluetooth low energy specification requirements:

(Supervision Timeout) > (1 + Slave Latency) × (Connection Interval × 2)

HCI_ERROR_CODE_UNKNOWN_CONN_ID : connHandle is inactive
HCI_ERROR_CODE_CONTROLLER_BUSY : there is already a param update in process
HCI_ERROR_CODE_UNACCEPTABLE_CONN_PARAMETERS (0x3B): connection interval does not work because it is not a multiple or divisor of intervals of the other simultaneous connection or the interval of the connection is not less than the allowed maximum connection interval as determined by the maximum number of connections times the number of slots per connection
Copyright 2017, Texas Instruments Incorporated