COMMON IO-BLE v1.0.0
Hardware abstraction layer for Bluetooth
 
Loading...
Searching...
No Matches
bt_hal_gatt_server.h File Reference

BT GATT Server provides the interfaces to use Bluetooth GATT server feature. More...

Go to the source code of this file.

Data Structures

struct  BTGattValue_t
 GATT value type used in response to remote read/Write requests. More...
 
union  BTGattResponse_t
 GATT response to read and write. More...
 
struct  BTGattServerCallbacks_t
 Callback structure for GATT server. More...
 
struct  BTGattServerInterface_t
 Represents the standard 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.
 

Enumerations

enum  BTRspErrorStatus_t {
  eBTRspErrorNone = 0 , eBTRspErrorNo_mitm = 1 , eBTRspErrorMitm = 2 , eBTRspErrorSignedNoMitm = 3 ,
  eBTRspErrorSignedMitm = 4
}
 Error status sent inside response to a read or write from the client. More...
 

Detailed Description

BT GATT Server provides the interfaces to use Bluetooth GATT server feature.

Before calling any GATT server function, the Generic Access Profile needs to be initialized (see bt_hal_manager.h and bt_hal_manager_adapter*.h). bt_hal_manager.h give the starting point. After GAP has been initialized, the functions need to be called in that order:

  1. pxRegisterServer: Need to be called first to get the server Interface
  2. pxGattServerInit: Provided callbacks
  3. pxAddService: Create memory space for a service
  4. pxAddCharacteristic: Then all calls to pxAddDescriptor will add the descriptor to that characteristic
  5. pxStartService: Complete service create. Another service can be create afterward.