COMMON IO-BLE v1.0.0
Hardware abstraction layer for Bluetooth
 
Loading...
Searching...
No Matches
BT-GATT Server Callbacks

Callbacks for BT-GATT Server Interface. More...

Typedefs

typedef void(* BTRegisterServerCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, BTUuid_t *pxAppUuid)
 Callback invoked in response to pxRegisterServer.
 
typedef void(* BTUnregisterServerCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf)
 Callback invoked in response to pxUnregisterServer.
 
typedef void(* BTConnectionCallback_t) (uint16_t usConnId, uint8_t ucServerIf, bool bConnected, BTBdaddr_t *pxBda)
 Callback invoked on a connection event.
 
typedef void(* BTServiceAddedCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, BTGattSrvcId_t *pxSrvcId, uint16_t usServiceHandle)
 Callback invoked in response to pxAddService.
 
typedef void(* BTIncludedServiceAddedCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, uint16_t usServiceHandle, uint16_t usInclSrvcHandle)
 Callback invoked in response to pxAddIncludedService.
 
typedef void(* BTCharacteristicAddedCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, BTUuid_t *pxUuid, uint16_t usServiceHandle, uint16_t usCharHandle)
 Callback invoked in response to pxAddCharacteristic.
 
typedef void(* BTSetValCallback_t) (BTStatus_t xStatus, uint16_t usAttrHandle)
 Callback invoked in response to pxSetVal.
 
typedef void(* BTDescriptorAddedCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, BTUuid_t *pxUuid, uint16_t usServiceHandle, uint16_t usDescrHandle)
 Callback invoked in response to pxAddDescriptor.
 
typedef void(* BTServiceStartedCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, uint16_t usServiceHandle)
 Callback invoked in response to pxStartService.
 
typedef void(* BTServiceStoppedCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, uint16_t usServiceHandle)
 Callback invoked in response to pxStopService.
 
typedef void(* BTServiceDeletedCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, uint16_t usServiceHandle)
 Callback invoked in response to pxDeleteService.
 
typedef void(* BTRequestReadCallback_t) (uint16_t usConnId, uint32_t ulTransId, BTBdaddr_t *pxBda, uint16_t usAttrHandle, uint16_t usOffset)
 Callback invoked on read event.
 
typedef void(* BTRequestWriteCallback_t) (uint16_t usConnId, uint32_t ulTransId, BTBdaddr_t *pxBda, uint16_t usAttrHandle, uint16_t usOffset, size_t xLength, bool bNeedRsp, bool bIsPrep, uint8_t *pucValue)
 Callback invoked on write event.
 
typedef void(* BTRequestExecWriteCallback_t) (uint16_t usConnId, uint32_t ulTransId, BTBdaddr_t *pxBda, bool bExecWrite)
 Callback invoked on execute write event.
 
typedef void(* BTResponseConfirmationCallback_t) (BTStatus_t xStatus, uint16_t usHandle)
 Callback triggered in response to sendResponse if the remote device sends a confirmation.
 
typedef void(* BTIndicationSentCallback_t) (uint16_t usConnId, BTStatus_t xStatus)
 Callback on confirmation device from the remote device to an indication. Or confirm a Notification as been sent.
 
typedef void(* BTMtuChangedCallback_t) (uint16_t usConnId, uint16_t usMtu)
 Callback invoked when the MTU for a given connection changes.
 
typedef void(* BTWhiteListChangedCallback_t) (const BTBdaddr_t *pxBdAddr, bool bIsAdded)
 Callback for notifying modification in white list.
 

Detailed Description

Callbacks for BT-GATT Server Interface.

Typedef Documentation

◆ BTRegisterServerCallback_t

typedef void(* BTRegisterServerCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, BTUuid_t *pxAppUuid)

Callback invoked in response to pxRegisterServer.

BT-GATT Server callback structure.

Parameters
[in]xStatusreturns eBTStatusSuccess if operation succeeded.
[in]ucServerIfServer interface.
[in]pxAppUuidGATT server UUID.

◆ BTUnregisterServerCallback_t

typedef void(* BTUnregisterServerCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf)

Callback invoked in response to pxUnregisterServer.

