AIROC™ BTSDK v4.9 - Documentation | ||||
This file provides definitions and macros for generating GATT database. More...
Functions | |
void | legattdb_init (void) |
GATT DB Initi. More... | |
void | legattdb_SetDb (UINT8 *ptr, UINT16 size) |
INT32 | legattdb_readBlob (UINT16 handle, INT32 offset, LEATT_INTERNAL_PDU *pdu) |
INT32 | legattdb_readMultipleReq (UINT8 *attrHandleList, INT32 numAttrHandles, LEATT_INTERNAL_PDU *pdu) |
INT32 | legattdb_findInfo (UINT16 startHandle, UINT16 endHandle, LEATT_INTERNAL_PDU *outPdu) |
INT32 | legattdb_readByAttrGroupTypeUUID16 (UINT16 startHandle, UINT16 endHandle, UINT16 uuid, LEATT_INTERNAL_PDU *outPdu) |
void | legattdb_readByGroupTypeUUID128 (UINT16 startHandle, UINT16 endHandle, UINT8 *uuid, LEATT_INTERNAL_PDU *outPdu) |
INT32 | legattdb_findByTypeValue (UINT16 startHandle, UINT16 endHandle, UINT16 uuid, UINT8 *attrValue, INT32 attrValueLen, LEATT_INTERNAL_PDU *outPdu) |
INT32 | legattdb_readByType (UINT16 startHandle, UINT16 endHandle, INT32 uuidLen, UINT8 *uuid, LEATT_INTERNAL_PDU *outPdu) |
INT32 | legattdb_readHandle (UINT16 handle, LEATT_INTERNAL_PDU *pdu, UINT32 permFlag) |
INT32 | legattdb_writeHandle (UINT16 handle, UINT16 offset, UINT8 *attrValue, INT32 attrValLen, UINT32 permFlag) |
INT32 | legattdb_prepareWriteReq (LEATT_PDU_PREPARE_WRITE_REQ_HDR *hdr, INT32 attrValLen) |
INT32 | legattdb_executeWriteReq (UINT8 flag) |
void | legattdb_dumpDb (void) |
UINT8 | legattdb_checkNotificationDb (void) |
LEGATTDB_ENTRY_HDR * | legattdb_nextEntry (LEGATTDB_ENTRY_HDR *p) |
Get Next database entry. More... | |
UINT16 | legattdb_getHandle (LEGATTDB_ENTRY_HDR *p) |
Get entry handle. More... | |
UINT16 | legattdb_getAttrUUID16 (LEGATTDB_ENTRY_HDR *p) |
Get entry handle. More... | |
INT32 | legattdb_getAttrUUID (LEGATTDB_ENTRY_HDR *h, UINT8 *buf) |
Copy UUID of an entry to a buffer. More... | |
UINT16 | legattdb_getAttrValueUUID16 (LEGATTDB_ENTRY_HDR *p) |
Get value UUID. More... | |
UINT8 * | legattdb_getAttrValue (LEGATTDB_ENTRY_HDR *p) |
Get Attribute Value. More... | |
INT32 | legattdb_getAttrValueLen (LEGATTDB_ENTRY_HDR *p) |
Get Attribute Value Length. More... | |
void | legattdb_setAttrValueLen (LEGATTDB_ENTRY_HDR *p, INT32 len) |
Set Attribute Value Length. More... | |
INT32 | legattdb_getMaxWritableAttrValueLen (LEGATTDB_ENTRY_HDR *p) |
Get Maxmimut Writable Attribute Value Length. More... | |
INT32 | legattdb_writeAttrValue (LEGATTDB_ENTRY_HDR *p, UINT16 offset, UINT8 *val, INT32 len, UINT32 permFlag) |
Update Value of the Attribute. More... | |
INT32 | legattdb_getPerm (LEGATTDB_ENTRY_HDR *p) |
Get Attribute Permissions. More... | |
UINT8 * | legattdb_getAttrPtr (LEGATTDB_ENTRY_HDR *p) |
Get Pointer to Attribute. More... | |
INT32 | legattdb_uuidIsTheSame (INT32 uuidLen_1, UINT8 *uuidPtr_1, INT32 uuidLen_2, UINT8 *uuidPtr_2) |
Compare UUIDs. More... | |
UINT32 | legattdb_checkPermission (INT32 permToCheck, UINT32 perm, LEGATTDB_ENTRY_HDR *p) |
void | legattdb_connDown () |
void | legattdb_connUp () |
INT32 | legattdb_regWriteHandleCb (LEGATTDB_WRITE_CB cb) |
Register write callback. More... | |
void | legattdb_deRegWriteHandleCb (LEGATTDB_WRITE_CB cb) |
Register write callback. More... | |
INT32 | legattdb_dispatchWriteCb (LEGATTDB_ENTRY_HDR *p) |
UINT32 | legattdb_checkEncAuthRequirement () |
UINT16 | legattdb_findCharacteristicDescriptor (UINT16 char_handle, UINT16 descriptor_uuid) |
Finds Characteristic Descriptor. More... | |
This file provides definitions and macros for generating GATT database.
void legattdb_deRegWriteHandleCb | ( | LEGATTDB_WRITE_CB | cb | ) |
Register write callback.
This function de-register a callback set by legattdb_regWriteHandleCb
cb | Pointer to the application callback. |
UINT16 legattdb_findCharacteristicDescriptor | ( | UINT16 | char_handle, |
UINT16 | descriptor_uuid | ||
) |
Finds Characteristic Descriptor.
This function finds descriptor with specified UUID which belongs to the specific characteristic
cb | Pointer to the application callback. |
UINT8* legattdb_getAttrPtr | ( | LEGATTDB_ENTRY_HDR * | p | ) |
Get Pointer to Attribute.
This function will return a pointer to the actual attribute skipping over the header.
p | Pointer to the entry. |
INT32 legattdb_getAttrUUID | ( | LEGATTDB_ENTRY_HDR * | h, |
UINT8 * | buf | ||
) |
Copy UUID of an entry to a buffer.
This function will copy UUID of the entry to a buf
p | Pointer to the current entry. |
UINT16 legattdb_getAttrUUID16 | ( | LEGATTDB_ENTRY_HDR * | p | ) |
Get entry handle.
This will return a attribute UUID in the entry. If the attribute uuid is not 2 bytes the function will return invalid uuid 0x00.
p | Pointer to the current entry. |
UINT8* legattdb_getAttrValue | ( | LEGATTDB_ENTRY_HDR * | p | ) |
Get Attribute Value.
This function will return a pointer to the attribute value.
p | Pointer to the current entry. |
INT32 legattdb_getAttrValueLen | ( | LEGATTDB_ENTRY_HDR * | p | ) |
Get Attribute Value Length.
This function returns length of the attribute value.
p | Pointer to the current entry. |
UINT16 legattdb_getAttrValueUUID16 | ( | LEGATTDB_ENTRY_HDR * | p | ) |
Get value UUID.
This is a convenient function. It returns the attribute value in the form of UUID16. Caller need to be sure this is a UUID16. Or else it...
p | Pointer to the current entry. |
UINT16 legattdb_getHandle | ( | LEGATTDB_ENTRY_HDR * | p | ) |
Get entry handle.
This function returns the attribute handle of this entry.
p | Pointer to the current entry. |
INT32 legattdb_getMaxWritableAttrValueLen | ( | LEGATTDB_ENTRY_HDR * | p | ) |
Get Maxmimut Writable Attribute Value Length.
This function return the maximum writable attribute length. If the attribute is not writable, it will return 0.
p | Pointer to the current entry. |
INT32 legattdb_getPerm | ( | LEGATTDB_ENTRY_HDR * | p | ) |
Get Attribute Permissions.
This function will return permission byte of the attribute.
p | Pointer to the entry. |
void legattdb_init | ( | void | ) |
GATT DB Initi.
This function should be called to initialize the variable.
LEGATTDB_ENTRY_HDR* legattdb_nextEntry | ( | LEGATTDB_ENTRY_HDR * | p | ) |
Get Next database entry.
This function will return a pointer to next entry.
p | Pointer to the current entry |
INT32 legattdb_regWriteHandleCb | ( | LEGATTDB_WRITE_CB | cb | ) |
Register write callback.
This function register a callback when data is written
cb | Pointer to the application callback. |
void legattdb_setAttrValueLen | ( | LEGATTDB_ENTRY_HDR * | p, |
INT32 | len | ||
) |
Set Attribute Value Length.
This function change the length of current attriute length.
p | Pointer to the current entry. |
len | New length. |
INT32 legattdb_uuidIsTheSame | ( | INT32 | uuidLen_1, |
UINT8 * | uuidPtr_1, | ||
INT32 | uuidLen_2, | ||
UINT8 * | uuidPtr_2 | ||
) |
Compare UUIDs.
This function will compare the UUID of _1 and _2 . It return TRUE if they are the same. if the size of the two uuid are not the same, they will be converted to 128 bit uuid for comparison.
uuidLen_1 | Length of the first UUID to compare. |
uuidPtr_1 | Pointer to the first UUID to compare. |
uuidLen_2 | Length of the second UUID to compare. |
uuidPtr_2 | Pointer to the second UUID to compare. |
INT32 legattdb_writeAttrValue | ( | LEGATTDB_ENTRY_HDR * | p, |
UINT16 | offset, | ||
UINT8 * | val, | ||
INT32 | len, | ||
UINT32 | permFlag | ||
) |
Update Value of the Attribute.
This function will update the writable attribute.
p | Pointer to the current entry. |
offset | Offset at which data need to be written. |
Pointer | to the data to write. |
len | Length of the data to write. |
pwermFlag | Attribute permissions. |