I am trying to use a Boron (as central device) to read a characteristic on another BLE device. This characteristic contains only a single array of 128 bytes. When I read the data from that characteristic:
Only the first 20 bytes are returned. Any ideas as to how I retrieve the remaining 108 bytes from this characteristic? I am able to read it just fine from smartphone applications such as nrfConnect and Lightblue without any problems.
The device you are connecting to must support BLE v4.2 or higher to retrieve characteristics that are larger than 20 bytes.
Next you need to increase the MTU Particle will use to transmit characteristics. I am running Particle OS 5.4.1 and am using the following command to do that. If I recall, this command may have been different prior to v4.0.0.
// Set our maximum MTU
hal_ble_gatt_server_set_desired_att_mtu(sizeof(characteristic) + 4, nullptr);
Thanks @happicow . In my scenario the device being connected to is an iPhone 12. The Particle is isn't transmitting characteristics, its reading what the iPhone is transmitting. The Particle is a Boron 404X running DeviceOS 5.7.
It is most peculiar, and definitely truncated at 20 characters. I'll continue to look at the MTU.
Just an update here - I really need to cut my losses and move on so I chose a different identifier to send in the characteristic. However I do want to circle back at some point and continuing troubleshooting because either a) everyone has this issue or b) someone has already solved it.