44 #define ATTS_SET_UUID_128 0x01 45 #define ATTS_SET_WRITE_CBACK 0x02 47 #define ATTS_SET_READ_CBACK 0x04 49 #define ATTS_SET_VARIABLE_LEN 0x08 50 #define ATTS_SET_ALLOW_OFFSET 0x10 51 #define ATTS_SET_CCC 0x20 53 #define ATTS_SET_ALLOW_SIGNED 0x40 54 #define ATTS_SET_REQ_SIGNED 0x80 63 #define ATTS_PERMIT_READ 0x01 64 #define ATTS_PERMIT_READ_AUTH 0x02 65 #define ATTS_PERMIT_READ_AUTHORIZ 0x04 66 #define ATTS_PERMIT_READ_ENC 0x08 67 #define ATTS_PERMIT_WRITE 0x10 68 #define ATTS_PERMIT_WRITE_AUTH 0x20 69 #define ATTS_PERMIT_WRITE_AUTHORIZ 0x40 70 #define ATTS_PERMIT_WRITE_ENC 0x80 82 #define ATTC_SET_UUID_128 0x01 83 #define ATTC_SET_REQUIRED 0x02 84 #define ATTC_SET_DESCRIPTOR 0x04 96 #define ATT_CBACK_START 0x02 122 #define ATT_CBACK_END ATT_MTU_UPDATE_IND 260 typedef struct attsGroup_tag
262 struct attsGroup_tag *pNext;
298 typedef struct attcDiscChar_tag
uint16_t AttsCccGet(dmConnId_t connId, uint8_t idx)
Get the value of a client characteristic configuration descriptor by its index. If not found...
#define ATT_CBACK_START
ATT callback event starting value.
void AttcReadLongReq(dmConnId_t connId, uint16_t handle, uint16_t offset, bool_t continuing)
Initiate an attribute protocol Read Long Request.
void AttcReadMultipleReq(dmConnId_t connId, uint8_t numHandles, uint16_t *pHandles)
Initiate an attribute protocol Read Multiple Request.
uint8_t dmConnId_t
Connection identifier.
Read group type response.
void AttsDynDeleteGroup(void *pSvcHandle)
Dynamically delete an ATT Service at runtime.
void AttcReadByGroupTypeReq(dmConnId_t connId, uint16_t startHandle, uint16_t endHandle, uint8_t uuidLen, uint8_t *pUuid, bool_t continuing)
Initiate an attribute protocol Read By Group Type Request.
uint8_t AttcDiscServiceCmpl(attcDiscCb_t *pCb, attEvt_t *pMsg)
This utility function processes a service discovery result. It should be called when an ATTC_FIND_BY_...
void AttcDiscCharStart(dmConnId_t connId, attcDiscCb_t *pCb)
This utility function starts characteristic and characteristic descriptor discovery for a service on ...
void AttsRemoveGroup(uint16_t startHandle)
Remove an attribute group from the attribute server.
uint32_t AttsGetSignCounter(dmConnId_t connId)
Get the current value peer's sign counter on this connection. This function is typically called from ...
void AttsAuthorRegister(attsAuthorCback_t cback)
Register an authorization callback with the attribute server.
uint8_t bool_t
Boolean data type.
void AttRegister(attCback_t cback)
Register a callback with ATT. This callback will be used for messages from both ATTC and ATTS...
void AttsSetSignCounter(dmConnId_t connId, uint32_t signCounter)
Set the peer's sign counter on this connection. This function is typically called from the ATT connec...
uint8_t(* attsWriteCback_t)(dmConnId_t connId, uint16_t handle, uint8_t operation, uint16_t offset, uint16_t len, uint8_t *pValue, attsAttr_t *pAttr)
Attribute group write callback.
void AttsCccRegister(uint8_t setLen, attsCccSet_t *pSet, attsCccCback_t cback)
Register the utility service for managing client characteristic configuration descriptors. This function is typically called once on system initialization.
uint8_t AttcDiscConfigStart(dmConnId_t connId, attcDiscCb_t *pCb)
This utility function starts characteristic configuration for characteristics on a peer device...
void AttsDynAddAttr(void *pSvcHandle, const uint8_t *pUuid, const uint8_t *pValue, uint16_t len, const uint16_t maxLen, uint8_t settings, uint8_t permissions)
Dynamically add an attribute to a dynamic ATT Services at runtime.
ATT client structure for characteristic and descriptor discovery.
void AttcSignedWriteCmd(dmConnId_t connId, uint16_t handle, uint32_t signCounter, uint16_t valueLen, uint8_t *pValue)
Initiate an attribute protocol signed Write Command.
void AttsCccClearTable(dmConnId_t connId)
Clear and deallocate the client characteristic configuration descriptor value table for a connection...
attCfg_t * pAttCfg
Configuration pointer.
ATT run-time configurable parameters.
void AttsDynInit(void)
Initialize the Dynamic ATT Service subsystem.
void(* attCback_t)(attEvt_t *pEvt)
ATT event callback type.
void AttcFindByTypeValueReq(dmConnId_t connId, uint16_t startHandle, uint16_t endHandle, uint16_t uuid16, uint16_t valueLen, uint8_t *pValue, bool_t continuing)
Initiate an attribute protocol Find By Type Value Request.
void AttcExecuteWriteReq(dmConnId_t connId, bool_t writeAll)
Initiate an attribute protocol Execute Write Request.
Handle value notification.
void AttsAddGroup(attsGroup_t *pGroup)
Add an attribute group to the attribute server.
void AttcInit(void)
Initialize ATT client.
void AttcWriteCmd(dmConnId_t connId, uint16_t handle, uint16_t valueLen, uint8_t *pValue)
Initiate an attribute protocol Write Command.
void(* attsCccCback_t)(attsCccEvt_t *pEvt)
ATTS client characteristic configuration callback.
void AttsSignInit(void)
Initialize ATT server for data signing.
void AttsInit(void)
Initialize ATT server.
void AttsHandleValueNtf(dmConnId_t connId, uint16_t handle, uint16_t valueLen, uint8_t *pValue)
Send an attribute protocol Handle Value Notification.
uint8_t AttcDiscCharCmpl(attcDiscCb_t *pCb, attEvt_t *pMsg)
This utility function processes a characteristic discovery result. It should be called when an ATTC_R...
uint8_t(* attsAuthorCback_t)(dmConnId_t connId, uint8_t permit, uint16_t handle)
ATTS authorization callback type.
void AttcSignInit(void)
Initialize ATT client for data signing.
Handle value confirmation.
void AttMsgFree(void *pMsg, uint8_t opcode)
Free an ATT message buffer allocated with AttMsgAlloc().
void AttcCancelReq(dmConnId_t connId)
Cancel an attribute protocol request in progress.
unsigned long uint32_t
Unsigned 32-bit value.
void AttcFindInfoReq(dmConnId_t connId, uint16_t startHandle, uint16_t endHandle, bool_t continuing)
Initiate an attribute protocol Find Information Request.
uint8_t AttcDiscConfigCmpl(dmConnId_t connId, attcDiscCb_t *pCb)
This utility function initiates the next characteristic configuration procedure. It should be called ...
uint16_t AttsCccEnabled(dmConnId_t connId, uint8_t idx)
Check if a client characteristic configuration descriptor is enabled and if the characteristic's secu...
uint8_t AttsGetAttr(uint16_t handle, uint16_t *pLen, uint8_t **pValue)
Get an attribute value in the attribute server.
ATTS client characteristic configuration callback structure.
void AttsHandleValueInd(dmConnId_t connId, uint16_t handle, uint16_t valueLen, uint8_t *pValue)
Send an attribute protocol Handle Value Indication.
void(* dmCback_t)(dmEvt_t *pDmEvt)
Callback type.
void AttsDynAddAttrConst(void *pSvcHandle, const uint8_t *pUuid, const uint8_t *pValue, const uint16_t len, uint8_t settings, uint8_t permissions)
Dynamically add an attribute with a constant value to a dynamic ATT Services at runtime.
Client characteristc configuration settings.
Find by type value response.
void * AttsDynCreateGroup(uint16_t startHandle, uint16_t endHandle)
Dynamically create an ATT Service at runtime.
ATT client discovery control block.
void AttcWriteReq(dmConnId_t connId, uint16_t handle, uint16_t valueLen, uint8_t *pValue)
Initiate an attribute protocol Write Request.
Device Manager subsystem API.
void AttsHandleValueIndZeroCpy(dmConnId_t connId, uint16_t handle, uint16_t valueLen, uint8_t *pValue)
Send an attribute protocol Handle Value Indication without copying the attribute value data...
void AttcMtuReq(dmConnId_t connId, uint16_t mtu)
For internal use only.
uint16_t AttGetMtu(dmConnId_t connId)
Get the attribute protocol MTU of a connection.
Client chracteristic configuration state change.
unsigned short uint16_t
Unsigned 16-bit value.
void AttsIndInit(void)
Initialize ATT server for indications/notifications.
uint8_t(* attsReadCback_t)(dmConnId_t connId, uint16_t handle, uint8_t operation, uint16_t offset, attsAttr_t *pAttr)
Attribute group read callback.
void * AttMsgAlloc(uint16_t len, uint8_t opcode)
Allocate an ATT message buffer to be sent with the ATT attribute protocol zero-copy APIs...
void AttcReadByTypeReq(dmConnId_t connId, uint16_t startHandle, uint16_t endHandle, uint8_t uuidLen, uint8_t *pUuid, bool_t continuing)
Initiate an attribute protocol Read By Type Request.
uint8_t AttcDiscConfigResume(dmConnId_t connId, attcDiscCb_t *pCb)
This utility function resumes the characteristic configuration procedure. It can be called when an AT...
uint8_t AttsSetAttr(uint16_t handle, uint16_t valueLen, uint8_t *pValue)
Set an attribute value in the attribute server.
void AttcPrepareWriteReq(dmConnId_t connId, uint16_t handle, uint16_t offset, uint16_t valueLen, uint8_t *pValue, bool_t valueByRef, bool_t continuing)
Initiate an attribute protocol Prepare Write Request.
uint8_t AttsGetCccTableLen(void)
Get number of CCC entries in table.
void AttsDynRegister(void *pSvcHandle, attsReadCback_t readCback, attsWriteCback_t writeCback)
Register callback functions for a dynamic ATT Service at runtime.
Attribute protocol constants and definitions from the Bluetooth specification.
Attribute protocol UUIDs from the Bluetooth specification.
void AttsSetCsrk(dmConnId_t connId, uint8_t *pCsrk)
Set the peer's data signing key on this connection. This function is typically called from the ATT co...
uint32_t wsfTimerTicks_t
Timer ticks data type.
Read by type value response.
ATT client structure for characteristic and descriptor configuration.
Common message structure passed to event handler.
void AttsCccSet(dmConnId_t connId, uint8_t idx, uint16_t value)
Set the value of a client characteristic configuration descriptor by its index.
void AttcReadReq(dmConnId_t connId, uint16_t handle)
Initiate an attribute protocol Read Request.
unsigned char uint8_t
Unsigned 8-bit value.
void AttConnRegister(dmCback_t cback)
Register a connection callback with ATT. The callback is typically used to manage the attribute serve...
void AttsHandleValueNtfZeroCpy(dmConnId_t connId, uint16_t handle, uint16_t valueLen, uint8_t *pValue)
Send an attribute protocol Handle Value Notification without copying the attribute value data...
void AttsErrorTest(uint8_t status)
For testing purposes only.
Find information response.
void AttcDiscService(dmConnId_t connId, attcDiscCb_t *pCb, uint8_t uuidLen, uint8_t *pUuid)
This utility function discovers the given service on a peer device. Function AttcFindByTypeValueReq()...
void AttsCccInitTable(dmConnId_t connId, uint16_t *pCccTbl)
Initialize the client characteristic configuration descriptor value table for a connection. The table is initialized with the values from pCccTbl. If pCccTbl is NULL the table will be initialized to zero.