|
PebbleOS
|
System and notification settings synced both ways (BlobDBIdSettings). More...
Functions | |
| void | settings_blob_db_init (void) |
| Initialize the settings database. | |
| status_t | settings_blob_db_insert (const uint8_t *key, int key_len, const uint8_t *val, int val_len) |
| Insert or replace a record in the settings database. | |
| int | settings_blob_db_get_len (const uint8_t *key, int key_len) |
| Get the length of a record in the settings database. | |
| status_t | settings_blob_db_read (const uint8_t *key, int key_len, uint8_t *val_out, int val_len) |
| Read a record from the settings database. | |
| status_t | settings_blob_db_delete (const uint8_t *key, int key_len) |
| Delete a record from the settings database. | |
| BlobDBDirtyItem * | settings_blob_db_get_dirty_list (void) |
| Build the list of records of the settings database not yet synced to the phone. | |
| status_t | settings_blob_db_mark_synced (const uint8_t *key, int key_len) |
| Mark a record of the settings database as synced. | |
| status_t | settings_blob_db_is_dirty (bool *is_dirty_out) |
| Check whether the settings database holds records not yet synced to the phone. | |
| status_t | settings_blob_db_flush (void) |
| Delete all records of the settings database. | |
| status_t | settings_blob_db_mark_all_dirty (void) |
| Mark all whitelisted settings as dirty. | |
| status_t | settings_blob_db_insert_with_timestamp (const uint8_t *key, int key_len, const uint8_t *val, int val_len, time_t timestamp) |
| Insert or update a setting unless the watch copy is newer. | |
| bool | settings_blob_db_phone_supports_sync (void) |
| Check whether the connected phone supports settings sync. | |
System and notification settings synced both ways (BlobDBIdSettings).
Exposes the shell preferences and notification preferences settings files through BlobDB so the phone can reuse its BlobDB sync. Only a whitelist of settings, kept in settings_blob_db.c, is accessible and synced.
| status_t settings_blob_db_delete | ( | const uint8_t * | key, |
| int | key_len | ||
| ) |
Delete a record from the settings database.
The key is the setting name, with or without a trailing NUL. Only whitelisted settings can be deleted.
| key | Key data. |
| key_len | Length of key in bytes. |
S_SUCCESS on success, an error code otherwise. | status_t settings_blob_db_flush | ( | void | ) |
Delete all records of the settings database.
No-op: settings file writes are already persistent, so records are kept.
S_SUCCESS on success, an error code otherwise. | BlobDBDirtyItem * settings_blob_db_get_dirty_list | ( | void | ) |
Build the list of records of the settings database not yet synced to the phone.
Only whitelisted settings are listed.
| int settings_blob_db_get_len | ( | const uint8_t * | key, |
| int | key_len | ||
| ) |
Get the length of a record in the settings database.
The key is the setting name, with or without a trailing NUL.
| key | Key data. |
| key_len | Length of key in bytes. |
| void settings_blob_db_init | ( | void | ) |
Initialize the settings database.
Registers a settings file change callback that syncs whitelisted settings to the phone.
| status_t settings_blob_db_insert | ( | const uint8_t * | key, |
| int | key_len, | ||
| const uint8_t * | val, | ||
| int | val_len | ||
| ) |
Insert or replace a record in the settings database.
The key is the setting name, with or without a trailing NUL. Non-whitelisted settings are rejected with E_INVALID_OPERATION. The record is stored as synced and the in-memory preferences are updated.
| key | Key data. |
| key_len | Length of key in bytes. |
| val | Value data. |
| val_len | Length of val in bytes. |
S_SUCCESS on success, an error code otherwise. | status_t settings_blob_db_insert_with_timestamp | ( | const uint8_t * | key, |
| int | key_len, | ||
| const uint8_t * | val, | ||
| int | val_len, | ||
| time_t | timestamp | ||
| ) |
Insert or update a setting unless the watch copy is newer.
| key | Setting name. |
| key_len | Length of key in bytes. |
| val | Value data. |
| val_len | Length of val in bytes. |
| timestamp | Modification time of the incoming value. |
| S_SUCCESS | Inserted. |
| E_INVALID_OPERATION | Watch copy is newer, or the setting is not whitelisted. |
| status_t settings_blob_db_is_dirty | ( | bool * | is_dirty_out | ) |
Check whether the settings database holds records not yet synced to the phone.
Only whitelisted settings are considered.
| [out] | is_dirty_out | Set to true if at least one record is dirty. |
S_SUCCESS on success, an error code otherwise. | status_t settings_blob_db_mark_all_dirty | ( | void | ) |
Mark all whitelisted settings as dirty.
Triggers a full sync of the settings to the phone.
S_SUCCESS on success, an error code otherwise. | status_t settings_blob_db_mark_synced | ( | const uint8_t * | key, |
| int | key_len | ||
| ) |
Mark a record of the settings database as synced.
The key is the setting name, with or without a trailing NUL.
| key | Key data. |
| key_len | Length of key in bytes. |
S_SUCCESS on success, an error code otherwise. | bool settings_blob_db_phone_supports_sync | ( | void | ) |
Check whether the connected phone supports settings sync.
settings_sync_support capability. | status_t settings_blob_db_read | ( | const uint8_t * | key, |
| int | key_len, | ||
| uint8_t * | val_out, | ||
| int | val_len | ||
| ) |
Read a record from the settings database.
The key is the setting name, with or without a trailing NUL.
| key | Key data. | |
| key_len | Length of key in bytes. | |
| [out] | val_out | Buffer for the value. |
| val_len | Size of val_out in bytes. |
S_SUCCESS on success, an error code otherwise.