Files | |
file | gatt_server_interface.h |
Data Structures | |
struct | gattServerMtuChangedEvent_t |
struct | gattServerAttributeWrittenEvent_t |
struct | gattServerLongCharacteristicWrittenEvent_t |
struct | gattServerCccdWrittenEvent_t |
struct | gattServerAttributeReadEvent_t |
struct | gattServerProcedureError_t |
struct | gattServerEvent_t |
union | gattServerEvent_t.eventData |
Typedefs | |
typedef void(* | gattServerCallback_t) (deviceId_t deviceId, gattServerEvent_t *pServerEvent) |
Functions | |
bleResult_t | GattServer_Init (void) |
bleResult_t | GattServer_RegisterCallback (gattServerCallback_t callback) |
bleResult_t | GattServer_RegisterHandlesForWriteNotifications (uint8_t handleCount, uint16_t *aAttributeHandles) |
bleResult_t | GattServer_SendAttributeWrittenStatus (deviceId_t deviceId, uint16_t attributeHandle, uint8_t status) |
bleResult_t | GattServer_RegisterHandlesForReadNotifications (uint8_t handleCount, uint16_t *aAttributeHandles) |
bleResult_t | GattServer_SendAttributeReadStatus (deviceId_t deviceId, uint16_t attributeHandle, uint8_t status) |
bleResult_t | GattServer_SendNotification (deviceId_t deviceId, uint16_t handle) |
bleResult_t | GattServer_SendIndication (deviceId_t deviceId, uint16_t handle) |
bleResult_t | GattServer_SendInstantValueNotification (deviceId_t deviceId, uint16_t handle, uint16_t valueLength, uint8_t *aValue) |
bleResult_t | GattServer_SendInstantValueIndication (deviceId_t deviceId, uint16_t handle, uint16_t valueLength, uint8_t *aValue) |
struct gattServerMtuChangedEvent_t |
struct gattServerAttributeWrittenEvent_t |
struct gattServerLongCharacteristicWrittenEvent_t |
struct gattServerCccdWrittenEvent_t |
GATT Server CCCD Written Event structure.
Data Fields | ||
---|---|---|
uint16_t | handle | Handle of the CCCD attribute. |
gattCccdFlags_t | newCccd | New value of the CCCD. |
struct gattServerAttributeReadEvent_t |
struct gattServerProcedureError_t |
Server-initiated procedure error structure.
Data Fields | ||
---|---|---|
gattServerProcedureType_t | procedureType | Procedure that generated error. |
bleResult_t | error | Error generated. |
struct gattServerEvent_t |
GATT Server Event structure: type + data.
Data Fields | ||
---|---|---|
gattServerEventType_t | eventType | Event type. |
union gattServerEvent_t | eventData | Event data : selected according to event type. |
union gattServerEvent_t.eventData |
Data Fields | ||
---|---|---|
gattServerMtuChangedEvent_t | mtuChangedEvent | For event type gEvtMtuChanged_c: the new value of the ATT_MTU. |
gattServerAttributeWrittenEvent_t | attributeWrittenEvent | For event types gEvtAttributeWritten_c, gEvtAttributeWrittenWithoutResponse_c: handle and value of the attempted write. |
gattServerCccdWrittenEvent_t | charCccdWrittenEvent | For event type gEvtCharacteristicCccdWritten_c: handle and value of the CCCD. |
gattServerProcedureError_t | procedureError | For event type gEvtError_c: error that terminated a Server-initiated procedure. |
gattServerLongCharacteristicWrittenEvent_t | longCharWrittenEvent | For event type gEvtLongCharacteristicWritten_c: handle and value. |
gattServerAttributeReadEvent_t | attributeReadEvent | For event types gEvtAttributeRead_c: handle of the attempted read. |
typedef void(* gattServerCallback_t) (deviceId_t deviceId, gattServerEvent_t *pServerEvent) |
GATT Server Callback prototype.
GATT Server Event type enumeration.
Server-initiated procedure type enumeration.
bleResult_t GattServer_Init | ( | void | ) |
Initializes the GATT Server module.
bleResult_t GattServer_RegisterCallback | ( | gattServerCallback_t | callback | ) |
Installs an application callback for the GATT Server module.
[in] | callback | Application-defined callback to be triggered by this module. |
bleResult_t GattServer_RegisterHandlesForWriteNotifications | ( | uint8_t | handleCount, |
uint16_t * | aAttributeHandles | ||
) |
Registers the attribute handles that will be notified through the GATT Server callback when a GATT Client attempts to modify the attributes' values.
[in] | handleCount | Number of handles in array. |
[in] | aAttributeHandles | Array of handles. |
bleResult_t GattServer_SendAttributeWrittenStatus | ( | deviceId_t | deviceId, |
uint16_t | attributeHandle, | ||
uint8_t | status | ||
) |
Responds to an intercepted attribute write operation.
[in] | deviceId | The device ID of the connected peer. |
[in] | attributeHandle | The attribute handle that was written. |
[in] | status | The status of the write operation. If this parameter is equal to gAttErrCodeNoError_c then an ATT Write Response will be sent to the peer. Else an ATT Error Response with the provided status will be sent to the peer. |
bleResult_t GattServer_RegisterHandlesForReadNotifications | ( | uint8_t | handleCount, |
uint16_t * | aAttributeHandles | ||
) |
Registers the attribute handles that will be notified through the GATT Server callback when a GATT Client attempts to read the attributes' values.
[in] | handleCount | Number of handles in array. |
[in] | aAttributeHandles | Array of handles. |
bleResult_t GattServer_SendAttributeReadStatus | ( | deviceId_t | deviceId, |
uint16_t | attributeHandle, | ||
uint8_t | status | ||
) |
Responds to an intercepted attribute read operation.
[in] | deviceId | The device ID of the connected peer. |
[in] | attributeHandle | The attribute handle that was being read. |
[in] | status | The status of the read operation. If this parameter is equal to gAttErrCodeNoError_c then an ATT Read Response will be sent to the peer containing the attribute value from the GATT Database. Else an ATT Error Response with the provided status will be sent to the peer. |
bleResult_t GattServer_SendNotification | ( | deviceId_t | deviceId, |
uint16_t | handle | ||
) |
Sends a notification to a peer GATT Client using the Characteristic Value from the GATT Database.
[in] | deviceId | The device ID of the connected peer. |
[in] | handle | Handle of the Value of the Characteristic to be notified. |
bleResult_t GattServer_SendIndication | ( | deviceId_t | deviceId, |
uint16_t | handle | ||
) |
Sends an indication to a peer GATT Client using the Characteristic Value from the GATT Database.
[in] | deviceId | The device ID of the connected peer. |
[in] | handle | Handle of the Value of the Characteristic to be indicated. |
bleResult_t GattServer_SendInstantValueNotification | ( | deviceId_t | deviceId, |
uint16_t | handle, | ||
uint16_t | valueLength, | ||
uint8_t * | aValue | ||
) |
Sends a notification to a peer GATT Client with data given as parameter, ignoring the GATT Database.
[in] | deviceId | The device ID of the connected peer. |
[in] | handle | Handle of the Value of the Characteristic to be notified. |
[in] | valueLength | Length of data to be notified. |
[in] | aValue | Data to be notified. |
bleResult_t GattServer_SendInstantValueIndication | ( | deviceId_t | deviceId, |
uint16_t | handle, | ||
uint16_t | valueLength, | ||
uint8_t * | aValue | ||
) |
Sends an indication to a peer GATT Client with data given as parameter, ignoring the GATT Database.
[in] | deviceId | The device ID of the connected peer. |
[in] | handle | Handle of the Value of the Characteristic to be indicated. |
[in] | valueLength | Length of data to be indicated. |
[in] | aValue | Data to be indicated. |