|
PebbleOS
|
Timeline pins (BlobDBIdPins), keyed by pin UUID. More...
Functions | |
| status_t | pin_db_get (const TimelineItemId *id, TimelineItem *pin) |
| Read and deserialize a pin. | |
| status_t | pin_db_insert_item (TimelineItem *item) |
| Serialize and insert a pin, emitting a BlobDB insert event. | |
| status_t | pin_db_insert_item_without_event (TimelineItem *item) |
| pin_db_insert_item() without the BlobDB event. | |
| status_t | pin_db_set_status_bits (const TimelineItemId *id, uint8_t status) |
| Overwrite the status bits of a pin. | |
| status_t | pin_db_each (TimelineItemStorageEachCallback each, void *data) |
| Call a function for every record in the pin database. | |
| status_t | pin_db_delete_with_parent (const TimelineItemId *parent_id) |
| Delete the pins of a parent (app or data source). | |
| bool | pin_db_exists_with_parent (const TimelineItemId *parent_id) |
| Check whether a parent has pins. | |
| status_t | pin_db_read_item_header (TimelineItem *item_out, TimelineItemId *id) |
| Read the header of a pin. | |
| status_t | pin_db_next_item_header (TimelineItem *next_item_out, TimelineItemStorageFilterCallback filter) |
| Read the header of the earliest pin within the maximum age. | |
| bool | pin_db_has_entry_expired (time_t pin_end_timestamp) |
| Check whether a pin is older than the pin database keeps. | |
| void | pin_db_init (void) |
| Initialize the pin database. | |
| void | pin_db_deinit (void) |
| Close the settings file backing the pin database. | |
| status_t | pin_db_insert (const uint8_t *key, int key_len, const uint8_t *val, int val_len) |
| Insert or replace a record in the pin database. | |
| int | pin_db_get_len (const uint8_t *key, int key_len) |
| Get the length of a record in the pin database. | |
| status_t | pin_db_read (const uint8_t *key, int key_len, uint8_t *val_out, int val_out_len) |
| Read a record from the pin database. | |
| status_t | pin_db_delete (const uint8_t *key, int key_len) |
| Delete a record from the pin database. | |
| status_t | pin_db_flush (void) |
| Delete all records of the pin database. | |
| status_t | pin_db_compact (void) |
| Compact the settings file backing the pin database. | |
| status_t | pin_db_is_dirty (bool *is_dirty_out) |
| Check whether the pin database holds records not yet synced to the phone. | |
| BlobDBDirtyItem * | pin_db_get_dirty_list (void) |
| Build the list of records of the pin database not yet synced to the phone. | |
| status_t | pin_db_mark_synced (const uint8_t *key, int key_len) |
| Mark a record of the pin database as synced. | |
Timeline pins (BlobDBIdPins), keyed by pin UUID.
Backed by Timeline item storage; pins older than three days are rejected.
| status_t pin_db_compact | ( | void | ) |
Compact the settings file backing the pin database.
S_SUCCESS on success, an error code otherwise. | void pin_db_deinit | ( | void | ) |
Close the settings file backing the pin database.
| status_t pin_db_delete | ( | const uint8_t * | key, |
| int | key_len | ||
| ) |
Delete a record from the pin database.
The key is the pin UUID. Also deletes the reminders of the pin.
| key | Key data. |
| key_len | Length of key in bytes. |
S_SUCCESS on success, an error code otherwise. | status_t pin_db_delete_with_parent | ( | const TimelineItemId * | parent_id | ) |
Delete the pins of a parent (app or data source).
| parent_id | Parent UUID. |
S_SUCCESS on success, an error code otherwise. | status_t pin_db_each | ( | TimelineItemStorageEachCallback | each, |
| void * | data | ||
| ) |
Call a function for every record in the pin database.
flags and status of the stored CommonTimelineItemHeader are inverted and are not restored for the callback.| each | Callback. |
| data | User data passed to each. |
S_SUCCESS on success, an error code otherwise. | bool pin_db_exists_with_parent | ( | const TimelineItemId * | parent_id | ) |
Check whether a parent has pins.
| parent_id | Parent UUID. |
| status_t pin_db_flush | ( | void | ) |
Delete all records of the pin database.
Pins created on the watch are kept.
S_SUCCESS on success, an error code otherwise. | status_t pin_db_get | ( | const TimelineItemId * | id, |
| TimelineItem * | pin | ||
| ) |
Read and deserialize a pin.
| id | Pin UUID. | |
| [out] | pin | Pin; free its buffer with timeline_item_free_allocated_buffer(). |
| S_SUCCESS | Read. |
| E_DOES_NOT_EXIST | No such pin. |
| BlobDBDirtyItem * pin_db_get_dirty_list | ( | void | ) |
Build the list of records of the pin database not yet synced to the phone.
| int pin_db_get_len | ( | const uint8_t * | key, |
| int | key_len | ||
| ) |
Get the length of a record in the pin database.
The key is the pin UUID.
| key | Key data. |
| key_len | Length of key in bytes. |
| bool pin_db_has_entry_expired | ( | time_t | pin_end_timestamp | ) |
Check whether a pin is older than the pin database keeps.
| pin_end_timestamp | End time of the pin. |
| void pin_db_init | ( | void | ) |
Initialize the pin database.
| status_t pin_db_insert | ( | const uint8_t * | key, |
| int | key_len, | ||
| const uint8_t * | val, | ||
| int | val_len | ||
| ) |
Insert or replace a record in the pin database.
The key is the pin UUID and the value a serialized timeline item. Records from the phone are stored as synced. Notification and reminder layouts are rejected. Triggers a fetch of the parent app when it is installed but not cached.
| 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 pin_db_insert_item | ( | TimelineItem * | item | ) |
Serialize and insert a pin, emitting a BlobDB insert event.
Pins from the reminders app data source are marked dirty and synced to the phone.
| item | Pin, of type TimelineItemTypePin. |
S_SUCCESS on success, an error code otherwise. | status_t pin_db_insert_item_without_event | ( | TimelineItem * | item | ) |
pin_db_insert_item() without the BlobDB event.
Meant for tests inserting many generated pins, which would otherwise flood the event queue.
| item | Pin, of type TimelineItemTypePin. |
S_SUCCESS on success, an error code otherwise. | status_t pin_db_is_dirty | ( | bool * | is_dirty_out | ) |
Check whether the pin 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. | status_t pin_db_mark_synced | ( | const uint8_t * | key, |
| int | key_len | ||
| ) |
Mark a record of the pin database as synced.
The key is the pin UUID.
| key | Key data. |
| key_len | Length of key in bytes. |
S_SUCCESS on success, an error code otherwise. | status_t pin_db_next_item_header | ( | TimelineItem * | next_item_out, |
| TimelineItemStorageFilterCallback | filter | ||
| ) |
Read the header of the earliest pin within the maximum age.
| [out] | next_item_out | Item with only the header filled in. |
| filter | Optional filter, returns false to skip an item. |
| S_SUCCESS | Found. |
| S_NO_MORE_ITEMS | No matching pin. |
| status_t pin_db_read | ( | const uint8_t * | key, |
| int | key_len, | ||
| uint8_t * | val_out, | ||
| int | val_out_len | ||
| ) |
Read a record from the pin database.
The key is the pin 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 pin_db_read_item_header | ( | TimelineItem * | item_out, |
| TimelineItemId * | id | ||
| ) |
Read the header of a pin.
| [out] | item_out | Item with only the header filled in. |
| id | Pin UUID. |
S_SUCCESS on success, an error code otherwise. | status_t pin_db_set_status_bits | ( | const TimelineItemId * | id, |
| uint8_t | status | ||
| ) |
Overwrite the status bits of a pin.
| id | Pin UUID. |
| status | New status bits. |
S_SUCCESS on success, an error code otherwise.