PebbleOS
Loading...
Searching...
No Matches
Functions
Watch app preferences

Preferences of system apps set from the phone (BlobDBIdWatchAppPrefs). More...

Functions

SerializedSendTextPrefs * watch_app_prefs_get_send_text (void)
 Read the Send Text app preferences.
 
SerializedWeatherAppPrefs * watch_app_prefs_get_weather (void)
 Read the Weather app location ordering.
 
SerializedReminderAppPrefs * watch_app_prefs_get_reminder (void)
 Read the Reminders app preferences.
 
void watch_app_prefs_destroy_weather (SerializedWeatherAppPrefs *prefs)
 Free preferences returned by watch_app_prefs_get_weather().
 
void watch_app_prefs_db_init (void)
 Initialize the watch app preferences database.
 
status_t watch_app_prefs_db_insert (const uint8_t *key, int key_len, const uint8_t *val, int val_len)
 Insert or replace a record in the watch app preferences database.
 
int watch_app_prefs_db_get_len (const uint8_t *key, int key_len)
 Get the length of a record in the watch app preferences database.
 
status_t watch_app_prefs_db_read (const uint8_t *key, int key_len, uint8_t *val_out, int val_out_len)
 Read a record from the watch app preferences database.
 
status_t watch_app_prefs_db_delete (const uint8_t *key, int key_len)
 Delete a record from the watch app preferences database.
 
status_t watch_app_prefs_db_flush (void)
 Delete all records of the watch app preferences database.
 
status_t watch_app_prefs_db_compact (void)
 Compact the settings file backing the watch app preferences database.
 

Detailed Description

Preferences of system apps set from the phone (BlobDBIdWatchAppPrefs).

Records are keyed by a per-app string.

Function Documentation

◆ watch_app_prefs_db_compact()

status_t watch_app_prefs_db_compact ( void  )

Compact the settings file backing the watch app preferences database.

Returns
S_SUCCESS on success, an error code otherwise.

◆ watch_app_prefs_db_delete()

status_t watch_app_prefs_db_delete ( const uint8_t *  key,
int  key_len 
)

Delete a record from the watch app preferences database.

Parameters
keyKey data.
key_lenLength of key in bytes.
Returns
S_SUCCESS on success, an error code otherwise.

◆ watch_app_prefs_db_flush()

status_t watch_app_prefs_db_flush ( void  )

Delete all records of the watch app preferences database.

Returns
S_SUCCESS on success, an error code otherwise.

◆ watch_app_prefs_db_get_len()

int watch_app_prefs_db_get_len ( const uint8_t *  key,
int  key_len 
)

Get the length of a record in the watch app preferences database.

Parameters
keyKey data.
key_lenLength of key in bytes.
Returns
Length of the value in bytes, 0 if not found, or a negative error code.

◆ watch_app_prefs_db_init()

void watch_app_prefs_db_init ( void  )

Initialize the watch app preferences database.

◆ watch_app_prefs_db_insert()

status_t watch_app_prefs_db_insert ( const uint8_t *  key,
int  key_len,
const uint8_t *  val,
int  val_len 
)

Insert or replace a record in the watch app preferences database.

Only the Send Text, Weather and Reminders app keys are accepted; list sizes are validated.

Parameters
keyKey data.
key_lenLength of key in bytes.
valValue data.
val_lenLength of val in bytes.
Returns
S_SUCCESS on success, an error code otherwise.

◆ watch_app_prefs_db_read()

status_t watch_app_prefs_db_read ( const uint8_t *  key,
int  key_len,
uint8_t *  val_out,
int  val_out_len 
)

Read a record from the watch app preferences database.

Parameters
keyKey data.
key_lenLength of key in bytes.
[out]val_outBuffer for the value.
val_out_lenSize of val_out in bytes.
Returns
S_SUCCESS on success, an error code otherwise.

◆ watch_app_prefs_destroy_weather()

void watch_app_prefs_destroy_weather ( SerializedWeatherAppPrefs *  prefs)

Free preferences returned by watch_app_prefs_get_weather().

Parameters
prefsPreferences, may be NULL.

◆ watch_app_prefs_get_reminder()

SerializedReminderAppPrefs * watch_app_prefs_get_reminder ( void  )

Read the Reminders app preferences.

Served from a cache after the first read.

Returns
Task heap allocated preferences, NULL on failure. Free with task_free().

◆ watch_app_prefs_get_send_text()

SerializedSendTextPrefs * watch_app_prefs_get_send_text ( void  )

Read the Send Text app preferences.

Returns
Task heap allocated preferences, NULL on failure. Free with task_free().

◆ watch_app_prefs_get_weather()

SerializedWeatherAppPrefs * watch_app_prefs_get_weather ( void  )

Read the Weather app location ordering.

Returns
Task heap allocated preferences, NULL on failure. Free with watch_app_prefs_destroy_weather().