Add setting for SNTP server

This commit is contained in:
2023-05-15 23:21:47 +01:00
parent 7d84b95ad5
commit 62405149ad
3 changed files with 51 additions and 0 deletions

View File

@@ -136,4 +136,32 @@ size_t settings_get_timezone(char *buffer, size_t buffer_size);
*/
void settings_add_timezone_callback(SettingsCallback callback);
/**
* Set the SNTP server URL.
*
* The argument should be a null-terminated string, containing a valid
* domain name for an SNTP server. If the maximum length is exceeded,
* the value will still be used, but will be truncated.
*/
void settings_set_sntp_server(const char *sntp_server);
/**
* Write the SNTP server URL into the given buffer.
*
* The length of the SNTP server domain 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 settings_get_sntp_server(char *buffer, size_t buffer_size);
/**
* Add a callback for SNTP server URL updates.
*
* The function specified in the argument will be invoked whenever the
* SNTP server 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 settings_add_sntp_server_callback(SettingsCallback callback);
#endif