|
PebbleOS
|
Timeline reminders (BlobDBIdReminders), keyed by reminder UUID. More...
Functions | |
| status_t | reminder_db_read_item (TimelineItem *item_out, TimelineItemId *id) |
| Read and deserialize a reminder. | |
| status_t | reminder_db_next_item_header (TimelineItem *next_item_out) |
| Read the header of the earliest reminder that has not fired yet. | |
| status_t | reminder_db_insert_item (TimelineItem *item) |
| Serialize and insert a reminder created on the watch. | |
| status_t | reminder_db_delete_item (const TimelineItemId *id, bool send_event) |
| Delete a reminder. | |
| status_t | reminder_db_delete_with_parent (const TimelineItemId *parent_id) |
| Delete the reminders of a parent pin. | |
| bool | reminder_db_is_empty (void) |
| Check whether the reminder database is empty. | |
| status_t | reminder_db_set_status_bits (const TimelineItemId *id, uint8_t status) |
| Overwrite the status bits of a reminder. | |
| bool | reminder_db_find_by_timestamp_title (time_t timestamp, const char *title, TimelineItemStorageFilterCallback filter, TimelineItem *reminder_out) |
| Find a reminder with a given time and title. | |
| void | reminder_db_init (void) |
| Initialize the reminder database. | |
| void | reminder_db_deinit (void) |
| Close the settings file backing the reminder database. | |
| status_t | reminder_db_insert (const uint8_t *key, int key_len, const uint8_t *val, int val_len) |
| Insert or replace a record in the reminder database. | |
| int | reminder_db_get_len (const uint8_t *key, int key_len) |
| Get the length of a record in the reminder database. | |
| status_t | reminder_db_read (const uint8_t *key, int key_len, uint8_t *val_out, int val_out_len) |
| Read a record from the reminder database. | |
| status_t | reminder_db_delete (const uint8_t *key, int key_len) |
| Delete a record from the reminder database. | |
| status_t | reminder_db_flush (void) |
| Delete all records of the reminder database. | |
| status_t | reminder_db_compact (void) |
| Compact the settings file backing the reminder database. | |
| status_t | reminder_db_is_dirty (bool *is_dirty_out) |
| Check whether the reminder database holds records not yet synced to the phone. | |
| BlobDBDirtyItem * | reminder_db_get_dirty_list (void) |
| Build the list of records of the reminder database not yet synced to the phone. | |
| status_t | reminder_db_mark_synced (const uint8_t *key, int key_len) |
| Mark a record of the reminder database as synced. | |
Timeline reminders (BlobDBIdReminders), keyed by reminder UUID.
Backed by Timeline item storage. Reminders more than 15 minutes in the past are rejected.
| status_t reminder_db_compact | ( | void | ) |
Compact the settings file backing the reminder database.
S_SUCCESS on success, an error code otherwise. | void reminder_db_deinit | ( | void | ) |
Close the settings file backing the reminder database.
| status_t reminder_db_delete | ( | const uint8_t * | key, |
| int | key_len | ||
| ) |
Delete a record from the reminder database.
The key is the reminder UUID. Notifies the reminders service.
| key | Key data. |
| key_len | Length of key in bytes. |
S_SUCCESS on success, an error code otherwise. | status_t reminder_db_delete_item | ( | const TimelineItemId * | id, |
| bool | send_event | ||
| ) |
Delete a reminder.
| id | Reminder UUID. |
| send_event | If true, also notify the reminders service as reminder_db_delete() does. |
S_SUCCESS on success, an error code otherwise. | status_t reminder_db_delete_with_parent | ( | const TimelineItemId * | parent_id | ) |
Delete the reminders of a parent pin.
| parent_id | Parent pin UUID. |
S_SUCCESS if all reminders were deleted, an error code otherwise. | bool reminder_db_find_by_timestamp_title | ( | time_t | timestamp, |
| const char * | title, | ||
| TimelineItemStorageFilterCallback | filter, | ||
| TimelineItem * | reminder_out | ||
| ) |
Find a reminder with a given time and title.
| timestamp | Time to match. | |
| title | Title to match. | |
| filter | Optional additional filter, returns false to reject a candidate. | |
| [out] | reminder_out | Matching reminder, valid only when true is returned; free its buffer with timeline_item_free_allocated_buffer(). Must not be NULL. |
| status_t reminder_db_flush | ( | void | ) |
Delete all records of the reminder database.
Reminders created on the watch are kept.
S_SUCCESS on success, an error code otherwise. | BlobDBDirtyItem * reminder_db_get_dirty_list | ( | void | ) |
Build the list of records of the reminder database not yet synced to the phone.
| int reminder_db_get_len | ( | const uint8_t * | key, |
| int | key_len | ||
| ) |
Get the length of a record in the reminder database.
The key is the reminder UUID.
| key | Key data. |
| key_len | Length of key in bytes. |
| void reminder_db_init | ( | void | ) |
Initialize the reminder database.
Also initializes the reminders service.
| status_t reminder_db_insert | ( | const uint8_t * | key, |
| int | key_len, | ||
| const uint8_t * | val, | ||
| int | val_len | ||
| ) |
Insert or replace a record in the reminder database.
The key is the reminder UUID and the value a serialized timeline item. Records from the phone are stored as synced. Updates the reminder timer.
| 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 reminder_db_insert_item | ( | TimelineItem * | item | ) |
Serialize and insert a reminder created on the watch.
The record is marked dirty and synced to the phone.
| item | Reminder, of type TimelineItemTypeReminder. |
S_SUCCESS on success, an error code otherwise. | status_t reminder_db_is_dirty | ( | bool * | is_dirty_out | ) |
Check whether the reminder database holds records not yet synced to the phone.
| [out] | is_dirty_out | Set to true if at least one record is dirty. |
S_SUCCESS on success, an error code otherwise. | bool reminder_db_is_empty | ( | void | ) |
Check whether the reminder database is empty.
| status_t reminder_db_mark_synced | ( | const uint8_t * | key, |
| int | key_len | ||
| ) |
Mark a record of the reminder database as synced.
The key is the reminder UUID.
| key | Key data. |
| key_len | Length of key in bytes. |
S_SUCCESS on success, an error code otherwise. | status_t reminder_db_next_item_header | ( | TimelineItem * | next_item_out | ) |
Read the header of the earliest reminder that has not fired yet.
| [out] | next_item_out | Item with only the header filled in. |
| S_SUCCESS | Found. |
| S_NO_MORE_ITEMS | No pending reminder. |
| status_t reminder_db_read | ( | const uint8_t * | key, |
| int | key_len, | ||
| uint8_t * | val_out, | ||
| int | val_out_len | ||
| ) |
Read a record from the reminder database.
The key is the reminder UUID.
| key | Key data. | |
| key_len | Length of key in bytes. | |
| [out] | val_out | Buffer for the value. |
| val_out_len | Size of val_out in bytes. |
S_SUCCESS on success, an error code otherwise. | status_t reminder_db_read_item | ( | TimelineItem * | item_out, |
| TimelineItemId * | id | ||
| ) |
Read and deserialize a reminder.
| [out] | item_out | Reminder; free its buffer with timeline_item_free_allocated_buffer(). |
| id | Reminder UUID. |
| S_SUCCESS | Read. |
| E_DOES_NOT_EXIST | No such reminder. |
| status_t reminder_db_set_status_bits | ( | const TimelineItemId * | id, |
| uint8_t | status | ||
| ) |
Overwrite the status bits of a reminder.
| id | Reminder UUID. |
| status | New status bits. |
S_SUCCESS on success, an error code otherwise.