Add timezone config item

This commit is contained in:
2023-05-15 17:25:25 +01:00
parent be666164f4
commit 8be7ec1e28
3 changed files with 59 additions and 7 deletions

View File

@@ -44,7 +44,7 @@ size_t config_get_hostname(char *buffer, size_t buffer_size);
/**
* Add a callback for hostname updates.
*
* The function specified in the argument will be invoked whenever a
* The function specified in the argument will be invoked whenever
* the hostname is updated, with the new value as its argument. The
* lifetime of the passed argument will be static, but the value may
* be modified once the callback returns.
@@ -72,8 +72,8 @@ size_t config_get_ssid(char *buffer, size_t buffer_size);
/**
* Add a callback for SSID updates.
*
* The function specified in the argument will be invoked whenever a
* the ssid is updated, with the new value as its argument. The
* The function specified in the argument will be invoked whenever
* the SSID is updated, with the new value as its argument. The
* lifetime of the passed argument will be static, but the value may
* be modified once the callback returns.
*/
@@ -100,11 +100,40 @@ size_t config_get_psk(char *buffer, size_t buffer_size);
/**
* Add a callback for PSK updates.
*
* The function specified in the argument will be invoked whenever a
* the psk is updated, with the new value as its argument. The
* lifetime of the passed argument will be static, but the value may
* be modified once the callback returns.
* The function specified in the argument will be invoked whenever the
* PSK is updated, with the new value as its argument. The lifetime of
* the passed argument will be static, but the value may be modified
* once the callback returns.
*/
void config_add_psk_callback(ConfigCallback callback);
/**
* Set the timezone.
*
* The argument should be a null-terminated string, containing a
* timezone spec in the format expected by tzset(). If the maximum
* length is exceeded, the value will still be used, but will be
* truncated.
*/
void config_set_timezone(const char *psk);
/**
* Write the timezone into the given buffer.
*
* The length of the timezone is returned. If the value's size exceeds
* the size of the buffer, nothing will be written to the buffer but
* the length is still returned.
*/
size_t config_get_timezone(char *buffer, size_t buffer_size);
/**
* Add a callback for timezone updates.
*
* The function specified in the argument will be invoked whenever the
* timezone is updated, with the new value as its argument. The
* lifetime of the passed argument will be static, but the value may
* be modified once the callback returns.
*/
void config_add_timezone_callback(ConfigCallback callback);
#endif