Jeremy Tan [Thu, 12 Sep 2013 14:14:08 +0000 (22:14 +0800)]
Revert change made to timestamp placing in JSON responses
Jeremy Tan [Thu, 12 Sep 2013 14:06:26 +0000 (22:06 +0800)]
Add request parsing helper, add TIMEVAL_* macros, move timestamps to identify module
Jeremy Tan [Mon, 9 Sep 2013 06:32:39 +0000 (14:32 +0800)]
Merge branch 'master' of https://github.com/szmoore/MCTX3420.git
Conflicts:
server/sensor.c
Sam Moore [Mon, 9 Sep 2013 04:45:45 +0000 (12:45 +0800)]
Add relative times, allow "points" param to work with "start_time"
Eg: To get a single point at a given time: http://localhost/api/sensors?id=0&start_time=5&points=1
The binary search means it will either get the closest point before or after the specified time.
Should probably make it so that FindTime will always get the same index given the same input.
Otherwise problems might arise.
Need some more argument checking?
Sam Moore [Mon, 9 Sep 2013 03:22:55 +0000 (11:22 +0800)]
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
Sam Moore [Mon, 9 Sep 2013 01:34:41 +0000 (18:34 -0700)]
Merge pull request #30 from Callum-/master
safety check
Sam Moore [Mon, 9 Sep 2013 01:34:02 +0000 (18:34 -0700)]
Merge pull request #28 from justinjessada/master
Added sensors, actuators, PWM code
Sam Moore [Sun, 8 Sep 2013 17:00:07 +0000 (01:00 +0800)]
Automatic commit of irc logs
Callum [Sun, 8 Sep 2013 11:45:06 +0000 (19:45 +0800)]
Simple safety check
Callum [Sun, 8 Sep 2013 11:43:41 +0000 (19:43 +0800)]
Added safety check mechanism (needs some work)
Callum [Sun, 8 Sep 2013 09:38:50 +0000 (02:38 -0700)]
Merge pull request #29 from Callum-/master
fixed memory leaks
Callum [Sun, 8 Sep 2013 09:36:43 +0000 (17:36 +0800)]
Fixed memory leaks
Callum [Sun, 8 Sep 2013 09:33:53 +0000 (17:33 +0800)]
Fixed memory leaks
Sam Moore [Sat, 7 Sep 2013 17:00:07 +0000 (01:00 +0800)]
Automatic commit of irc logs
Jeremy Tan [Sat, 7 Sep 2013 13:52:29 +0000 (21:52 +0800)]
Add experimental support for querying a sensor an arbitrary range of points
Justin Kruger [Sat, 7 Sep 2013 12:03:57 +0000 (20:03 +0800)]
Add sensors, actuators, PWM code
Kept in separate files currently, can test and write proper function
once Beaglebone arrives
Sam Moore [Fri, 6 Sep 2013 17:00:08 +0000 (01:00 +0800)]
Automatic commit of irc logs
Jeremy Tan [Fri, 6 Sep 2013 12:54:45 +0000 (20:54 +0800)]
Update unit tests
Jeremy Tan [Fri, 6 Sep 2013 12:09:55 +0000 (05:09 -0700)]
Merge pull request #27 from jtanx/master
Add further identification methods + some bugfixes
Jeremy Tan [Fri, 6 Sep 2013 12:01:02 +0000 (20:01 +0800)]
Revert change to dump loop condition
Jeremy Tan [Fri, 6 Sep 2013 11:40:47 +0000 (19:40 +0800)]
Add API version and change FCGI_RejectJSON
FCGI_RejectJSON now requires a description message.
Jeremy Tan [Fri, 6 Sep 2013 03:02:40 +0000 (11:02 +0800)]
Fix g_sensor_names (enum out of order) and add identification
Sam Moore [Thu, 5 Sep 2013 17:00:08 +0000 (01:00 +0800)]
Automatic commit of irc logs
Jeremy Tan [Thu, 5 Sep 2013 13:25:13 +0000 (06:25 -0700)]
Merge pull request #26 from jtanx/master
Fix segfault & sensors bounds check + some documentation refactoring + work on unit tests
Jeremy Tan [Thu, 5 Sep 2013 13:21:46 +0000 (21:21 +0800)]
Nicer version...
Jeremy Tan [Thu, 5 Sep 2013 13:18:38 +0000 (21:18 +0800)]
Merge branch 'master' of https://github.com/szmoore/MCTX3420.git
Jeremy Tan [Thu, 5 Sep 2013 13:18:32 +0000 (21:18 +0800)]
Change @purpose to @brief (Doxygen warning) and work on unit tests
Sam Moore [Wed, 4 Sep 2013 17:00:06 +0000 (01:00 +0800)]
Automatic commit of irc logs
Jeremy Tan [Wed, 4 Sep 2013 12:05:08 +0000 (20:05 +0800)]
Merge branch 'master' of https://github.com/szmoore/MCTX3420.git
Jeremy Tan [Wed, 4 Sep 2013 12:04:41 +0000 (20:04 +0800)]
Fix segfault and bounds checking on sensor queries
Sam Moore [Tue, 3 Sep 2013 17:00:08 +0000 (01:00 +0800)]
Automatic commit of irc logs
Sam Moore [Mon, 2 Sep 2013 17:00:06 +0000 (01:00 +0800)]
Automatic commit of irc logs
Sam Moore [Mon, 2 Sep 2013 11:51:40 +0000 (19:51 +0800)]
Add control to GUI
Jeremy Tan [Mon, 2 Sep 2013 05:18:21 +0000 (13:18 +0800)]
Merge branch 'master' of https://github.com/szmoore/MCTX3420.git
Jeremy Tan [Mon, 2 Sep 2013 05:17:56 +0000 (13:17 +0800)]
Add log message for any rejected requests
Jeremy Tan [Mon, 2 Sep 2013 03:24:27 +0000 (20:24 -0700)]
Merge pull request #25 from jtanx/master
Update makefile
Sam Moore [Mon, 2 Sep 2013 11:15:16 +0000 (19:15 +0800)]
Create web directory to put web stuff in
Jeremy Tan [Mon, 2 Sep 2013 03:22:52 +0000 (11:22 +0800)]
Merge branch 'master' of https://github.com/szmoore/MCTX3420.git
Jeremy Tan [Mon, 2 Sep 2013 03:22:34 +0000 (11:22 +0800)]
Fix makefile
Jeremy Tan [Mon, 2 Sep 2013 02:54:02 +0000 (19:54 -0700)]
Merge pull request #24 from jtanx/master
Add actuators code
Jeremy Tan [Mon, 2 Sep 2013 00:58:04 +0000 (08:58 +0800)]
Fix linkage issues
Jeremy Tan [Mon, 2 Sep 2013 00:45:52 +0000 (08:45 +0800)]
Merge branch 'master' of https://github.com/szmoore/MCTX3420.git
Jeremy Tan [Mon, 2 Sep 2013 00:45:28 +0000 (08:45 +0800)]
Update unit tests.
Todo: Fix unit tests for access control
Sam Moore [Sun, 1 Sep 2013 17:00:06 +0000 (01:00 +0800)]
Automatic commit of irc logs
Sam Moore [Mon, 2 Sep 2013 00:27:15 +0000 (08:27 +0800)]
Add basic jQuery & flot GUI
Needs a lot of work, but at least it exists.
Sam Moore [Sun, 1 Sep 2013 16:01:32 +0000 (09:01 -0700)]
Merge pull request #23 from Callum-/master
stream
Callum [Sun, 1 Sep 2013 09:55:55 +0000 (17:55 +0800)]
Merge remote-tracking branch 'upstream/master'
Callum [Sun, 1 Sep 2013 09:53:40 +0000 (17:53 +0800)]
Simple streaming functionality
Sam Moore [Sat, 31 Aug 2013 17:00:06 +0000 (01:00 +0800)]
Automatic commit of irc logs
Sam Moore [Fri, 30 Aug 2013 17:00:07 +0000 (01:00 +0800)]
Automatic commit of irc logs
Jeremy Tan [Fri, 30 Aug 2013 10:20:35 +0000 (18:20 +0800)]
Change FCGI_Authorize* to FCGI_*Control. Add actuator test code.
Jeremy Tan [Fri, 30 Aug 2013 10:18:30 +0000 (18:18 +0800)]
Merge branch 'master' of https://github.com/szmoore/MCTX3420.git
Sam Moore [Thu, 29 Aug 2013 17:00:10 +0000 (01:00 +0800)]
Automatic commit of irc logs
Jeremy Tan [Thu, 29 Aug 2013 08:13:30 +0000 (16:13 +0800)]
(Restructure) Move controls to separate file.
This should be where actuators stuff goes.
Jeremy Tan [Thu, 29 Aug 2013 01:35:29 +0000 (09:35 +0800)]
Merge branch 'master' of https://github.com/szmoore/MCTX3420.git
Conflicts:
irc/log
Jeremy Tan [Thu, 29 Aug 2013 01:34:59 +0000 (09:34 +0800)]
Merge branch 'master' of https://github.com/jtanx/MCTX3420.git
Conflicts:
testing/qunit/unit-tests.js
Jeremy Tan [Thu, 29 Aug 2013 01:32:35 +0000 (09:32 +0800)]
Switch back to HTTP status codes for fastcgi + update unit tests
Jeremy Tan [Thu, 29 Aug 2013 01:28:44 +0000 (09:28 +0800)]
Switch back to HTTP status codes for fastcgi + update unit tests
Sam Moore [Wed, 28 Aug 2013 17:00:05 +0000 (01:00 +0800)]
Automatic commit of irc logs
Sam Moore [Tue, 27 Aug 2013 17:00:10 +0000 (01:00 +0800)]
Automatic commit of irc logs
Jeremy Tan [Wed, 28 Aug 2013 09:35:02 +0000 (17:35 +0800)]
Begin unit tests
Sam Moore [Tue, 27 Aug 2013 17:00:10 +0000 (01:00 +0800)]
Automatic commit of irc logs
Jeremy Tan [Tue, 27 Aug 2013 13:04:43 +0000 (21:04 +0800)]
Merge branch 'master' of https://github.com/szmoore/MCTX3420.git
Jeremy Tan [Tue, 27 Aug 2013 13:03:30 +0000 (21:03 +0800)]
Add extern for JSONBool to header
Jeremy Tan [Tue, 27 Aug 2013 13:01:42 +0000 (06:01 -0700)]
Merge pull request #21 from jtanx/master
Add JSON bool function
Jeremy Tan [Tue, 27 Aug 2013 13:00:30 +0000 (21:00 +0800)]
Add JSON bool function
Sam Moore [Tue, 27 Aug 2013 12:31:20 +0000 (05:31 -0700)]
Merge pull request #20 from jtanx/master
Update nginx configs and makefile libs
Jeremy Tan [Tue, 27 Aug 2013 11:44:20 +0000 (19:44 +0800)]
Move nginx configs and update makefile (crypto lib)
Jeremy Tan [Tue, 27 Aug 2013 11:26:10 +0000 (19:26 +0800)]
Merge branch 'master' of https://github.com/szmoore/MCTX3420.git
Sam Moore [Mon, 26 Aug 2013 17:00:09 +0000 (01:00 +0800)]
Automatic commit of irc logs
Sam Moore [Mon, 26 Aug 2013 05:43:21 +0000 (13:43 +0800)]
Get threads to deal with exit conditions, create timestamps
Jeremy Tan [Mon, 26 Aug 2013 05:38:15 +0000 (13:38 +0800)]
Merge branch 'master' of https://github.com/szmoore/MCTX3420.git
Sam Moore [Mon, 26 Aug 2013 03:05:58 +0000 (20:05 -0700)]
Merge pull request #18 from justinjessada/master
Added code samples for Beaglebone sensors
Callum [Sun, 25 Aug 2013 08:19:36 +0000 (01:19 -0700)]
Merge pull request #19 from Callum-/master
camera
Callum [Sun, 25 Aug 2013 08:18:15 +0000 (16:18 +0800)]
Delete .capture.c.swp
Callum [Sun, 25 Aug 2013 08:14:23 +0000 (16:14 +0800)]
function for takingand saving images
Sam Moore [Sat, 24 Aug 2013 17:00:07 +0000 (01:00 +0800)]
Automatic commit of irc logs
Justin Kruger [Sat, 24 Aug 2013 09:00:56 +0000 (17:00 +0800)]
Merge remote-tracking branch 'upstream/master'
Justin Kruger [Sat, 24 Aug 2013 08:52:21 +0000 (16:52 +0800)]
Sensors code
Added some sensors code examples and notes for Beaglebone hardware
Sam Moore [Fri, 23 Aug 2013 17:00:07 +0000 (01:00 +0800)]
Automatic commit of irc logs
Sam Moore [Thu, 22 Aug 2013 17:00:09 +0000 (01:00 +0800)]
Automatic commit of irc logs
Sam Moore [Wed, 21 Aug 2013 17:00:06 +0000 (01:00 +0800)]
Automatic commit of irc logs
Jeremy Tan [Wed, 21 Aug 2013 14:10:40 +0000 (22:10 +0800)]
Fix params field for reject message
Sam Moore [Wed, 21 Aug 2013 02:55:20 +0000 (19:55 -0700)]
Merge pull request #16 from jtanx/master
Update FastCGI code and restructure headers a bit
Sam Moore [Tue, 20 Aug 2013 17:00:09 +0000 (01:00 +0800)]
Automatic commit of irc logs
Jeremy Tan [Tue, 20 Aug 2013 12:22:37 +0000 (20:22 +0800)]
Add code to test authorization scheme
Jeremy Tan [Tue, 20 Aug 2013 12:01:20 +0000 (20:01 +0800)]
Update FastCGI code and restructure includes a bit
Jeremy Tan [Tue, 20 Aug 2013 08:55:49 +0000 (16:55 +0800)]
Merge branch 'master' of https://github.com/szmoore/MCTX3420.git
Jeremy Tan [Tue, 20 Aug 2013 08:55:16 +0000 (16:55 +0800)]
Update FCGI JSON methods
Sam Moore [Mon, 19 Aug 2013 17:00:09 +0000 (01:00 +0800)]
Automatic commit of irc logs
Sam Moore [Mon, 19 Aug 2013 13:19:47 +0000 (21:19 +0800)]
Fix SensorHandler while loop
do while causes undefined behaviour when params string is empty
Sam Moore [Mon, 19 Aug 2013 12:56:33 +0000 (20:56 +0800)]
Put FastCGI code into server framework
Implement basic SensorHandler function.
Can now get data from (simulated still) sensor displayed in web browser.
SensorHandler deals with argument checking, identifies the sensor,
sends the JSON, etc, calls Sensor_Query appropriately.
Sensor_Query actually fills a buffer with requested number of data points.
Example of use:
http://server.address/api/sensor?id=0
Use run.sh to start fastcgi server under valgrind.
Sam Moore [Mon, 19 Aug 2013 06:42:58 +0000 (23:42 -0700)]
Merge pull request #15 from jtanx/master
Update FastCGI Test code
Sam Moore [Mon, 19 Aug 2013 04:27:52 +0000 (12:27 +0800)]
Add data performance tests, revise block diagram, add pthread_mutex_init
Jeremy Tan [Mon, 19 Aug 2013 02:07:01 +0000 (10:07 +0800)]
Merge branch 'master' of https://github.com/szmoore/MCTX3420.git
Sam Moore [Sun, 18 Aug 2013 17:00:09 +0000 (01:00 +0800)]
Automatic commit of irc logs
Sam Moore [Sun, 18 Aug 2013 13:22:06 +0000 (21:22 +0800)]
Project Management Stuff
Blergh.
- List of tasks fairly complete (?)
- Timeline fairly not started at all
Done in ProjectLibre but exported to Microsoft Project Format so other people can edit it.
Sam Moore [Sun, 18 Aug 2013 13:11:37 +0000 (21:11 +0800)]
Change sensor data transfer
- Keep binary file always open (mode "a+b"); don't need to reopen each time it is accessed
- Fill query buffer with most recent datapoints (as opposed to trying to transfer datapoints in sequential order)
- Better because it keeps client as up to date as possible
- Rather than client getting increasingly outdated data
TODO:
- Test to see if buffers in front of writing to file worth it
- Probably will be; saves from having to unlock mutex on every single data point
- Merge Query and FCGI stuff
Jeremy Tan [Sun, 18 Aug 2013 12:44:25 +0000 (20:44 +0800)]
Add test main and update nginx config to have HTTP basic auth for api/login
Sam Moore [Sun, 18 Aug 2013 09:54:56 +0000 (02:54 -0700)]
Merge pull request #14 from jtanx/master
Update fastcgi test code
UCC git Repository :: git.ucc.asn.au