Improve Server API for transferring sensor data
- Specify format as JSON, TSV or CSV: http://localhost/api/sensors?id=0&format=tsv
- Default is JSON
- Currently lower case; make case insensitive?
- Specify number of points (most recent) to transfer: http://localhost/api/sensors?id=0&points=all
- Default is SENSOR_QUERYBUFSIZ (10)
- "all" - Will transfer *all* points
- Currently incompatable with the time seeking options (TODO: Make compatable?)
- Specify time range to return data points: http://localhost/api/sensors?id=0&start_time=5&end_time=6
- Default behaviour is to just return most recent X points; see above
- Currently no options for relative (eg: last 5s) time arguments (TODO: Include relative times?)\
Consider:
- Remove critical sections by using one FILE* for writing and one for reading
- A critical section is needed around every call to fseek, because the writing thread may write suddenly to the wrong position
- Will having 2 FILE* mean file can be written and read independently?
- Need to be sure that this is actually thread safe, otherwise it is more work for no reward
- Need to simplify Sensor_Handler
- Added some helper functions, but probably need more
- Need to do some testing of this API in a test GUI
UCC git Repository :: git.ucc.asn.au