PebbleOS
Loading...
Searching...
No Matches
Functions
Notification database

BlobDB front end of notification storage (BlobDBIdNotifs). More...

Functions

void notif_db_init (void)
 Initialize the notification database.
 
status_t notif_db_insert (const uint8_t *key, int key_len, const uint8_t *val, int val_len)
 Insert or replace a record in the notification database.
 
int notif_db_get_len (const uint8_t *key, int key_len)
 Get the length of a record in the notification database.
 
status_t notif_db_read (const uint8_t *key, int key_len, uint8_t *val_out, int val_out_len)
 Read a record from the notification database.
 
status_t notif_db_delete (const uint8_t *key, int key_len)
 Delete a record from the notification database.
 
status_t notif_db_flush (void)
 Delete all records of the notification database.
 

Detailed Description

BlobDB front end of notification storage (BlobDBIdNotifs).

Function Documentation

◆ notif_db_delete()

status_t notif_db_delete ( const uint8_t *  key,
int  key_len 
)

Delete a record from the notification database.

The key is the notification UUID.

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

◆ notif_db_flush()

status_t notif_db_flush ( void  )

Delete all records of the notification database.

Returns
S_SUCCESS on success, an error code otherwise.

◆ notif_db_get_len()

int notif_db_get_len ( const uint8_t *  key,
int  key_len 
)

Get the length of a record in the notification database.

The key is the notification UUID.

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.

◆ notif_db_init()

void notif_db_init ( void  )

Initialize the notification database.

◆ notif_db_insert()

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

Insert or replace a record in the notification database.

The key is the notification UUID and the value a serialized timeline item. A new notification is stored and announced; for an existing one only the status bits are updated. New notifications that already carry status bits are ignored.

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.

◆ notif_db_read()

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

Read a record from the notification database.

Not implemented: returns S_SUCCESS without writing to val_out.

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.