I am implementing a BLE device which stores some log data based on sensor data and a iOS app which acts a Central to access the data.
I know how to read GATT characteristics data, but I wonder how to read a bunch of from the device. Is there standardized way to do this?
My naive approach would be the following:
- Create a custom readonly-characteristic (A) which contains the number of log records
- Create a custom writeonly-characteristic (B) which contains the index of a record
- Create a custom readonly-characteristic (C) which contains the data of the log record with the index of (B).
- Create a custom writeonly-characteristic (D) to delete all stored records.
To get the log data I would have to read the number of records (A), then do a loop and write an index to (B) and read the data (C).
Is this the way to go or is there a better approach?
My log data records would contain a timestamp and a 8 bit value with sensor data.