I have the following characteristic defined:
BT_GATT_CHARACTERISTIC(BT_UUID_WT_SERIVCE_TX,
BT_GATT_CHRC_NOTIFY | BT_GATT_CHRC_READ,
BT_GATT_PERM_READ,
wt_read_tx_str, NULL, dataPacket),
BT_GATT_CCC(on_cccd_changed,
BT_GATT_PERM_READ | BT_GATT_PERM_WRITE),
So I can click on either the read or notify to get data.
The dataPacket is basically a c string of 755 bytes (756 null terminated).
When I do a read from the client, the above callback wt_read_tx_str starts getting called. It looks like it is sending 22 bytes at a time changing the offset. I have debug info and can see it count up to 594 on the offset, and then it just stops getting called. When that happens 594 bytes appear on the client all at once (which is what I want).
The issue is that my buffer has 755 bytes in it. Does anyone know why it stops at 594 instead of sending all 755 bytes? I don't get any errors. Am I running up against some stack resource? I am not sure where the callback get's called so I don't know what to look for as to why it would suddenly stop after executing the callback about 27 times.
Here is the beginning and ending of my debug info:
00> Entered connected callback
00>
00> [00:00:15.596,191] <inf> peripheral_uart: Connected to 4F:14:DC:8B:B1:3E (random)
00> [00:00:24.853,057] <inf> wt_service: wt_read_tx_str cb: package offset: 0 size: 755
00> [00:00:24.853,240] <inf> wt_service: wt_read_tx_str cb: returned 22 after call to bt_gatt_attr_read
00> [00:00:24.950,622] <inf> wt_service: wt_read_tx_str cb: package offset: 22 size: 755
00> [00:00:24.950,805] <inf> wt_service: wt_read_tx_str cb: returned 22 after call to bt_gatt_attr_read
00> [00:00:25.048,095] <inf> wt_service: wt_read_tx_str cb: package offset: 44 size: 755
00> [00:00:25.048,278] <inf> wt_service: wt_read_tx_str cb: returned 22 after call to bt_gatt_attr_read
00>
00> [00:00:15.596,191] <inf> peripheral_uart: Connected to 4F:14:DC:8B:B1:3E (random)
00> [00:00:24.853,057] <inf> wt_service: wt_read_tx_str cb: package offset: 0 size: 755
00> [00:00:24.853,240] <inf> wt_service: wt_read_tx_str cb: returned 22 after call to bt_gatt_attr_read
00> [00:00:24.950,622] <inf> wt_service: wt_read_tx_str cb: package offset: 22 size: 755
00> [00:00:24.950,805] <inf> wt_service: wt_read_tx_str cb: returned 22 after call to bt_gatt_attr_read
00> [00:00:25.048,095] <inf> wt_service: wt_read_tx_str cb: package offset: 44 size: 755
00> [00:00:25.048,278] <inf> wt_service: wt_read_tx_str cb: returned 22 after call to bt_gatt_attr_read
................
00> [00:00:27.485,229] <inf> wt_service: wt_read_tx_str cb: package offset: 572 size: 755
00> [00:00:27.485,412] <inf> wt_service: wt_read_tx_str cb: returned 22 after call to bt_gatt_attr_read
00> [00:00:27.582,733] <inf> wt_service: wt_read_tx_str cb: package offset: 594 size: 755
00> [00:00:27.582,916] <inf> wt_service: wt_read_tx_str cb: returned 22 after call to bt_gatt_attr_read
00> [00:00:27.485,412] <inf> wt_service: wt_read_tx_str cb: returned 22 after call to bt_gatt_attr_read
00> [00:00:27.582,733] <inf> wt_service: wt_read_tx_str cb: package offset: 594 size: 755
00> [00:00:27.582,916] <inf> wt_service: wt_read_tx_str cb: returned 22 after call to bt_gatt_attr_read
Thanks in advance!
h.