|
@@ -0,0 +1,68 @@
|
|
|
+# jsonrtc
|
|
|
+
|
|
|
+DISCLAIMER: This Code has been written for demonstration purposes only, it offers no authentikation at all and should not be used in production!
|
|
|
+
|
|
|
+Simple http API to read and write RTC data via JSON implemented with kore and cJSON.
|
|
|
+
|
|
|
+## Getting Started
|
|
|
+
|
|
|
+Execute `kodev run` to start the web service. You can then issue requests to the following endpoints:
|
|
|
+
|
|
|
+* /time (either GET or POST)
|
|
|
+* /wkalrm (either GET or POST)
|
|
|
+
|
|
|
+## Parameters
|
|
|
+
|
|
|
+A GET request generally requires no parameters, for POST you have to pass a JSON object that follows one of the following formats.
|
|
|
+
|
|
|
+For /time:
|
|
|
+```
|
|
|
+{
|
|
|
+ "seconds": int,
|
|
|
+ "minutes": int,
|
|
|
+ "hour": int,
|
|
|
+ "mday": int,
|
|
|
+ "month": int,
|
|
|
+ "year": int,
|
|
|
+ "wday": int,
|
|
|
+ "enabled": int,
|
|
|
+ "pending": int
|
|
|
+}
|
|
|
+
|
|
|
+```
|
|
|
+
|
|
|
+For /wkalrm:
|
|
|
+```
|
|
|
+{
|
|
|
+ "seconds": 27,
|
|
|
+ "minutes": 33,
|
|
|
+ "hour": 9,
|
|
|
+ "mday": 22,
|
|
|
+ "month": 11,
|
|
|
+ "year": 118,
|
|
|
+ "wday": 6,
|
|
|
+ "enabled": 0,
|
|
|
+ "pending": 0
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+## Prerequisites
|
|
|
+
|
|
|
+You will need the following packages installed on your system:
|
|
|
+
|
|
|
+* kore
|
|
|
+* cJSON
|
|
|
+
|
|
|
+You also should have a compatible RTC device with the [rtc-ds13307](https://git.cyber-everything.de/Hoshpak/rtc-ds13307)-driver loaded on your system.
|
|
|
+
|
|
|
+## Authors
|
|
|
+
|
|
|
+* **Helmut Pozimski** - *Initial work* - [Hoshpak](https://git.cyber-everything.de/Hoshpak)
|
|
|
+
|
|
|
+## License
|
|
|
+
|
|
|
+This project is licensed under the GNU General Public License, Version 2 - see the [COPYING](COPYING) file for details
|
|
|
+
|
|
|
+## Acknowledgments
|
|
|
+
|
|
|
+TBD
|