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

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

Modules

 Peripheral GAPRole Callbacks
 
 Peripheral GAPRole Constants
 

Files

file  peripheral.h
 Peripheral layer interface.
 

Functions

bStatus_t GAPRole_GetParameter (uint16_t param, void *pValue)
 Get a GAP Role parameter. More...
 
void GAPRole_RegisterAppCBs (gapRolesParamUpdateCB_t *pParamUpdateCB)
 Register application's callbacks. More...
 
bStatus_t GAPRole_SendUpdateParam (uint16_t minConnInterval, uint16_t maxConnInterval, uint16_t latency, uint16_t connTimeout, uint8_t handleFailure)
 Update the parameters of an existing connection. More...
 
bStatus_t GAPRole_SetParameter (uint16_t param, uint8_t len, void *pValue)
 Set a GAP Role parameter. More...
 
bStatus_t GAPRole_StartDevice (gapRolesCBs_t *pAppCallbacks)
 Initialize the GAP layer. More...
 
bStatus_t GAPRole_TerminateConnection (void)
 Terminates the existing connection. More...
 

Detailed Description

This module implements the Peripheral GAP Role.

Function Documentation

§ GAPRole_GetParameter()

bStatus_t GAPRole_GetParameter ( uint16_t  param,
void *  pValue 
)

Get a GAP Role parameter.

Note
The "pValue" field must point to a "uint16_t".
Parameters
paramPeripheral 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).
Returns
SUCCESS
INVALIDPARAMETER

§ GAPRole_RegisterAppCBs()

void GAPRole_RegisterAppCBs ( gapRolesParamUpdateCB_t pParamUpdateCB)

Register application's callbacks.

Parameters
pParamUpdateCBpointer to param update callback.

§ GAPRole_SendUpdateParam()

bStatus_t GAPRole_SendUpdateParam ( uint16_t  minConnInterval,
uint16_t  maxConnInterval,
uint16_t  latency,
uint16_t  connTimeout,
uint8_t  handleFailure 
)

Update the parameters of an existing connection.

Parameters
minConnIntervalthe desired min connection interval
maxConnIntervalthe desired min connection interval
latencythe new slave latency
connTimeoutthe new timeout value
handleFailureFailed Parameter Update Actions
Returns
SUCCESS : operation was successful.
INVALIDPARAMETER : Data can not fit into one packet.
MSG_BUFFER_NOT_AVAIL
bleInvalidRange : connection parameters violate spec
bleIncorrectMode : invalid profile role.
bleAlreadyInRequestedMode : already updating link parameters.
bleNotConnected : Connection is down
bleMemAllocError
bleNoResources

§ GAPRole_SetParameter()

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

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
paramPeripheral 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).
Returns
SUCCESS
INVALIDPARAMETER
bleInvalidRange : len is invalid for the given param
blePending : previous param update has not been completed
bleIncorrectMode : can not start connectable advertising because nonconnectable advertising is enabled

§ GAPRole_StartDevice()

bStatus_t GAPRole_StartDevice ( gapRolesCBs_t pAppCallbacks)

Initialize the GAP layer.

Warning
Only call this function once
Parameters
pAppCallbackspointer to application callbacks.
Returns
SUCCESS
bleAlreadyInRequestedMode : device was already initialized

§ GAPRole_TerminateConnection()

bStatus_t GAPRole_TerminateConnection ( void  )

Terminates the existing connection.

Returns
SUCCESS
bleIncorrectMode : there is no active connection
HCI_ERROR_CODE_CONTROLLER_BUSY : disconnect is already in process
Copyright 2017, Texas Instruments Incorporated