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

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

Modules

 Multi GAPRole Callbacks
 
 Multi GAPRole Constants
 
 Multi GAPRole Structures
 

Files

file  multi.h
 Multi layer interface.
 

Functions

bStatus_t GAPRole_CancelDiscovery (void)
 Cancel a device discovery scan. More...
 
bStatus_t gapRole_connUpdate (uint8_t handleFailure, gapRole_updateConnParams_t *pConnParams)
 Send a connection parameter update to a connected device. More...
 
bStatus_t GAPRole_EstablishLink (uint8_t highDutyCycle, uint8_t whiteList, uint8_t addrTypePeer, uint8_t *peerAddr)
 Establish a link to a peer device. More...
 
bStatus_t GAPRole_GetParameter (uint16_t param, void *pValue, uint8 connHandle)
 Get a GAP Role parameter. More...
 
bStatus_t GAPRole_SetParameter (uint16_t param, uint8_t len, void *pValue, uint8 connHandle)
 Set a GAP Role parameter. More...
 
bStatus_t GAPRole_StartDevice (gapRolesCBs_t *pAppCallbacks, uint8_t *numConns)
 Initialize the GAP layer. More...
 
bStatus_t GAPRole_StartDiscovery (uint8_t mode, uint8_t activeScan, uint8_t whiteList)
 Start a device discovery scan. More...
 
bStatus_t GAPRole_TerminateConnection (uint16_t connHandle)
 Terminates the existing connection. More...
 

Detailed Description

This module implements the Multi GAP Role.

Function Documentation

§ GAPRole_CancelDiscovery()

bStatus_t GAPRole_CancelDiscovery ( void  )

Cancel a device discovery scan.

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

§ gapRole_connUpdate()

bStatus_t gapRole_connUpdate ( uint8_t  handleFailure,
gapRole_updateConnParams_t pConnParams 
)

Send a connection parameter update to a connected device.

Parameters
handleFailureFailed Parameter Update Actions
pConnParamspointer to connection parameters
Returns
SUCCESS : operation was successful.
INVALIDPARAMETER : Data can not fit into one packet.
MSG_BUFFER_NOT_AVAIL : No HCI buffer is available.
bleInvalidRange : params do not satisfy spec
bleIncorrectMode : invalid profile role.
bleAlreadyInRequestedMode : already updating link parameters.
bleNotConnected : Connection is down
bleMemAllocError : Memory allocation error occurred.
bleNoResources : No available resource

§ GAPRole_EstablishLink()

bStatus_t GAPRole_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

§ GAPRole_GetParameter()

bStatus_t GAPRole_GetParameter ( uint16_t  param,
void *  pValue,
uint8  connHandle 
)

Get a GAP Role parameter.

Note
The "pValue" field must point to a "uint16_t".
Parameters
paramMulti GAPRole Parameters
pValuepointer to location to get the value. This is dependent on the parameter ID and will be cast to the appropriate data type (example: data type of uint16_t will be cast to uint16_t pointer).
connHandleconnection handle
Returns
SUCCESS
INVALIDPARAMETER

§ GAPRole_SetParameter()

bStatus_t GAPRole_SetParameter ( uint16_t  param,
uint8_t  len,
void *  pValue,
uint8  connHandle 
)

Set a GAP Role parameter.

Note
The "len" field must be set to the size of a "uint16_t" and the "pValue" field must point to a "uint16_t".
Parameters
paramMulti 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 (example: data type of uint16_t will be cast to uint16_t pointer).
connHandleconnection handle
Returns
SUCCESS
INVALIDPARAMETER
bleInvalidRange : len is invalid for the given param

§ GAPRole_StartDevice()

bStatus_t GAPRole_StartDevice ( gapRolesCBs_t pAppCallbacks,
uint8_t *  numConns 
)

Initialize the GAP layer.

Warning
Only call this function once.
Parameters
pAppCallbacksgapRolesCBs_t
numConnsa pointer to the desired number of connections that the application wants is passed in with this parameter. the GAPRole will use this value to negotiate with the amount of connections that the stack supports and place the negotiated value in this memory location for return to the app.
Returns
SUCCESS
bleAlreadyInRequestedMode : Device already started.

§ GAPRole_StartDiscovery()

bStatus_t GAPRole_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

§ GAPRole_TerminateConnection()

bStatus_t GAPRole_TerminateConnection ( uint16_t  connHandle)

Terminates the existing connection.

Parameters
connHandlehandle of connection to terminate
Returns
SUCCESS
bleIncorrectMode
HCI_ERROR_CODE_CONTROLLER_BUSY : terminate procedure has already started
Copyright 2017, Texas Instruments Incorporated