Open hexaguin opened 8 years ago
Updated to use packet IDs for everything.
value 0 is always module, 1 is always packet ID
pebble -> phone:
Module 0: System. Used to check for matching versions, and automatically causes the phone to send a list of reminders.
ID 0: Protocol version
uint16 2: Protocol version
Module 1: Request
ID 0: Menu begining. Asks the phone to send the first (MenuBuffer) notes. Has no extra data.
ID 1: Specific list item
uint16 2: Item position in list
ID 2: Full note
uint16 2: Item position in list
ID 3: Total number of notes. Has no extra data.
phone -> pebble:
Module 0: System
ID 0: Protocol version
uint16 2: Protocol version
ID 1: Error
uint16 2: Error type. 0 is protocol mismatch.
Module 1: Note list
ID 0: Note list item
uint16 2: Note position in list
cstring 3: Note title. Probably doesn't need to be truncated.
cstring 4: Note body. Truncated, since this is just the second line of the menu item, not a full view of the note.
ID 1: Total number of notes
uint16 2: Number of notes
Module 2: Full note
ID 0: Note contents
uint 2: End of note. 0 if this is not the end of the note, 1 if it is.
cstring 3: Note title if this is the first part of the note. Single null character if it is a continuation.
cstring 4: Note body
The main limitation right now is a lack of flexibility in terms of watch-phone communication. Here is a draft of a new protocol:
Constants: MenuBuffer: 50. Number of notes for the pebble to store at once. Will need experimentation to determine how big this can safely be. Maybe make this platform-specific later? (e.g. Aplite has a smaller buffer, Basalt and Chalk larger, and when the Time 2 and Pebble 2 come out, they could have even larger buffers).
Basic startup behavior:
Other behavior:
Edit: replaced "packet type" with "packet ID"