Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1
92
Ver.1.0.0
3.4.2 Attribute and ATT Table
To implement GATT Service on Slave, an Attribute Table is defined in 5316 BLE SDK
and it consists of multiple basic Attributes. Attribute definition is shown as below.
typedef struct
attribute
{
u16
attNum
;
u8
perm
;
u8
uuidLen
;
u32
attrLen
;
//4 bytes aligned
u8
*
uuid
;
u8
*
pAttrValue
;
att_readwrite_callback_t
w
;
att_readwrite_callback_t
r
;
}
attribute_t
;
Attribute Table code is available in
“app_att.c”, as shown below:
Figure 3-30 5316 BLE SDK Attribute Table
Please note that t
he key word “const” is added to Attribute Table definition:
const attribute_t my_Attributes[] = { ... };
By adding the “const”, the compiler will store the array data to Flash rather than RAM,
while all contents of the Attribute Table defined in Flash are read only and not modifiable.
3.4.2.1 attNum
The “attNum” supports two functions.