Parameters
[in]xStatusreturns eBTStatusSuccess if operation succeeded.
[in]ucServerIfServer interface, return on the callback BTRegisterServerCallback_t after successful pxRegisterServer call.
Returns

◆ BTConnectionCallback_t

typedef void(* BTConnectionCallback_t) (uint16_t usConnId, uint8_t ucServerIf, bool bConnected, BTBdaddr_t *pxBda)

Callback invoked on a connection event.

Parameters
[in]usConnIdConnection Identifier. Uniquely identify a connection.
[in]ucServerIfServer interface, return on the callback BTRegisterServerCallback_t after successful pxRegisterServer call.
[in]bConnectedFlag set to true on a connect and to false on a disconnect.
[in]pxBdaAddress of the remote device.

◆ BTServiceAddedCallback_t

typedef void(* BTServiceAddedCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, BTGattSrvcId_t *pxSrvcId, uint16_t usServiceHandle)

Callback invoked in response to pxAddService.

Parameters
[in]xStatusreturns eBTStatusSuccess if operation succeeded.
[in]ucServerIfServer interface, return on the callback BTRegisterServerCallback_t after successful pxRegisterServer call.
[in]pxSrvcIdService ID, returned on BTServiceAddedCallback_t after calling pxAddService.
[in]usServiceHandleHandle of the service containing the attribute.

◆ BTIncludedServiceAddedCallback_t

typedef void(* BTIncludedServiceAddedCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, uint16_t usServiceHandle, uint16_t usInclSrvcHandle)

Callback invoked in response to pxAddIncludedService.

Parameters
[in]xStatusreturns eBTStatusSuccess if operation succeeded.
[in]ucServerIfServer interface, return on the callback BTRegisterServerCallback_t after successful pxRegisterServer call.
[in]usServiceHandleHandle of the service containing the attribute.
[in]usInclSrvcHandleHandle of the Attribute "included service".

◆ BTCharacteristicAddedCallback_t

typedef void(* BTCharacteristicAddedCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, BTUuid_t *pxUuid, uint16_t usServiceHandle, uint16_t usCharHandle)

Callback invoked in response to pxAddCharacteristic.

Parameters
[in]xStatusreturns eBTStatusSuccess if operation succeeded.
[in]ucServerIfServer interface, return on the callback BTRegisterServerCallback_t after successful pxRegisterServer call.
[in]pxUuidUUID of the characteristic.
[in]usServiceHandleHandle of the service containing the attribute.
[in]usCharHandleHandle of the characteristic being added.

◆ BTSetValCallback_t

typedef void(* BTSetValCallback_t) (BTStatus_t xStatus, uint16_t usAttrHandle)

Callback invoked in response to pxSetVal.

Parameters
[in]xStatusreturns eBTStatusSuccess if operation succeeded.
[in]usAttrHandleHandle of the attribute.

◆ BTDescriptorAddedCallback_t

typedef void(* BTDescriptorAddedCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, BTUuid_t *pxUuid, uint16_t usServiceHandle, uint16_t usDescrHandle)

Callback invoked in response to pxAddDescriptor.

Parameters
[in]xStatusreturns eBTStatusSuccess if operation succeeded.
[in]ucServerIfServer interface, return on the callback BTRegisterServerCallback_t after successful pxRegisterServer call.
[in]pxUuidUUID of the descriptor.
[in]usServiceHandleHandle of the service containing the attribute.
[in]usDescrHandleHandle of the descriptor being added.

◆ BTServiceStartedCallback_t

typedef void(* BTServiceStartedCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, uint16_t usServiceHandle)

Callback invoked in response to pxStartService.

Parameters
[in]xStatusreturns eBTStatusSuccess if operation succeeded.
[in]ucServerIfServer interface, return on the callback BTRegisterServerCallback_t after successful pxRegisterServer call.
[in]usServiceHandleHandle of the service containing the attribute.

◆ BTServiceStoppedCallback_t

typedef void(* BTServiceStoppedCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, uint16_t usServiceHandle)

Callback invoked in response to pxStopService.

Parameters
[in]xStatusreturns eBTStatusSuccess if operation succeeded.
[in]ucServerIfServer interface, return on the callback BTRegisterServerCallback_t after successful pxRegisterServer call.
[in]usServiceHandleHandle of the service containing the attribute.

