6 package com.google.appinventor.components.runtime.util;
15 public static class Opcode {
16 public static final byte ERROR = (byte) 0x00;
17 public static final byte NOP = (byte) 0x01;
18 public static final byte PROGRAM_STOP = (byte) 0x02;
19 public static final byte PROGRAM_START = (byte) 0x03;
20 public static final byte OBJECT_STOP = (byte) 0x04;
21 public static final byte OBJECT_START = (byte) 0x05;
22 public static final byte OBJECT_TRIG = (byte) 0x06;
23 public static final byte OBJECT_WAIT = (byte) 0x07;
24 public static final byte RETURN = (byte) 0x08;
25 public static final byte CALL = (byte) 0x09;
26 public static final byte OBJECT_END = (byte) 0x0A;
27 public static final byte SLEEP = (byte) 0x0B;
28 public static final byte PROGRAM_INFO = (byte) 0x0C;
29 public static final byte LABEL = (byte) 0x0D;
30 public static final byte PROBE = (byte) 0x0E;
31 public static final byte DO = (byte) 0x0F;
33 public static final byte ADD8 = (byte) 0x10;
34 public static final byte ADD16 = (byte) 0x11;
35 public static final byte ADD32 = (byte) 0x12;
36 public static final byte ADDF = (byte) 0x13;
38 public static final byte SUB8 = (byte) 0x14;
39 public static final byte SUB16 = (byte) 0x15;
40 public static final byte SUB32 = (byte) 0x16;
41 public static final byte SUBF = (byte) 0x17;
43 public static final byte MUL8 = (byte) 0x18;
44 public static final byte MUL16 = (byte) 0x19;
45 public static final byte MUL32 = (byte) 0x1A;
46 public static final byte MULF = (byte) 0x1B;
48 public static final byte DIV8 = (byte) 0x1C;
49 public static final byte DIV16 = (byte) 0x1D;
50 public static final byte DIV32 = (byte) 0x1E;
51 public static final byte DIVF = (byte) 0x1F;
54 public static final byte OR8 = (byte) 0x20;
55 public static final byte OR16 = (byte) 0x21;
56 public static final byte OR32 = (byte) 0x22;
58 public static final byte AND8 = (byte) 0x24;
59 public static final byte AND16 = (byte) 0x25;
60 public static final byte AND32 = (byte) 0x26;
62 public static final byte XOR8 = (byte) 0x28;
63 public static final byte XOR16 = (byte) 0x29;
64 public static final byte XOR32 = (byte) 0x2A;
66 public static final byte RL8 = (byte) 0x2C;
67 public static final byte RL16 = (byte) 0x2D;
68 public static final byte RL32 = (byte) 0x2E;
69 public static final byte INIT_BYTES = (byte) 0x2F;
72 public static final byte MOVE8_8 = (byte) 0x30;
73 public static final byte MOVE8_16 = (byte) 0x31;
74 public static final byte MOVE8_32 = (byte) 0x32;
75 public static final byte MOVE8_F = (byte) 0x33;
77 public static final byte MOVE16_8 = (byte) 0x34;
78 public static final byte MOVE16_16 = (byte) 0x35;
79 public static final byte MOVE16_32 = (byte) 0x36;
80 public static final byte MOVE16_F = (byte) 0x37;
82 public static final byte MOVE32_8 = (byte) 0x38;
83 public static final byte MOVE32_16 = (byte) 0x39;
84 public static final byte MOVE32_32 = (byte) 0x3A;
85 public static final byte MOVE32_F = (byte) 0x3B;
87 public static final byte MOVEF_8 = (byte) 0x3C;
88 public static final byte MOVEF_16 = (byte) 0x3D;
89 public static final byte MOVEF_32 = (byte) 0x3E;
90 public static final byte MOVEF_F = (byte) 0x3F;
92 public static final byte JR = (byte) 0x40;
93 public static final byte JR_FALSE = (byte) 0x41;
94 public static final byte JR_TRUE = (byte) 0x42;
95 public static final byte JR_NAN = (byte) 0x43;
98 public static final byte CP_LT8 = (byte) 0x44;
99 public static final byte CP_LT16 = (byte) 0x45;
100 public static final byte CP_LT32 = (byte) 0x46;
101 public static final byte CP_LTF = (byte) 0x47;
103 public static final byte CP_GT8 = (byte) 0x48;
104 public static final byte CP_GT16 = (byte) 0x49;
105 public static final byte CP_GT32 = (byte) 0x4A;
106 public static final byte CP_GTF = (byte) 0x4B;
108 public static final byte CP_EQ8 = (byte) 0x4C;
109 public static final byte CP_EQ16 = (byte) 0x4D;
110 public static final byte CP_EQ32 = (byte) 0x4E;
111 public static final byte CP_EQF = (byte) 0x4F;
113 public static final byte CP_NEQ8 = (byte) 0x50;
114 public static final byte CP_NEQ16 = (byte) 0x51;
115 public static final byte CP_NEQ32 = (byte) 0x52;
116 public static final byte CP_NEQF = (byte) 0x53;
118 public static final byte CP_LTEQ8 = (byte) 0x54;
119 public static final byte CP_LTEQ16 = (byte) 0x55;
120 public static final byte CP_LTEQ32 = (byte) 0x56;
121 public static final byte CP_LTEQF = (byte) 0x57;
123 public static final byte CP_GTEQ8 = (byte) 0x58;
124 public static final byte CP_GTEQ16 = (byte) 0x59;
125 public static final byte CP_GTEQ32 = (byte) 0x5A;
126 public static final byte CP_GTEQF = (byte) 0x5B;
128 public static final byte SELECT8 = (byte) 0x5C;
129 public static final byte SELECT16 = (byte) 0x5D;
130 public static final byte SELECT32 = (byte) 0x5E;
131 public static final byte SELECTF = (byte) 0x5F;
132 public static final byte SYSTEM = (byte) 0x60;
133 public static final byte PORT_CNV_OUTPUT = (byte) 0x61;
134 public static final byte PORT_CNV_INPUT = (byte) 0x62;
135 public static final byte NOTE_TO_FREQ = (byte) 0x63;
142 public static final byte JR_LT8 = (byte) 0x64;
143 public static final byte JR_LT16 = (byte) 0x65;
144 public static final byte JR_LT32 = (byte) 0x66;
145 public static final byte JR_LTF = (byte) 0x67;
147 public static final byte JR_GT8 = (byte) 0x68;
148 public static final byte JR_GT16 = (byte) 0x69;
149 public static final byte JR_GT32 = (byte) 0x6A;
150 public static final byte JR_GTF = (byte) 0x6B;
152 public static final byte JR_EQ8 = (byte) 0x6C;
153 public static final byte JR_EQ16 = (byte) 0x6D;
154 public static final byte JR_EQ32 = (byte) 0x6E;
155 public static final byte JR_EQF = (byte) 0x6F;
157 public static final byte JR_NEQ8 = (byte) 0x70;
158 public static final byte JR_NEQ16 = (byte) 0x71;
159 public static final byte JR_NEQ32 = (byte) 0x72;
160 public static final byte JR_NEQF = (byte) 0x73;
162 public static final byte JR_LTEQ8 = (byte) 0x74;
163 public static final byte JR_LTEQ16 = (byte) 0x75;
164 public static final byte JR_LTEQ32 = (byte) 0x76;
165 public static final byte JR_LTEQF = (byte) 0x77;
167 public static final byte JR_GTEQ8 = (byte) 0x78;
168 public static final byte JR_GTEQ16 = (byte) 0x79;
169 public static final byte JR_GTEQ32 = (byte) 0x7A;
170 public static final byte JR_GTEQF = (byte) 0x7B;
171 public static final byte INFO = (byte) 0x7C;
172 public static final byte STRINGS = (byte) 0x7D;
173 public static final byte MEMORY_WRITE = (byte) 0x7E;
174 public static final byte MEMORY_READ = (byte) 0x7F;
177 public static final byte UI_FLUSH = (byte) 0x80;
178 public static final byte UI_READ = (byte) 0x81;
179 public static final byte UI_WRITE = (byte) 0x82;
180 public static final byte UI_BUTTON = (byte) 0x83;
181 public static final byte UI_DRAW = (byte) 0x84;
182 public static final byte TIMER_WAIT = (byte) 0x85;
183 public static final byte TIMER_READY = (byte) 0x86;
184 public static final byte TIMER_READ = (byte) 0x87;
186 public static final byte BP0 = (byte) 0x88;
187 public static final byte BP1 = (byte) 0x89;
188 public static final byte BP2 = (byte) 0x8A;
189 public static final byte BP3 = (byte) 0x8B;
190 public static final byte BP_SET = (byte) 0x8C;
191 public static final byte MATH = (byte) 0x8D;
192 public static final byte RANDOM = (byte) 0x8E;
193 public static final byte TIMER_READ_US = (byte) 0x8F;
194 public static final byte KEEP_ALIVE = (byte) 0x90;
196 public static final byte COM_READ = (byte) 0x91;
197 public static final byte COM_WRITE = (byte) 0x92;
199 public static final byte SOUND = (byte) 0x94;
200 public static final byte SOUND_TEST = (byte) 0x95;
201 public static final byte SOUND_READY = (byte) 0x96;
203 public static final byte INPUT_SAMPLE = (byte) 0x97;
205 public static final byte INPUT_DEVICE_LIST = (byte) 0x98;
206 public static final byte INPUT_DEVICE = (byte) 0x99;
207 public static final byte INPUT_READ = (byte) 0x9A;
208 public static final byte INPUT_TEST = (byte) 0x9B;
209 public static final byte INPUT_READY = (byte) 0x9C;
210 public static final byte INPUT_READSI = (byte) 0x9D;
211 public static final byte INPUT_READEXT = (byte) 0x9E;
212 public static final byte INPUT_WRITE = (byte) 0x9F;
214 public static final byte OUTPUT_GET_TYPE = (byte) 0xA0;
215 public static final byte OUTPUT_SET_TYPE = (byte) 0xA1;
216 public static final byte OUTPUT_RESET = (byte) 0xA2;
217 public static final byte OUTPUT_STOP = (byte) 0xA3;
218 public static final byte OUTPUT_POWER = (byte) 0xA4;
219 public static final byte OUTPUT_SPEED = (byte) 0xA5;
220 public static final byte OUTPUT_START = (byte) 0xA6;
221 public static final byte OUTPUT_POLARITY = (byte) 0xA7;
222 public static final byte OUTPUT_READ = (byte) 0xA8;
223 public static final byte OUTPUT_TEST = (byte) 0xA9;
224 public static final byte OUTPUT_READY = (byte) 0xAA;
225 public static final byte OUTPUT_POSITION = (byte) 0xAB;
226 public static final byte OUTPUT_STEP_POWER = (byte) 0xAC;
227 public static final byte OUTPUT_TIME_POWER = (byte) 0xAD;
228 public static final byte OUTPUT_STEP_SPEED = (byte) 0xAE;
229 public static final byte OUTPUT_TIME_SPEED = (byte) 0xAF;
230 public static final byte OUTPUT_STEP_SYNC = (byte) 0xB0;
231 public static final byte OUTPUT_TIME_SYNC = (byte) 0xB1;
232 public static final byte OUTPUT_CLR_COUNT = (byte) 0xB2;
233 public static final byte OUTPUT_GET_COUNT = (byte) 0xB3;
234 public static final byte OUTPUT_PRG_STOP = (byte) 0xB4;
236 public static final byte FILE = (byte) 0xC0;
237 public static final byte ARRAY = (byte) 0xC1;
238 public static final byte ARRAY_WRITE = (byte) 0xC2;
239 public static final byte ARRAY_READ = (byte) 0xC3;
240 public static final byte ARRAY_APPEND = (byte) 0xC4;
241 public static final byte MEMORY_USAGE = (byte) 0xC5;
242 public static final byte FILENAME = (byte) 0xC6;
244 public static final byte READ8 = (byte) 0xC8;
245 public static final byte READ16 = (byte) 0xC9;
246 public static final byte READ32 = (byte) 0xCA;
247 public static final byte READF = (byte) 0xCB;
249 public static final byte WRITE8 = (byte) 0xCC;
250 public static final byte WRITE16 = (byte) 0xCD;
251 public static final byte WRITE32 = (byte) 0xCE;
252 public static final byte WRITEF = (byte) 0xCF;
254 public static final byte COM_READY = (byte) 0xD0;
255 public static final byte COM_READDATA = (byte) 0xD1;
256 public static final byte COM_WRITEDATA = (byte) 0xD2;
257 public static final byte COM_GET = (byte) 0xD3;
258 public static final byte COM_SET = (byte) 0xD4;
259 public static final byte COM_TEST = (byte) 0xD5;
260 public static final byte COM_REMOVE = (byte) 0xD6;
261 public static final byte COM_WRITEFILE = (byte) 0xD7;
263 public static final byte MAILBOX_OPEN = (byte) 0xD8;
264 public static final byte MAILBOX_WRITE = (byte) 0xD9;
265 public static final byte MAILBOX_READ = (byte) 0xDA;
266 public static final byte MAILBOX_TEST = (byte) 0xDB;
267 public static final byte MAILBOX_READY = (byte) 0xDC;
268 public static final byte MAILBOX_CLOSE = (byte) 0xDD;
270 public static final byte TST = (byte) 0xFF;
273 public static class InputDeviceSubcode {
274 public static final byte GET_FORMAT = 2;
275 public static final byte CAL_MINMAX = 3;
276 public static final byte CAL_DEFAULT = 4;
277 public static final byte GET_TYPEMODE = 5;
278 public static final byte GET_SYMBOL = 6;
279 public static final byte CAL_MIN = 7;
280 public static final byte CAL_MAX = 8;
281 public static final byte SETUP = 9;
282 public static final byte CLR_ALL = 10;
283 public static final byte GET_RAW = 11;
284 public static final byte GET_CONNECTION = 12;
285 public static final byte STOP_ALL = 13;
286 public static final byte GET_NAME = 21;
287 public static final byte GET_MODENAME = 22;
288 public static final byte SET_RAW = 23;
289 public static final byte GET_FIGURES = 24;
290 public static final byte GET_CHANGES = 25;
291 public static final byte CLR_CHANGES = 26;
292 public static final byte READY_PCT = 27;
293 public static final byte READY_RAW = 28;
294 public static final byte READY_SI = 29;
295 public static final byte GET_MINMAX = 30;
296 public static final byte GET_BUMPS = 31;
299 public static class SoundSubcode {
300 public static final byte BREAK = 0;
301 public static final byte TONE = 1;
302 public static final byte PLAY = 2;
303 public static final byte REPEAT = 3;
304 public static final byte SERVICE = 4;
307 public static class UIWriteSubcode {
308 public static final byte WRITE_FLUSH = 1;
309 public static final byte FLOATVALUE = 2;
310 public static final byte STAMP = 3;
311 public static final byte PUT_STRING = 8;
312 public static final byte VALUE8 = 9;
313 public static final byte VALUE16 = 10;
314 public static final byte VALUE32 = 11;
315 public static final byte VALUEF = 12;
316 public static final byte ADDRESS = 13;
317 public static final byte CODE = 14;
318 public static final byte DOWNLOAD_END = 15;
319 public static final byte SCREEN_BLOCK = 16;
320 public static final byte TEXTBOX_APPEND = 21;
321 public static final byte SET_BUSY = 22;
322 public static final byte SET_TESTPIN = 24;
323 public static final byte INIT_RUN = 25;
324 public static final byte UPDATE_RUN = 26;
325 public static final byte LED = 27;
326 public static final byte POWER = 29;
327 public static final byte GRAPH_SAMPLE = 30;
328 public static final byte TERMINAL = 31;
331 public static class UIReadSubcode {
332 public static final byte GET_VBATT = 1;
333 public static final byte GET_IBATT = 2;
334 public static final byte GET_OS_VERS = 3;
335 public static final byte GET_EVENT = 4;
336 public static final byte GET_TBATT = 5;
337 public static final byte GET_IINT = 6;
338 public static final byte GET_IMOTOR = 7;
339 public static final byte GET_STRING = 8;
340 public static final byte GET_HW_VERS = 9;
341 public static final byte GET_FW_VERS = 10;
342 public static final byte GET_FW_BUILD = 11;
343 public static final byte GET_OS_BUILD = 12;
344 public static final byte GET_ADDRESS = 13;
345 public static final byte GET_CODE = 14;
346 public static final byte KEY = 15;
347 public static final byte GET_SHUTDOWN = 16;
348 public static final byte GET_WARNING = 17;
349 public static final byte GET_LBATT = 18;
350 public static final byte TEXTBOX_READ = 21;
351 public static final byte GET_VERSION = 26;
352 public static final byte GET_IP = 27;
353 public static final byte GET_POWER = 29;
354 public static final byte GET_SDCARD = 30;
355 public static final byte GET_USBSTICK = 31;
358 public static class UIButtonSubcode {
359 public static final byte SHORTPRESS = 1;
360 public static final byte LONGPRESS = 2;
361 public static final byte WAIT_FOR_PRESS = 3;
362 public static final byte FLUSH = 4;
363 public static final byte PRESS = 5;
364 public static final byte RELEASE = 6;
365 public static final byte GET_HORZ = 7;
366 public static final byte GET_VERT = 8;
367 public static final byte PRESSED = 9;
368 public static final byte SET_BACK_BLOCK = 10;
369 public static final byte GET_BACK_BLOCK = 11;
370 public static final byte TESTSHORTPRESS = 12;
371 public static final byte TESTLONGPRESS = 13;
372 public static final byte GET_BUMBED = 14;
373 public static final byte GET_CLICK = 15;
376 public static class UIDrawSubcode {
377 public static final byte UPDATE = 0;
378 public static final byte CLEAN = 1;
379 public static final byte PIXEL = 2;
380 public static final byte LINE = 3;
381 public static final byte CIRCLE = 4;
382 public static final byte TEXT = 5;
383 public static final byte ICON = 6;
384 public static final byte PICTURE = 7;
385 public static final byte VALUE = 8;
386 public static final byte FILLRECT = 9;
387 public static final byte RECT = 10;
388 public static final byte NOTIFICATION = 11;
389 public static final byte QUESTION = 12;
390 public static final byte KEYBOARD = 13;
391 public static final byte BROWSE = 14;
392 public static final byte VERTBAR = 15;
393 public static final byte INVERSERECT = 16;
394 public static final byte SELECT_FONT = 17;
395 public static final byte TOPLINE = 18;
396 public static final byte FILLWINDOW = 19;
397 public static final byte SCROLL = 20;
398 public static final byte DOTLINE = 21;
399 public static final byte VIEW_VALUE = 22;
400 public static final byte VIEW_UNIT = 23;
401 public static final byte FILLCIRCLE = 24;
402 public static final byte STORE = 25;
403 public static final byte RESTORE = 26;
404 public static final byte ICON_QUESTION = 27;
405 public static final byte BMPFILE = 28;
406 public static final byte POPUP = 29;
407 public static final byte GRAPH_SETUP = 30;
408 public static final byte GRAPH_DRAW = 31;
409 public static final byte TEXTBOX = 32;
412 public static class FontType {
413 public static final byte NORMAL_FONT = 0;
414 public static final byte SMALL_FONT = 1;
415 public static final byte LARGE_FONT = 2;
416 public static final byte TINY_FONT = 3;
419 public static class DataFormat {
427 public static final byte DATA_PCT = 0x10;
428 public static final byte DATA_RAW = 0x12;
429 public static final byte DATA_SI = 0x13;
432 public static class SystemCommandType {
433 public static final byte SYSTEM_COMMAND_REPLY = (byte) 0x01;
434 public static final byte SYSTEM_COMMAND_NO_REPLY = (byte) 0x81;
437 public static class SystemCommand {
438 public static final byte BEGIN_DOWNLOAD = (byte) 0x92;
439 public static final byte CONTINUE_DOWNLOAD = (byte) 0x93;
440 public static final byte BEGIN_UPLOAD = (byte) 0x94;
441 public static final byte CONTINUE_UPLOAD = (byte) 0x95;
442 public static final byte BEGIN_GETFILE = (byte) 0x96;
443 public static final byte CONTINUE_GETFILE = (byte) 0x97;
444 public static final byte CLOSE_FILEHANDLE = (byte) 0x98;
445 public static final byte LIST_FILES = (byte) 0x99;
446 public static final byte CONTINUE_LIST_FILES = (byte) 0x9A;
447 public static final byte CREATE_DIR = (byte) 0x9B;
448 public static final byte DELETE_FILE = (byte) 0x9C;
449 public static final byte LIST_OPEN_HANDLES = (byte) 0x9D;
450 public static final byte WRITEMAILBOX = (byte) 0x9E;
451 public static final byte BLUETOOTHPIN = (byte) 0x9F;
452 public static final byte ENTERFWUPDATE = (byte) 0xA0;
455 public static class SystemReplyType {
456 public static final byte SYSTEM_REPLY = (byte) 0x03;
457 public static final byte SYSTEM_REPLY_ERROR = (byte) 0x05;
460 public static class SystemReplyStatus {
461 public static final byte SUCCESS = (byte) 0x00;
462 public static final byte UNKNOWN_HANDLE = (byte) 0x01;
463 public static final byte HANDLE_NOT_READY = (byte) 0x02;
464 public static final byte CORRUPT_FILE = (byte) 0x03;
465 public static final byte NO_HANDLES_AVAILABLE = (byte) 0x04;
466 public static final byte NO_PERMISSION = (byte) 0x05;
467 public static final byte ILLEGAL_PATH = (byte) 0x06;
468 public static final byte FILE_EXITS = (byte) 0x07;
469 public static final byte END_OF_FILE = (byte) 0x08;
470 public static final byte SIZE_ERROR = (byte) 0x09;
471 public static final byte UNKNOWN_ERROR = (byte) 0x0A;
472 public static final byte ILLEGAL_FILENAME = (byte) 0x0B;
473 public static final byte ILLEGAL_CONNECTION = (byte) 0x0C;
476 public static class DirectCommandType {
477 public static final byte DIRECT_COMMAND_REPLY = (byte) 0x00;
478 public static final byte DIRECT_COMMAND_NO_REPLY = (byte) 0x80;
481 public static class DirectReplyType {
482 public static final byte DIRECT_REPLY = (byte) 0x02;
483 public static final byte DIRECT_REPLY_ERROR = (byte) 0x04;