Other Parts Discussed in Thread: BLE-STACK
Hi,
I'm currently trying to implement a long characteristic in the BLE-Stack and have some questions about it.
I generated a new service via the code generator available form the example description ()
I did not find any possibility to set a certain length of a characteristic in the Attribute Table (gattAttribute_t largeData_AttrTbl[] = ... )
So as I found out BTool, issues as long read commands on a certain characteristic as the packet size is same size as MTU in the readCallback function.
bStatus_t largeData_ReadAttrCB( uint16_t connHandle, gattAttribute_t *pAttr,
uint8_t *pValue, uint16_t *pLen, uint16_t offset,
uint16_t maxLen, uint8_t method )
I did not find any #defines which I could use with parameter "method". However I saw in the first run it is given a 0x10 there (is this --> #define ATT_READ_BY_GRP_TYPE_REQ 0x10 <-- the correct define?
On a read access of BTool to this characteristic an issue is reported. Is this the usual way, which happens on reading a long characteristic or what do I have to adjust to issue the correct command immediately (so BTool recognizes the characteristic correctly)? (--> GATT_ReadLongCharValue)
-------------------------------------------------------------------- [57] : <Info> - 10:32:14.618 GATT_ReadCharValue Response Issue AttReadRsp Length Exceeds The Max Safe Length Of 21 AttReadRsp Will Be Ignored A New GATT_ReadLongCharValue Is Being Queued Up For Tx -------------------------------------------------------------------- [58] : <Rx> - 10:32:14.618 -Type : 0x04 (Event) -EventCode : 0x00FF (HCI_LE_ExtEvent) -Data Length : 0x1C (28) bytes(s) Event : 0x050B (1291) (ATT_ReadRsp) Status : 0x00 (0) (SUCCESS) ConnHandle : 0x0000 (0) PduLen : 0x16 (22) Value : 80:81:82:83:84:85:86:87:88:89:8A:8B:8C:8D:8E:8F: 90:91:92:93:94:95 Dump(Rx): 0000:04 FF 1C 0B 05 00 00 00 16 80 81 82 83 84 85 86 ................ 0010:87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 ...............
--------------------------------------------------------------------
[59] : <Tx> - 10:32:14.618
-Type : 0x01 (Command)
-OpCode : 0xFD8C (GATT_ReadLongCharValue)
-Data Length : 0x06 (6) byte(s)
ConnHandle : 0x0000 (0)
Handle : 0x002F (47)
Offset : 0x0000 (0)
Dump(Tx):
0000:01 8C FD 06 00 00 2F 00 00 00 ....../...
--------------------------------------------------------------------
[60] : <Rx> - 10:32:14.665
-Type : 0x04 (Event)
-EventCode : 0x00FF (HCI_LE_ExtEvent)
-Data Length : 0x06 (6) bytes(s)
Event : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
Status : 0x00 (0) (SUCCESS)
OpCode : 0xFD8C (GATT_ReadLongCharValue)
DataLength : 0x00 (0)
Dump(Rx):
0000:04 FF 06 7F 06 00 8C FD 00 .........
--------------------------------------------------------------------
[61] : <Rx> - 10:32:14.816
-Type : 0x04 (Event)
-EventCode : 0x00FF (HCI_LE_ExtEvent)
-Data Length : 0x18 (24) bytes(s)
Event : 0x050D (1293) (ATT_ReadBlobRsp)
Status : 0x00 (0) (SUCCESS)
ConnHandle : 0x0000 (0)
PduLen : 0x12 (18)
Value : 00:01:02:03:04:05:06:07:08:09:0A:0B:0C:0D:0E:0F:
10:11
Dump(Rx):
0000:04 FF 18 0D 05 00 00 00 12 00 01 02 03 04 05 06 ................
0010:07 08 09 0A 0B 0C 0D 0E 0F 10 11
Why is there only one Command (0x01 value) and the others are Type Event (0x04) e.g. HCI_LE_ExtEvent? (What for is the event between the command and the data?)
I would be happy if you can answer my question directly or refere to a bluetooth specification where certain things are explained regarding message flow or command issuing.
best regards
Andreas