Suppose we have a BLE GATT server which can be triggered to execute a search. The search yields a list (e.g. of device names). The list can be (way) longer than 512 bytes, so the result cannot be stored in a single characteristic.
What is the intended way to expose such a list via GATT? I can find no documentation about this. Is there any documentation in the BLE specification or in related documents discussing this which I overlooked?
None of the (standard) examples or specifications I can find (e.g. on https://www.bluetooth.com/specifications/gatt/) contain a list.
I can think of the following strategies:
- Expose a service which contains the result with n characteristics (dynamic, one per list entry). The service is created and exposed dynamically as a result of the search operation. The service will be removed after the client confirms reading the data or after a certain time.
- Expose a service statically which contains the result with n characteristics (static, e.g 100). The service also contains a characteristic which contains the number of list entries).
- Expose a service statically which contains a "value" characteristic which offers the current value of the list. The service also contains a "next" characteristic which updates the "value" characteristic with the next value on write.
- Expose a service statically which contains a "value" characteristic. The client has to subscribe to this characteristic for notifications/indications. Write one list value to the characteristic after the other. The client has to combine the notifications to a list.
Are one or more of the strategies the intended way to go? Or is there a different strategy that should be applied?