BlobDB is the key-value store the phone uses to push data to the watch
(notifications, timeline pins, app metadata, weather, settings, …). Two
Pebble Protocol endpoints speak it: 0xb1db for phone-initiated writes
(fw/services/blob_db/endpoint.c) and 0xb2db for watch-initiated
sync (fw/services/blob_db/endpoint2.c). Command opcodes and
response codes are in include/pbl/services/blob_db/endpoint_private.h,
database ids in include/pbl/services/blob_db/api.h. All multi-byte
fields are little-endian.
0xb1db)Every message starts with a uint8_t command and a uint16_t token the
watch echoes in its response. Keys and values are length-prefixed:
uint8_t key_size + key bytes, uint16_t value_size + value bytes.
Command |
Opcode |
Body after token |
|---|---|---|
INSERT |
|
database id ( |
DELETE |
|
database id, key |
CLEAR |
|
database id — drops all entries |
INSERT_WITH_TIMESTAMP |
|
database id, |
0x02 (READ) and 0x03 (UPDATE) are defined but not implemented.
INSERT_WITH_TIMESTAMP is for conflict resolution: if the watch’s copy is
newer, it answers DATA_STALE and the phone should re-sync. The timestamp
is currently only honored for the Settings database; other databases
treat it as a plain INSERT.
The watch responds to every command with uint16_t token +
uint8_t response code:
Code |
Meaning |
|---|---|
|
SUCCESS |
|
GENERAL_FAILURE |
|
INVALID_OPERATION |
|
INVALID_DATABASE_ID |
|
INVALID_DATA |
|
KEY_DOES_NOT_EXIST |
|
DATABASE_FULL |
|
DATA_STALE |
|
DB_NOT_SUPPORTED |
|
DB_LOCKED |
|
TRY_LATER (endpoint not accepting writes yet) |
0xb2db)Opcodes 0x06–0x0C (DIRTY_DBS, START_SYNC, WRITE, WRITEBACK,
SYNC_DONE, VERSION, DIRTY_ALL) implement watch→phone writeback of dirty
records; responses to these set bit 7 of the opcode. VERSION reports the
protocol version (currently 1). Message layouts are the packed structs
in endpoint2.c.
Id |
Database |
Id |
Database |
|---|---|---|---|
|
Test |
|
Prefs |
|
Pins |
|
Contacts |
|
Apps |
|
WatchAppPrefs |
|
Reminders |
|
Health |
|
Notifs |
|
AppGlance |
|
Weather |
|
Settings |
|
iOSNotifPref |
New databases register a BlobDBId and an entry in s_blob_dbs in
fw/services/blob_db/api.c.
Generated from PebbleOS 91af4a22c. This page is maintained in the pebbleos repository: docs/reference/blob-db.md.