TI BLE-Stack for Bluetooth 4.2 API Documentation
3.01.00.07
|
This module implements the GATT Server App. More...
Modules | |
GATT Server App Callbacks | |
GATT Server App Constants | |
GATT Server App Structures | |
Files | |
file | gattservapp.h |
GATTServApp layer interface. | |
Macros | |
#define | GATT_CCC_TBL(pValue) ( (gattCharCfg_t *)(*((PTR_TYPE)(pValue))) ) |
Client Characteristic Configuration table (from CCC attribute value pointer) | |
#define | GATT_INCLUDED_HANDLE(attrs, i) ( *((uint16 *)((attrs)[(i)].pValue)) ) |
The handle of the first included service (i = 1) is the value of the second attribute. | |
#define | GATT_NUM_ATTRS(attrs) ( sizeof( attrs ) / sizeof( gattAttribute_t ) ) |
The number of attribute records in a given attribute table. | |
#define | GATT_SERVICE_HANDLE(attrs) ( (attrs)[0].handle ) |
The handle of a service is the handle of the first attribute. | |
Functions | |
bStatus_t | GATTServApp_AddService (uint32 services) |
Add function for the GATT Service. More... | |
bStatus_t | GATTServApp_DelService (uint32 services) |
Delete function for the GATT Service. More... | |
bStatus_t | GATTServApp_DeregisterService (uint16 handle, gattAttribute_t **p2pAttrs) |
Deregister a service's attribute list and callback functions from the GATT Server Application. More... | |
gattAttribute_t * | GATTServApp_FindAttr (gattAttribute_t *pAttrTbl, uint16 numAttrs, uint8 *pValue) |
Find the attribute record within a service attribute table for a given attribute value pointer. More... | |
bStatus_t | GATTServApp_GetParameter (uint8 param, void *pValue) |
Get a GATT Server parameter. More... | |
uint16 | GATTServApp_GetParamValue (void) |
Get a GATT Server Application Parameter value. More... | |
void | GATTServApp_InitCharCfg (uint16 connHandle, gattCharCfg_t *charCfgTbl) |
Initialize the client characteristic configuration table. More... | |
bStatus_t | GATTServApp_ProcessCCCWriteReq (uint16 connHandle, gattAttribute_t *pAttr, uint8 *pValue, uint16 len, uint16 offset, uint16 validCfg) |
Process the client characteristic configuration write request for a given client. More... | |
bStatus_t | GATTServApp_ProcessCharCfg (gattCharCfg_t *charCfgTbl, uint8 *pValue, uint8 authenticated, gattAttribute_t *attrTbl, uint16 numAttrs, uint8 taskId, pfnGATTReadAttrCB_t pfnReadAttrCB) |
Process Client Characteristic Configuration change. More... | |
uint8 | GATTServApp_ReadAttr (uint16 connHandle, gattAttribute_t *pAttr, uint16 service, uint8 *pValue, uint16 *pLen, uint16 offset, uint16 maxLen, uint8 method) |
Read an attribute. If the format of the attribute value is unknown to GATT Server, use the callback function provided by the Service. More... | |
uint16 | GATTServApp_ReadCharCfg (uint16 connHandle, gattCharCfg_t *charCfgTbl) |
Read the client characteristic configuration for a given client. More... | |
bStatus_t | GATTServApp_ReadRsp (uint16 connHandle, uint8 *pValue, uint16 pLen, uint16 offset) |
If a service returns blePending to the read attribute call back invoked from GATTServApp, the service can later respond to with the value to be read using this API. More... | |
void | GATTServApp_RegisterForMsg (uint8 taskID) |
Register your task ID to receive event messages from the GATT Server Application. More... | |
bStatus_t | GATTServApp_RegisterService (gattAttribute_t *pAttrs, uint16 numAttrs, uint8 encKeySize, CONST gattServiceCBs_t *pServiceCBs) |
Register a service's attribute list and callback functions with the GATT Server Application. More... | |
void | GATTServApp_SendCCCUpdatedEvent (uint16 connHandle, uint16 attrHandle, uint16 value) |
Build and send the GATT_CLIENT_CHAR_CFG_UPDATED_EVENT to the application. More... | |
bStatus_t | GATTServApp_SendServiceChangedInd (uint16 connHandle, uint8 taskId) |
Send out a Service Changed Indication. More... | |
bStatus_t | GATTServApp_SetParameter (uint8 param, uint8 len, void *pValue) |
Set a GATT Server parameter. More... | |
void | GATTServApp_SetParamValue (uint16 value) |
Set a GATT Server Application Parameter value. Use this function to change the default GATT parameter values. More... | |
bStatus_t | GATTServApp_UpdateCharCfg (uint16 connHandle, uint16 attrHandle, uint16 value) |
Update the Client Characteristic Configuration for a given Client. More... | |
uint8 | GATTServApp_WriteAttr (uint16 connHandle, uint16 handle, uint8 *pValue, uint16 len, uint16 offset, uint8 method) |
Write attribute data. More... | |
uint8 | GATTServApp_WriteCharCfg (uint16 connHandle, gattCharCfg_t *charCfgTbl, uint16 value) |
Write the client characteristic configuration for a given client. More... | |
This module implements the GATT Server App.
bStatus_t GATTServApp_AddService | ( | uint32 | services | ) |
Add function for the GATT Service.
services | - services to add. This is a bit map and can contain more than one service. |
bStatus_t GATTServApp_DelService | ( | uint32 | services | ) |
bStatus_t GATTServApp_DeregisterService | ( | uint16 | handle, |
gattAttribute_t ** | p2pAttrs | ||
) |
Deregister a service's attribute list and callback functions from the GATT Server Application.
handle | - handle of service to be deregistered |
p2pAttrs | - pointer to array of attribute records (to be returned) |
gattAttribute_t* GATTServApp_FindAttr | ( | gattAttribute_t * | pAttrTbl, |
uint16 | numAttrs, | ||
uint8 * | pValue | ||
) |
Find the attribute record within a service attribute table for a given attribute value pointer.
pAttrTbl | - pointer to attribute table |
numAttrs | - number of attributes in attribute table |
pValue | - pointer to attribute value |
bStatus_t GATTServApp_GetParameter | ( | uint8 | param, |
void * | pValue | ||
) |
Get a GATT Server parameter.
param | - GATT Server Parameters |
pValue | - pointer to data to put. This is dependent on the parameter ID and WILL be cast to the appropriate data type (example: data type of uint16 will be cast to uint16 pointer). |
uint16 GATTServApp_GetParamValue | ( | void | ) |
Get a GATT Server Application Parameter value.
void GATTServApp_InitCharCfg | ( | uint16 | connHandle, |
gattCharCfg_t * | charCfgTbl | ||
) |
Initialize the client characteristic configuration table.
connHandle | - connection handle (0xFFFF for all connections). |
charCfgTbl | - client characteristic configuration table. |
bStatus_t GATTServApp_ProcessCCCWriteReq | ( | uint16 | connHandle, |
gattAttribute_t * | pAttr, | ||
uint8 * | pValue, | ||
uint16 | len, | ||
uint16 | offset, | ||
uint16 | validCfg | ||
) |
Process the client characteristic configuration write request for a given client.
connHandle | - connection message was received on. |
pAttr | - pointer to attribute. |
pValue | - pointer to data to be written. |
len | - length of data. |
offset | - offset of the first octet to be written. |
validCfg | - valid configuration. |
bStatus_t GATTServApp_ProcessCharCfg | ( | gattCharCfg_t * | charCfgTbl, |
uint8 * | pValue, | ||
uint8 | authenticated, | ||
gattAttribute_t * | attrTbl, | ||
uint16 | numAttrs, | ||
uint8 | taskId, | ||
pfnGATTReadAttrCB_t | pfnReadAttrCB | ||
) |
Process Client Characteristic Configuration change.
charCfgTbl | - characteristic configuration table. |
pValue | - pointer to attribute value. |
authenticated | - whether an authenticated link is required. |
attrTbl | - attribute table. |
numAttrs | - number of attributes in attribute table. |
taskId | - task to be notified of confirmation. |
pfnReadAttrCB | - read callback function pointer. |
uint8 GATTServApp_ReadAttr | ( | uint16 | connHandle, |
gattAttribute_t * | pAttr, | ||
uint16 | service, | ||
uint8 * | pValue, | ||
uint16 * | pLen, | ||
uint16 | offset, | ||
uint16 | maxLen, | ||
uint8 | method | ||
) |
Read an attribute. If the format of the attribute value is unknown to GATT Server, use the callback function provided by the Service.
connHandle | - connection message was received on |
pAttr | - pointer to attribute |
service | - handle of owner service |
pValue | - pointer to data to be read |
pLen | - length of data to be read |
offset | - offset of the first octet to be read |
maxLen | - maximum length of data to be read |
method | - type of read |
uint16 GATTServApp_ReadCharCfg | ( | uint16 | connHandle, |
gattCharCfg_t * | charCfgTbl | ||
) |
Read the client characteristic configuration for a given client.
connHandle | - connection handle. |
charCfgTbl | - client characteristic configuration table. |
bStatus_t GATTServApp_ReadRsp | ( | uint16 | connHandle, |
uint8 * | pValue, | ||
uint16 | pLen, | ||
uint16 | offset | ||
) |
If a service returns blePending to the read attribute call back invoked from GATTServApp, the service can later respond to with the value to be read using this API.
connHandle | - connection read request was received on |
pValue | - pointer to data to be read (to be returned) |
pLen | - length of data (to be returned) |
offset | - offset of the first octet to be read |
void GATTServApp_RegisterForMsg | ( | uint8 | taskID | ) |
Register your task ID to receive event messages from the GATT Server Application.
taskID | - Default task ID to send events. |
bStatus_t GATTServApp_RegisterService | ( | gattAttribute_t * | pAttrs, |
uint16 | numAttrs, | ||
uint8 | encKeySize, | ||
CONST gattServiceCBs_t * | pServiceCBs | ||
) |
Register a service's attribute list and callback functions with the GATT Server Application.
pAttrs | - Array of attribute records to be registered |
numAttrs | - Number of attributes in array |
encKeySize | - Minimum encryption key size required by service (7-16 bytes) |
pServiceCBs | - Service callback function pointers |
void GATTServApp_SendCCCUpdatedEvent | ( | uint16 | connHandle, |
uint16 | attrHandle, | ||
uint16 | value | ||
) |
Build and send the GATT_CLIENT_CHAR_CFG_UPDATED_EVENT to the application.
connHandle | - connection handle |
attrHandle | - attribute handle |
value | - attribute new value |
bStatus_t GATTServApp_SendServiceChangedInd | ( | uint16 | connHandle, |
uint8 | taskId | ||
) |
Send out a Service Changed Indication.
connHandle | - connection to use |
taskId | - task to be notified of confirmation |
bStatus_t GATTServApp_SetParameter | ( | uint8 | param, |
uint8 | len, | ||
void * | pValue | ||
) |
Set a GATT Server parameter.
param | - GATT Server Parameters |
len | - length of data to right |
pValue | - pointer 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 will be cast to uint16 pointer). |
void GATTServApp_SetParamValue | ( | uint16 | value | ) |
Set a GATT Server Application Parameter value. Use this function to change the default GATT parameter values.
value | - new param value |
bStatus_t GATTServApp_UpdateCharCfg | ( | uint16 | connHandle, |
uint16 | attrHandle, | ||
uint16 | value | ||
) |
Update the Client Characteristic Configuration for a given Client.
connHandle | - connection handle. |
attrHandle | - attribute handle. |
value | - characteristic configuration value. |
uint8 GATTServApp_WriteAttr | ( | uint16 | connHandle, |
uint16 | handle, | ||
uint8 * | pValue, | ||
uint16 | len, | ||
uint16 | offset, | ||
uint8 | method | ||
) |
uint8 GATTServApp_WriteCharCfg | ( | uint16 | connHandle, |
gattCharCfg_t * | charCfgTbl, | ||
uint16 | value | ||
) |
Write the client characteristic configuration for a given client.
Note: Each client has its own instantiation of the Client Characteristic Configuration. Writes of the Client Characteristic Configuration only only affect the configuration of that client.
connHandle | - connection handle. |
charCfgTbl | - client characteristic configuration table. |
value | - attribute new value. |