◆ BTServiceDeletedCallback_t

typedef void(* BTServiceDeletedCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, uint16_t usServiceHandle)

Callback invoked in response to pxDeleteService.

Parameters
[in]xStatusReturns eBTStatusSuccess if operation succeeded.
[in]ucServerIfServer interface, return on the callback BTRegisterServerCallback_t after successful pxRegisterServer call.
[in]usServiceHandleHandle of the service containing the attribute.

◆ BTRequestReadCallback_t

typedef void(* BTRequestReadCallback_t) (uint16_t usConnId, uint32_t ulTransId, BTBdaddr_t *pxBda, uint16_t usAttrHandle, uint16_t usOffset)

Callback invoked on read event.

Callback invoked when a remote device has requested to read a characteristic or descriptor. The application must respond by calling sendResponse.

Parameters
[in]usConnIdConnection Identifier, created and return on connection event, when BTConnectionCallback_t is invoked.
[in]ulTransIdTransaction ID.
[in]pxBdaRemote device address.
[in]usAttrHandleHandle of the attribute.
[in]usOffsetIndex of read.

◆ BTRequestWriteCallback_t

typedef void(* BTRequestWriteCallback_t) (uint16_t usConnId, uint32_t ulTransId, BTBdaddr_t *pxBda, uint16_t usAttrHandle, uint16_t usOffset, size_t xLength, bool bNeedRsp, bool bIsPrep, uint8_t *pucValue)

Callback invoked on write event.

Callback invoked when a remote device has requested to write to a characteristic or descriptor.

Parameters
[in]usConnIdConnection Identifier, created and return on connection event, when BTConnectionCallback_t is invoked.
[in]ulTransIdTransaction ID.
[in]pxBdaRemote device address.
[in]usAttrHandleHandle of the attribute.
[in]usOffsetIndex of write.
[in]xLengthLength of pucValue to write.
[in]bNeedRspTrue if a response is needed.
[in]bIsPrepTrue if it is a prepare write command.
[in]pucValueData to write.

◆ BTRequestExecWriteCallback_t

typedef void(* BTRequestExecWriteCallback_t) (uint16_t usConnId, uint32_t ulTransId, BTBdaddr_t *pxBda, bool bExecWrite)

Callback invoked on execute write event.

Callback invoked when a remote device that has done prepare write is now executing the command.

Parameters
[in]usConnIdConnection Identifier, created and return on connection event, when BTConnectionCallback_t is invoked.
[in]ulTransIdTransaction ID.
[in]pxBdaRemote device address.
[in]bExecWriteTrue is the write order needs to be executed.

◆ BTResponseConfirmationCallback_t

typedef void(* BTResponseConfirmationCallback_t) (BTStatus_t xStatus, uint16_t usHandle)

Callback triggered in response to sendResponse if the remote device sends a confirmation.

Parameters
[in]xStatusreturns eBTStatusSuccess if operation succeeded.
[in]usHandleHandle of the attribute.

◆ BTIndicationSentCallback_t

typedef void(* BTIndicationSentCallback_t) (uint16_t usConnId, BTStatus_t xStatus)

Callback on confirmation device from the remote device to an indication. Or confirm a Notification as been sent.

Parameters
[in]usConnIdConnection Identifier, created and return on connection event, when BTConnectionCallback_t is invoked.
[in]xStatusreturns eBTStatusSuccess if operation succeeded.

◆ BTMtuChangedCallback_t

typedef void(* BTMtuChangedCallback_t) (uint16_t usConnId, uint16_t usMtu)

Callback invoked when the MTU for a given connection changes.

Parameters
[in]usConnIdConnection Identifier, created and return on connection event, when BTConnectionCallback_t is invoked.
[in]usMtuMTU size.

◆ BTWhiteListChangedCallback_t

typedef void(* BTWhiteListChangedCallback_t) (const BTBdaddr_t *pxBdAddr, bool bIsAdded)

Callback for notifying modification in white list.

Parameters
[in]pxBdAddrAddress of the Remote device.
[in]bIsAddedtrue if device added false if device not in white list