|
PebbleOS
|
BlobDB Pebble Protocol definitions. More...
Macros | |
| #define | RESPONSE_MASK (1 << 7) |
| Bit set in the command of a response. | |
Typedefs | |
| typedef uint16_t | BlobDBToken |
| Message token, echoed in responses to match them with requests. | |
Functions | |
| const uint8_t * | endpoint_private_read_token_db_id (const uint8_t *iter, BlobDBToken *out_token, BlobDBId *out_db_id) |
| Parse the token and database id at the start of a message body. | |
| void | blob_db_enabled (bool enabled) |
| Enable or disable message handling on both BlobDB endpoints. | |
BlobDB Pebble Protocol definitions.
The phone writes on endpoint 0xb1db and sync runs on 0xb2db; see docs/reference/blob-db.md for message layouts.
| #define RESPONSE_MASK (1 << 7) |
Bit set in the command of a response.
| typedef uint16_t BlobDBToken |
Message token, echoed in responses to match them with requests.
| enum BlobDBCommand |
Commands.
| Enumerator | |
|---|---|
| BLOB_DB_COMMAND_INSERT | Insert a record. |
| BLOB_DB_COMMAND_READ | Read a record; not implemented. |
| BLOB_DB_COMMAND_UPDATE | Update a record; not implemented. |
| BLOB_DB_COMMAND_DELETE | Delete a record. |
| BLOB_DB_COMMAND_CLEAR | Delete all records of a database. |
| BLOB_DB_COMMAND_DIRTY_DBS | List databases with dirty records. This and the following commands belong to sync; not every phone supports them. |
| BLOB_DB_COMMAND_START_SYNC | Start syncing a database. |
| BLOB_DB_COMMAND_WRITE | Watch write of a single record. |
| BLOB_DB_COMMAND_WRITEBACK | Watch write-back of a dirty record during a database sync. |
| BLOB_DB_COMMAND_SYNC_DONE | Database sync finished. |
| BLOB_DB_COMMAND_VERSION | Protocol version query. |
| BLOB_DB_COMMAND_DIRTY_ALL | Mark all records dirty; only supported by the settings database. |
| BLOB_DB_COMMAND_INSERT_WITH_TIMESTAMP | Insert a record unless the watch copy is newer. |
| BLOB_DB_COMMAND_DIRTY_DBS_RESPONSE | Response to BLOB_DB_COMMAND_DIRTY_DBS. |
| BLOB_DB_COMMAND_START_SYNC_RESPONSE | Response to BLOB_DB_COMMAND_START_SYNC. |
| BLOB_DB_COMMAND_WRITE_RESPONSE | Response to BLOB_DB_COMMAND_WRITE. |
| BLOB_DB_COMMAND_WRITEBACK_RESPONSE | Response to BLOB_DB_COMMAND_WRITEBACK. |
| BLOB_DB_COMMAND_SYNC_DONE_RESPONSE | Response to BLOB_DB_COMMAND_SYNC_DONE. |
| BLOB_DB_COMMAND_VERSION_RESPONSE | Response to BLOB_DB_COMMAND_VERSION. |
| enum BlobDBResponse |
Response codes.
| void blob_db_enabled | ( | bool | enabled | ) |
Enable or disable message handling on both BlobDB endpoints.
While disabled, commands are answered with BLOB_DB_TRY_LATER.
| enabled | true to accept messages. |
| const uint8_t * endpoint_private_read_token_db_id | ( | const uint8_t * | iter, |
| BlobDBToken * | out_token, | ||
| BlobDBId * | out_db_id | ||
| ) |
Parse the token and database id at the start of a message body.
| iter | Message body, after the command byte. | |
| [out] | out_token | Token. |
| [out] | out_db_id | Database id. |