-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathprotocol.txt
206 lines (169 loc) · 7.88 KB
/
protocol.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
First byte (dictionary entry 0) is always uint8 representing destination module
Second byte (dictionary entry 1) is always uint8 representing packet id for that module
Pebble --> Phone
MODULE 0 - SYSTEM
Packet 0 - Init packet
Sent from Pebble when app is opened. Phone should respond to that by sending config.
Additional data:
2 = Watchapp version - uint16
3 = Watch capabilities - uint32
Bit 0 (0x01) - Does watch have microphone
Bit 1 (0x02) - Does watch have color screen
Bit 2 (0x04) - Does watch have round screen
Bit 3 (0x08) - Does watch support smartstraps
Bit 4 (0x10) - Does watch support Pebble Health
Bits 15-31 - Unsigned 16-bit integer representing number of maximum bytes that can fit into one appmessage
4 = Full screen image width (uint16)
5 = Full screen image height (uint16)
Packet 1 - Menu item picked
Sent when user picks entry in main menu
Additional data:
2 = Picked entry (0 = Call History, 1 = All contacts, 2,3,4 etc. = groups) - uint8
Packet 2 - Close app
Informs android app that it should close watchapp or switch to previous app depending on settings.
No additional data
MODULE 1 - CALL
Packet 0 - In call action
Sent when action is executed on call screen
Additional data:
2 = Action ID (0 = UP press, 1 = SELECT press, 2 = DOWN press, 3 = UP hold, 4 = SELECT hold, 5 = DOWN hold, 6 = Shake) - uint8.
MODULE 2 - CALL LOG
Packet 0 - Request call log entry
Sent from pebble when loading call log.
Additional data:
2 = ID of the entry to receive - uint16.
Packet 1 - Picked call log entry
Sent from pebble when user call log entry.
Additional data:
2 = Index of number picked on Pebble - int16.
3 = Should I call number or retrieve other numbers of specified contact (0 or 1) - uint8
MODULE 3 - CONTACTS
Packet 0 - Filtering button pressed
When in filtering mode, button is pressed
Additional data:
2 = Which button is pressed (0 = UP, 1 = SELECT, 2 = DOWN, 3 = BACK (Reset)) - uint8.
Packet 1 - Request contacts
Sent from pebble when requesting contact names. Same as packet 3, but not used when filtering.
Additional data:
2 = From which id should Phone start sending those names (for example if this is 1, phone will send contacts 1-3) - uint16.
Packet 2 - Picked contact
Sent from pebble when user picks contact.
Additional data:
2 = Index of contact picked on Pebble - int16.
MODULE 4 - NUMBER LIST
Packet 0 - Request contact numbers
Sent from pebble when requesting numbers. Same as packet 5, but for requesting numbers of specific contact.
Additional data:
2 = From which id should Phone start sending those numbers (for example if this is 1, phone will send numbers 1-2) - uint16.
Packet 1 - Picked number
Sent from pebble when user picks number.
Additional data:
2 = Index of number picked on Pebble - int16.
MODULE 5 - SMS Replies
Packet 0 - Action list item picked
Additional data:
2 = index of picked item - uint8
Packet 1 - Reply text (from tertiary text)
Additional data:
2 = text (string)
Phone --> Pebble
If dictionary entry 999 is present, pebble will automatically switch to destination module (for example automatically switch to call screen when received call packet).
MODULE 0 - SYSTEM
Packet 0 - Pebble settings (Invalid Version)
Sent instead of the regular settings packet if watchapp protocol version mismatches phone protocol version
Additional data:
2 = Config (byte array)
[0] = Compatible watchapp version (first byte)
[1] = Compatible watchapp version (second byte)
Packet 0 - Pebble settings
Sends all settings to Pebble
Additional data:
2 = Config (byte array)
[0] = Compatible watchapp version (first byte)
[1] = Compatible watchapp version (second byte)
[2] = Flags
First bit (0x01) = When set to 1, do not display menu (call is active)
Second bit (0x02) = Display closing screen (needed for "switch to last app" feature)
Third bit (0x04) = Should I skip filtering with contact groups (1 or 0)
Fourth bit (0x08) = Should I turn on backlight when call window loads
Fifth bit (0x10) = Should I disable vibration when Pebble is charging
Sixth bit (0x20) = Enable call timer
Seventh bit (0x40) = Enable outgoing call popup
[3] = Number of contact groups displayed in the menu
[4] = Timer font (0-17)
[5] = Calee name font (0-17)
[6] = Calee number type font (0-17)
[7] = Calee number font (0-17)
Packet 1 - Menu groups data
Names of contact groups displayed in dialer menu. It can transfer up to 3 names.
Additional data:
2 = ID of the first group in this packet (uint8)
3 = Name of the group (cstring, up to 20 characters)
4 = Name of the group (cstring, up to 20 characters)
5 = Name of the group (cstring, up to 20 characters)
Packet 2 - Show close screen
Sent to Pebble to display closing screen
No additional data
MODULE 1 - CALL
Packet 0 - Call info
Additional data:
2 = Number Type (cstring - up to 30 characters)
3 = Number (cstring - up to 30 characters)
4 = Various flags (byte array, 10+ bytes)
[0] = If in call (0 = incoming call, 1 = call connected)
[1] = Name display position (0 = center, 1 = bottom (replaces number)
[2] = Top action bar icon ID
[3] = Middle action bar icon ID
[4] = Bottom action bar icon ID
[6] = Should I prepare to update caller image (1 = yes, 0 = no)
[7] = Number of bytes in vibration pattern
[8, 9, ...] = Vibration pattern (up to 40 bytes, two bytes make uint16)
6 = Elapsed seconds. Only sent when in call, not when ringing. (uint16)
7 = Size of the caller image in bytes (only for color watches. If value is 0, no image will be displayed. uint16).
Packet 1 - Caller name
Sent after Call info packet
Additional data:
2 = Name (cstring - up to 100 characters)
Packet 2 - Caller image part (Only for color watches)
2 = Size of the data in this packet (uint16)
3 = Image data (byte array, part of PNG image format.)
MODULE 2 - CALL LOG
Packet 0 - call log received
Received one entry of the call log
Additional data:
2 = ID of the entry in this packet (uint16)
3 = Number of all call log entries (uint16)
4 = Log entry type (1 = incoming, 2 = outgoing, 3 = missed)
5 = Contact name (cstring, up to 20 characters)
6 = Date (cstring, up to 20 characters)
7 = Number (cstring, up to 20 characters)
MODULE 3 - CONTACTS
Packet 0 - contacts received
Names of contacts in the list
Additional data:
2 = ID of the first contact in this packet (uint16)
3 = Number of all contacts (uint16)
4 = Name of the contact (cstring, up to 20 characters)
5 = Name of the contact (cstring, up to 20 characters)
6 = Name of the contact (cstring, up to 20 characters)
MODULE 4 - NUMBERS
Packet 0 - numbers received
Types and numbers in the list. Sends two numbers per packet.
Additional data:
2 = ID of the first contact in this packet (uint16)
3 = Number of all filtering contacts (uint16)
4 = Number type (cstring, up to 15 characters)
5 = Number type (cstring, up to 15 characters)
6 = Number (cstring, up to 15 characters)
7 = Number (cstring, up to 15 characters)
8 = uint8 array
[0] = Number action type (0 = Call, 1 = Send SMS)
[1] = Number action type (0 = Call, 1 = Send SMS)
MODULE 5 - SMS Replies
Packet 0 - Action list names - Names of items in action list
Additional data:
2 = array of uint8
[0] = Index of the first canned reponse in this packet
[1] = Amount of all actions in the list
[2] = Should I display tertiary text window instead of menu (1 or 0)
3 = Names (up to 4) - multiple null-terminated strings (up to 19 chars each) in one byte array