diff options
author | ConfuSomu | 2021-03-28 13:33:34 -0400 |
---|---|---|
committer | ConfuSomu | 2021-03-28 13:33:34 -0400 |
commit | 079dbd3c3679edee99d3d54ed1913403d77b153b (patch) | |
tree | ddcccf12b81ea2dc877c2426110102383ea2c68e | |
parent | cadb04d9a3a4236437f5081724b763db04b3f7fd (diff) | |
download | pico-watch-079dbd3c3679edee99d3d54ed1913403d77b153b.tar pico-watch-079dbd3c3679edee99d3d54ed1913403d77b153b.tar.gz pico-watch-079dbd3c3679edee99d3d54ed1913403d77b153b.zip |
Implement API method for setting current datetimeapi-class
-rw-r--r-- | api.cpp | 4 | ||||
-rw-r--r-- | api.hpp | 8 |
2 files changed, 12 insertions, 0 deletions
@@ -311,6 +311,10 @@ bool Api::datetime_get(datetime_t *t) { return rtc_get_datetime(t); } +bool Api::datetime_set(datetime_t *t) { + return rtc_set_datetime(t); +} + int Api::performance_render_interval_get() { return m_app_render_interval; } @@ -96,7 +96,15 @@ class Api { // An app should choose the lowest performance that can make it function. Set in init(). Only when required, higher performance should be used. // \param perf See Api::perf_modes enum for possible values bool performance_set(int perf); + // Get the current datetime + // \param t Pointer to the datetime structure in which the datetime wil be stored + // \return true if the call to the SDK was successful, else false. bool datetime_get(datetime_t *t); + // Set the current datetime + // TODO: Not every app should be allowed to set the datetime. Only app_id<2 (home_screen and settings) should be allowed: return false when setting is blocked. + // \param t Pointer to the datetime structure + // \return true if the call to the SDK was successful, else false. + bool datetime_set(datetime_t *t); // Get app's current render interval // \return Value in millisec int performance_render_interval_get(); |