LMS 2012
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
c_com.h
Go to the documentation of this file.
1 /*
2  * LEGO® MINDSTORMS EV3
3  *
4  * Copyright (C) 2010-2013 The LEGO Group
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 
21 
22 #ifndef C_COM_H_
23 #define C_COM_H_
24 
25 #include <sys/types.h>
26 #include <dirent.h>
27 
28 
29 #include "lms2012.h"
30 
88  #define SYSTEM_COMMAND_REPLY 0x01 // System command, reply required
89  #define SYSTEM_COMMAND_NO_REPLY 0x81 // System command, reply not required
90  /*
91  Byte 5: System Command. see following defines */
92 
93  #define BEGIN_DOWNLOAD 0x92 // Begin file down load
94  #define CONTINUE_DOWNLOAD 0x93 // Continue file down load
95  #define BEGIN_UPLOAD 0x94 // Begin file upload
96  #define CONTINUE_UPLOAD 0x95 // Continue file upload
97  #define BEGIN_GETFILE 0x96 // Begin get bytes from a file (while writing to the file)
98  #define CONTINUE_GETFILE 0x97 // Continue get byte from a file (while writing to the file)
99  #define CLOSE_FILEHANDLE 0x98 // Close file handle
100  #define LIST_FILES 0x99 // List files
101  #define CONTINUE_LIST_FILES 0x9A // Continue list files
102  #define CREATE_DIR 0x9B // Create directory
103  #define DELETE_FILE 0x9C // Delete
104  #define LIST_OPEN_HANDLES 0x9D // List handles
105  #define WRITEMAILBOX 0x9E // Write to mailbox
106  #define BLUETOOTHPIN 0x9F // Transfer trusted pin code to brick
107  #define ENTERFWUPDATE 0xA0 // Restart the brick in Firmware update mode
108  #define SETBUNDLEID 0xA1 // Set Bundle ID for mode 2
109  #define SETBUNDLESEEDID 0xA2 // Set bundle seed ID for mode 2
110 
111 /*
112 
113  Byte 6 - n: Dependent on System Command
114 
115 
116 
117  System Command Response Bytes:
118  ,------,------,------,------,------,------,------,------,
119  |Byte 0|Byte 1|Byte 2|Byte 3| | | |Byte n|
120  '------'------'------'------'------'------'------'------'
121 
122  Byte 0 – 1: Reply size, Little Endian\n
123 
124  Byte 2 – 3: Message counter, Little Endian\n
125 
126  Byte 4: Reply type. see following defines */
127 
128  #define SYSTEM_REPLY 0x03 // System command reply
129  #define SYSTEM_REPLY_ERROR 0x05 // System command reply error
130 /*
131  Byte 5: System command this is the response to
132 
133  Byte 6: Reply status
134 */
135 
136  // SYSTEM command return codes
137  #define SUCCESS 0x00
138  #define UNKNOWN_HANDLE 0x01
139  #define HANDLE_NOT_READY 0x02
140  #define CORRUPT_FILE 0x03
141  #define NO_HANDLES_AVAILABLE 0x04
142  #define NO_PERMISSION 0x05
143  #define ILLEGAL_PATH 0x06
144  #define FILE_EXITS 0x07
145  #define END_OF_FILE 0x08
146  #define SIZE_ERROR 0x09
147  #define UNKNOWN_ERROR 0x0A
148  #define ILLEGAL_FILENAME 0x0B
149  #define ILLEGAL_CONNECTION 0x0C
150 
151 /*
152  Byte 7 - n: Response dependent on System Command
153 
154 
155  The example below is build around the host application (X3 software) that wants to send a file to a P-
156  Brick where the VM, Green layer and Black layer reference to the firmware architecture. The
157  architecture document below on the host side only consists of our current understanding of the
158  implementation. At this point we have chosen to reference to the firmware architecture instead of the 7
159  layer OSI model.
160 
161 
162  ,---------------------, ,---------------------,
163  | Host Application | | VM |
164  '----------,----------' ,---------> '---------------------' -----------,
165  v | |
166  Filename, Destination New file coming i v
167  | ^ Accept or decline
168  v | |
169  ,---------------------, '---------- ,---------------------, <----------'
170  | Brick Server | | Green Layer |
171  '----------,----------' ,---------> '---------------------' -----------,
172  v | |
173  Begin File D/L, Command size, Command type, Begin D/L, File size, Filename v
174  File size, Filename ^ Accept or decline, Handle
175  v | |
176  ,---------------------, '---------- ,---------------------, <----------'
177  | USB Driver | | Black Layer |
178  '----------,----------' '---------------------'
179  v ^
180  Command size, Command type, Begin D/L, File size, Filename ------>
181  <------ Command size, Command type, Handle
182  Command size, Command type, Continue D/L, Handle, Pay load ------>
183  <------ Command size, Command type
184  Command size, Command type, Continue D/L, Handle, Pay load ------>
185  <------ Command size, Command type
186  Command size, Command type, Continue D/L, Handle, Pay load ------>
187 
188 
189  Our current thoughts are as follows:
190  1. The host application initiates the communication by sending a request to the BrickServer that
191  the application wants to send a file. The parameters within this call will include: File name for
192  the file that should be send, and some description for the destination.
193  2. The brick server processes the request by sending a request to the USB driver which includes the
194  following parameter: Specific command (Begin down load), File size and file name.
195  3. The USB driver will send out a command including: Command size, Command byte (Begin
196  down load), File size and file name.
197  4. The P-bricks black layer with receive and validate the USB packages. It will transfer the
198  received packages up to the green layer.
199  5. The green layer will evaluate the packages and as it is a begin down load ask the VM if it is
200  okay to receive a packages now.
201  6. When the VM has replied OK to the green layer the green layer will ask the USB driver to
202  reply OK and include a handle number to use within next packages for this communication.
203  7. When the OK signal is received with the USB driver (On the host side) the host will start
204  transmitting additional data which include the follow parameters: Command size, Command
205  type, Command byte (Continue D/L), Handle, Pay load data.
206 
207  Command size: 2 bytes (Tells the amount of bytes which belongs to this specific command).
208  Command type: 1 byte
209  File size: 4 Bytes
210  Handle: 1 Byte
211 
212 
213  Additional consideration
214  Above scenario allows for having multiple file action running at the same time as we have a handle
215  which identifies which process new data relates to. It also allows for interleaved communication
216  during a potential long down load process. But our current knowledge and considerations are also that
217  interleaved commands and splitting up larger data chunks slows down Bluetooth communication a lot.
218  Bluetooth communication requires large data chunks to be pushed through the channel all the time
219  with as less packages division as possible. Therefore the command size parameter is also included to
220  enable sending larger data packages as one call.
221  Above protocol architecture enables implementing the following two different scenarios which
222  performs the same functionality (Sending a 60 Kbyte file to the brick):
223 
224  Scenario 1: (It is not possible to interleave during file down load) (60 K bytes data package):
225  1. Command size (0x06,0x00), Command type, Begin D/L, File size (0x60,0xEA,0x00,0x00), File Name (0x30)
226  2. Command size (0x62,0xEA), Command type, Continue D/L, Handle (0x01), Data ............
227 
228  Scenario 2 (This enables the host to interleave during file down load) (500 bytes data packages):
229  1. Command size (0x06,0x00),Command Type, Begin D/L, File size (0x60,0xEA,0x00,0x00), File Name (0x30)
230  2. Command size (0xF6,0x01), Command type, Continue D/L, Handle (0x01), Data ............
231  3. ..
232  4. ..
233  5. Command size (0xF6,0x01), Command type ,Continue D/L, Handle (0x01), Data ............
234 
235 
236 
237  - File Down Load
238  - Destination filename path is relative from "lms2012/sys"
239  - Destination folders are automatically created from filename path
240  - First folder name must be: "apps", "prjs" or "tools" (see \ref UIdesign)
241  - Second folder name in filename path must be equal to byte code executable name
242 
243  - File Upload (File read)
244  - BEGIN_UPLOAD and CONTINUE_UPLOAD closes automatically the file handle when file has been uploaded
245  - BEGIN_GETFILE and CONTINUE_GETFILE does not close the file handle when EOF has been reached
246  - CONTINUE_GETFILE does also return the complete file size
247 
248  - Directory upload
249  - LIST_FILES should work as long as list does not exceed 1014 bytes. CONTINUE_LISTFILES has NOT
250  been implemented yet.
251 
252  - File handles
253  - CLOSE_FILEHANDLE is partly implemented - hash is not working
254 
255 
256  Examples:
257 *********************************************************************************************************
258 
259  File down load:
260  ---------------
261 
262  Download file "../apps/tst/tst.rbf"
263 
264  BEGIN_DOWNLOAD:
265 
266  Bytes sent to brick:
267 
268  1C00xxxx0192xxxxxxxx2E2E2F617070732F7473742F7473742E72626600 (Hex)
269  bbbbmmmmttssllllllllnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
270 
271  bbbb = bytes in message, mm = message counter, tt = type of command, ss = system command,
272  llllllll = file length, nn.. = filename
273 
274 
275  Bytes received from brick:
276 
277  0600xxxx03920000 (Hex)
278  bbbbmmmmttssrrhh
279 
280  bbbb = bytes in message, mm = message counter, tt = type of command, ss = system command,
281  rr = return status, hh = handle to file
282 
283 
284  CONTINUE_DOWNLOAD:
285 
286  Bytes sent to brick:
287 
288  xxxxxxxx819300xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (Hex)
289  bbbbmmmmttsshhpppppppppppppppppppppppppppppppppppppppp
290 
291  bbbb = bytes in message, mm = message counter, tt = type of command, ss = system command, hh = handle to file (from BEGIN_DOWNLOAD), pp.. = pay load
292 
293 
294  Bytes received from brick:
295 
296  0600xxxx03930000 (Hex)
297  bbbbmmmmttssrrhh
298 
299  bbbb = bytes in message, mm = message counter, tt = type of command, ss = system command,
300  rr = return status, hh = handle to file
301 
302 
303  File Upload:
304  ------------
305 
306  BEGIN_UPLOAD:
307 
308  Bytes send to the brick:
309 
310  xxxxxxxx0194xxxxxxx
311  bbbbmmmmttssllllnnn...
312 
313  bbbb = bytes in message, mmmm = message counter, tt = type of command, ss = system command,
314  llll = bytes to read, nnn... = filename incl. path
315 
316 
317  Bytes received form the brick:
318 
319  xxxxxxxx039400xxxxxxxx00xxx
320  bbbbmmmmttssrrllllllllhhppp...
321 
322  bbbb = bytes in massage, mmmm = message counter, tt = type of command, ss = system command,
323  rr = return status, llllllll = file size, hh = file handle, ppp... = payload
324 
325 
326  CONTINUE_UPLOAD:
327 
328  Bytes send to the brick:
329 
330  0700xxxx019500xxxx
331  bbbbmmmmttsshhllll
332 
333  bbbb = bytes in the message, mmmm = message counter, tt = type of command, ss = system command,
334  hh = file handle, llll = bytes to read
335 
336 
337  Bytes send to the PC:
338 
339  xxxxxxxx03950000xxx
340  bbbbmmmmttssrrhhppp...
341 
342  bbbb = bytes in the message, mmmm = message counter, tt = type of command, ss = system command,
343  rr = return status, hh = handle, pppp.. = payload
344 
345 
346 
347  Getting file content
348  --------------------
349 
350  Used to upload datalog files - file handle is only closed when reaching EOF and file is not
351  open for writing
352 
353  BEGIN_GETFILE:
354 
355  Bytes send to the brick:
356 
357  xxxxxxxx0196xxxxxxx
358  bbbbmmmmttssllllnnn...
359 
360  bbbb = Bytes in massage, mmmm = message counter, tt = type of command, ss = system command,
361  llll = max bytes to read, nnnn.... = path
362 
363 
364  Bytes send to the PC:
365 
366  xxxxxxxx039600xxxxxxxx00xxx
367  bbbbmmmmttssrrllllllllhhppp...
368 
369  bbbb = bytes ion massage, mmmm = message counter, tt = type of command, ss = system command,
370  rr = return status, llllllll = File size, hh = Handle, ppp... = payload
371 
372 
373  CONTINUE_GETFILE:
374 
375  Bytes send to the brick:
376 
377  0700xxxx019700xxxx
378  bbbbmmmmttsshhllll
379 
380  bbbb = bytes in massage, mmmm = message counter, tt = type of command, ss = system command,
381  hh = handle, llll = max bytes to read
382 
383 
384  Bytes send to the PC:
385 
386  xxxxxxxx039700xxxxxxxx00xxx
387  bbbbmmmmttssrrllllllllhhppp...
388 
389  bbbb = bytes in massage, mmmm = message counter, tt = type of command, ss = system command,
390  rr = return status, llllllll = File size, hh = Handle, ppp... = payload
391 
392 
393 
394  Listing files and folders:
395  --------------------------
396 
397  LIST_FILES:
398 
399  The new line delimited list is formatted as:
400 
401  If it is a file:
402  32 chars (hex) of MD5SUM + space + 8 chars (hex) of filesize + space + filename + new line
403 
404  If it is a folder:
405  foldername + / + new line
406 
407 
408  Bytes send to the brick:
409 
410  xxxxxxxx0199xxxxxxx
411  bbbbmmmmttssllllnnn...
412 
413  bbbb = bytes in message, mmmm = message counter, tt = type of message, ss = system command,
414  llll = Max bytes to read, nnn.. = path name
415 
416 
417  Bytes send to the PC:
418 
419  xxxxxxxx0399xxxxxxxxxxxxxxx
420  bbbbmmmmttssrrllllllllhhnnn...
421 
422  bbbb = bytes in message, mmmm = message counter, tt = type of message, ss = system command,
423  rr = return status, llllllll = List size, hh = Handle, nnn.. = new line delimited lists
424 
425 
426  CONTINUE_LIST_FILES:
427 
428  Bytes send to the brick:
429 
430  0700xxxx019Axxxxxx
431  bbbbmmmmttsshhllll
432 
433  bbbb = bytes in massage, mmmm = message counter, tt = type of command, ss = system command,
434  hh = handle, llll = max bytes to read
435 
436 
437  Bytes send to the PC:
438 
439  xxxxxxxx039Axxxxxxx
440  bbbbmmmmttssrrhhppp...
441 
442  bbbb = bytes in massage, mmmm = message counter, tt = type of command, ss = system command,
443  rr = return status, hh = Handle, ppp... = payload
444 
445 
446  CLOSE_FILEHANDLE:
447  -----------------
448 
449  Bytes send to the brick:
450 
451  xxxxxxxx019800xxxxxxxxxxxxxxxx
452  bbbbmmmmttsshhpppppppppppppppp
453 
454  bbbb = bytes in the message, mmmm = message counter, tt = type of message, ss = system command,
455  hh = handle, ppp... = hash
456 
457 
458  Bytes send to the PC:
459 
460  0500xxxx039800
461  bbbbmmmmttssrr
462 
463  bbbb = bytes in massage, mmmm = message counter, tt = type of message, ss = system command,
464  rr = return status
465 
466 
467 
468  CREATE_DIR:
469  -----------
470 
471  Bytes to send to the brick:
472 
473  xxxxxxxx019Bxxxxxx...
474  bbbbmmmmttsspppppp...
475 
476  bbbb = bytes in massage, mmmm = message counter, tt = type of message, ss = system command,
477  pp = null terminated full path of directory to create
478 
479 
480  Bytes send to the PC:
481 
482  0500xxxx039Bxx
483  bbbbmmmmttssrr
484 
485  bbbb = bytes in massage, mmmm = message counter, tt = type of message, ss = system command,
486  rr = return status
487 
488 
489 
490  DELETE_FILE:
491  -------------
492 
493  Bytes to send to the brick:
494 
495  xxxxxxxx019Cxxxxxx...
496  bbbbmmmmttsspppppp...
497 
498  bbbb = bytes in massage, mmmm = message counter, tt = type of message, ss = system command,
499  pp = null terminated full path of the file to delete
500 
501 
502  Bytes send to the PC:
503 
504  0500xxxx039Cxx
505  bbbbmmmmttssrr
506 
507  bbbb = bytes in massage, mmmm = message counter, tt = type of message, ss = system command,
508  rr = return status
509 
510 
511 
512  LIST_OPEN_HANDLES:
513  ----------_-------
514 
515  Bytes to send to the brick:
516 
517  xxxxxxxx019D
518  bbbbmmmmttss
519 
520  bbbb = bytes in massage, mmmm = message counter, tt = type of message, ss = system command
521 
522 
523  Bytes send to the PC:
524 
525  xxxxxxxx039Dxxxxxx....
526  bbbbmmmmttssrrpppp....
527 
528  bbbb = bytes in massage, mmmm = message counter, tt = type of message, ss = system command,
529  rr = return status, pppp = bits indicating whether handles are busy or not.
530 
531 
532 
533  WRITEMAILBOX:
534  -------------
535 
536  Bytes sent to another brick:
537 
538  Mailbox name has to be zero terminated but name length has to be number of chars excluding
539  the zero termination.
540 
541  xxxxxxxx819Exxxxxxxxxxxxxxxxxxxx
542  bbbbmmmmttssllaaaaa...LLLLppp...
543 
544  bbbb = bytes in the message, mmmm = message counter, tt = type of message, ss = system command,
545  ll = Name Length, aaa... = Name, LLLL = Payload length, ppp... = Payload
546 
547 
548  Reply received from another brick:
549 
550  - Not valid
551 
552 
553  BLUETOOTHPIN:
554  --------------
555 
556  This command can only be sent by USB for safety reasons
557  Bluetooth address does not contain colons
558  Bluetooth MAC address is a zero terminated string type
559  Bluetooth pin code is a zero terminated string type
560 
561  Bytes sent to the brick:
562 
563  0E00xxxx019F06xxxxxxxxxxxx04xxxx
564  bbbbmmmmttssllaaaaaaaaaaaaLLpppp
565 
566  bbbb = bytes in the message, mmmm = message counter, tt = type of message, ss = system command,
567  ll = MAC Length, aaa.. = MAC address of PC, LL = Pin length, ppp... = Pin code
568 
569 
570  Bytes send to the PC:
571 
572  0F00xxxx039Fxx06xxxxxxxxxxxx04xxxx
573  bbbbmmmmttssrrllaaaaaaaaaaaaLLpppp
574 
575  bbbb = bytes in massage, mmmm = message counter, tt = type of message, ss = system command,
576  rr = return status, ll = MAC length, MAC address, Pin length, Pin
577 
578 
579  ENTERFWUPDATE:
580  --------------
581 
582  This command is used to force the brick into firmware update mode. The command will not
583  send any response back to the host. The filesystem will not be updated when closing
584  Linux.
585 
586  Bytes send to the brick:
587 
588  0400xxxx81A0
589  bbbbmmmmttss
590 
591  bbbb = bytes in massage, mmmm = message counter, tt = type of message, ss = system command,
592 
593 
594  SETBUNDLEID
595  -------------
596 
597  Sets the default Bundle ID for mode 2. Default bundle ID is "com.lego.lms".
598 
599 
600  xxxxxxxx01A1xxxxxx....
601  bbbbmmmmttsspppppp....
602 
603  bbbb = bytes in massage, mmmm = message counter, tt = type of message, ss = system command,
604  pppppp = null terminated ID string. Max. length = 24 chars including the null termination
605 
606 
607  SETBUNDLESEEDID
608  ------------------
609 
610  Sets the default Bundle seed ID for mode 2. Default bundle seed ID is "9RNK8ZF528".
611 
612  xxxxxxxx01A1xxxxxx....
613  bbbbmmmmttsspppppp....
614 
615  bbbb = bytes in massage, mmmm = message counter, tt = type of message, ss = system command,
616  pppppp = null terminated SEED ID string. Max. length = 11 chars including the null termination
617 
618 
619 
620 *********************************************************************************************************
621  \endverbatim
622  */
623 
624 
659  #define DIRECT_COMMAND_REPLY 0x00 // Direct command, reply required
660  #define DIRECT_COMMAND_NO_REPLY 0x80 // Direct command, reply not required
661 
662  /*
663 
664  Byte 5 - 6: Number of global and local variables (compressed).
665 
666  Byte 6 Byte 5
667  76543210 76543210
668  -------- --------
669  llllllgg gggggggg
670 
671  gg gggggggg Global variables [0..MAX_COMMAND_GLOBALS]
672 
673  llllll Local variables [0..MAX_COMMAND_LOCALS]
674 
675  Byte 7 - n: Byte codes
676 
677 
678 
679  Direct Command Response Bytes:
680  ,------,------,------,------,------,------,------,------,
681  |Byte 0|Byte 1|Byte 2|Byte 3| | | |Byte n|
682  '------'------'------'------'------'------'------'------'
683 
684  Byte 0 – 1: Reply size, Little Endian\n
685 
686  Byte 2 – 3: Message counter, Little Endian\n
687 
688  Byte 4: Reply type. see following defines */
689 
690  #define DIRECT_REPLY 0x02 // Direct command reply
691  #define DIRECT_REPLY_ERROR 0x04 // Direct command reply error
692 
693  /*
694 
695  Byte 5 - n: Response buffer (global variable values)
696 
697 
698 
699 \endverbatim \anchor directcommandexamples \n
700 <b> Direct Command Examples </b>
701 <hr size="1"/>
702 opOUTPUT_START Example \verbatim
703 
704  Start motor connected to port A with speed 20:
705 
706  Byte codes: opOUTPUT_POWER,LC0(0),LC0(0x01),LC0(20), opOUTPUT_START,LC0(0),LC0(0x01)
707  \ /
708  \ /
709  Hex values send: 0C00xxxx800000A4000114A60001
710 
711 \endverbatim \n
712 <hr size="1"/>
713 opOUTPUT_STOP Example \verbatim
714 
715  Stop and float motor connected to port A:
716 
717  Byte codes: opOUTPUT_STOP,LC0(0),LC0(0x01),LC0(0),
718  \ /
719  \ /
720  Hex values send: 0900xxxx800000A3000100
721 
722 \endverbatim \n
723 <hr size="1"/>
724 opINPUT_READ Example \verbatim
725 
726  Read sensor connected to port 1:
727 
728  Byte codes: opINPUT_READ,LC0(0),LC0(0),LC0(0),LC0(0),GV0(0),
729  \ /
730  \ /
731  Hex values send: 0B00xxxx0001009A0000000060
732 
733 
734  Hex values received: 0400xxxx0200
735  ^-
736  |
737  Command global variable (response buffer offset) 0=sensor value.
738 
739 \endverbatim \n
740 <hr size="1"/>
741 opINPUT_DEVICE GET_NAME Example \verbatim
742 
743  Read sensor name connected to port 1:
744 
745  Byte codes: opINPUT_DEVICE,LC0(0),LC0(0),LC0(GET_NAME),LC0(16),GV0(0),
746  \ /
747  \ /
748  Hex values send: 0B00xxxx001000990000151060
749 
750 
751  Hex values received: 1300xxxx024F70656E202020202020202020202000
752  ^-------------------------------
753  |
754  Command global variable (response buffer offset) 0..15=sensor name "Open ".
755 
756 \endverbatim \n
757 <hr size="1"/>
758 opINPUT_DEVICE_LIST Example \verbatim
759 
760  Get all device types connected to input ports:
761 
762  Byte codes: opINPUT_DEVICE_LIST,LC0(4),GV0(0),GV0(4),
763  \ /
764  \ -------
765  \ /
766  Hex values send: 0900xxxx00050098046064
767 
768 
769  Hex value received: 0800xxxx027E7E7E7D00
770  ^---------
771  |
772  Command global variable (response buffer offset) 0=port 1 type, 1=port 2 type, 2=port 3 type, 3=port4 type, 4=change flag.
773 
774 \endverbatim \anchor opMEMORY_WRITE1 \n
775 <hr size="1"/>
776 opMEMORY_WRITE Example \verbatim
777 
778  Write 0x01 0x02 0x03 0x04 0x05 into global variable 4..8 of user program running in slot 1:
779 
780  opINIT_BYTES,LV0(0),LC0(5),1,2,3,4,5,
781  opMEMORY_WRITE,LC0(1),LC0(0),LC0(4),LC0(5),LV0(0),
782 
783  Bytes actually sent to brick:
784 
785  1300xxxx8000142F400501020304057E0100040540
786  bbbbmmmmtthhhhccccccccccccccccCCCCCCCCCCCC
787 
788  bbbb = bytes in message, mm = message counter, tt = type of command, hhhh = header, cc/CC = byte codes.
789 
790  hhhh = 10 least significant bits are number of globals, 6 most significal bits are locals
791 
792 
793  Bytes received from brick:
794 
795  0600xxxx02
796  bbbbmmmmtt
797 
798  bbbb = bytes in message, mm = message counter, tt = type of command, rr = global variables (response).
799 
800 \endverbatim \anchor opMEMORY_READ1 \n
801 <hr size="1"/>
802 opMEMORY_READ Example \verbatim
803 
804  Read global variable 4..8 from user program running in slot 1:
805  opMEMORY_READ,LC0(1),LC0(0),LC0(4),LC0(5),GV0(0),
806 
807  Bytes actually sent to brick:
808 
809  0B00xxxx0005007F0100040560
810  bbbbmmmmtthhhhcccccccccccc
811 
812  bbbb = bytes in message, mm = message counter, tt = type of command, hhhh = header, cc = byte codes.
813 
814  hhhh = 10 least significant bits are number of globals, 6 most significal bits are locals
815 
816 
817  Bytes received from brick:
818 
819  0800xxxx02xxxxxxxxxx
820  bbbbmmmmttrrrrrrrrrr
821 
822  bbbb = bytes in message, mm = message counter, tt = type of command, rr = global variables (response).
823 
824 \endverbatim \n
825 <hr size="1"/>
826 opINFO GET_ID Example \verbatim
827 
828  Read 6 bytes ID from brick:
829 
830  opINFO,LC0(GET_ID),LC0(6),GV0(0)
831 
832  Bytes actually sent to brick:
833 
834  0900xxxx0006007C000660
835  bbbbmmmmtthhhhcccccccc
836 
837  bbbb = bytes in message, mm = message counter, tt = type of command, hhhh = header, cc = byte codes.
838 
839  hhhh = 10 least significant bits are number of globals, 6 most significal bits are locals
840 
841 
842  Bytes received from brick:
843 
844  0900xxxx02xxxxxxxxxxxx
845  bbbbmmmmttrrrrrrrrrrrr
846 
847  bbbb = bytes in message, mm = message counter, tt = type of command, rr = global variables (response).
848 
849 \endverbatim \n
850 <hr size="1"/>
851 opPROGRAM_START Example \verbatim
852 
853  Run app byte code file (../apps/tst/tst.rbf) in user slot (1):
854 
855 
856  opFILE,LC0(LOAD_IMAGE),LC0(USER_SLOT),LCS,'.','.','/','a','p','p','s','/','t','s','t','/','t','s','t','.','r','b','f',0,LV0(0),LV0(4),
857  opPROGRAM_START,LC0(USER_SLOT),LV0(0),LV0(4),LC0(0),
858 
859  Bytes actually sent to brick:
860 
861  2400xxxx800020C00801802E2E2F617070732F7473742F7473742E7262660040440301404400
862  bbbbmmmmtthhhhccccccccccccccccccccccccccccccccccccccccccccccccccccCCCCCCCCCC
863 
864  bbbb = bytes in message, mm = message counter, tt = type of command, hhhh = header, cc/CC = byte codes.
865 
866  hhhh = 10 least significant bits are number of globals, 6 most significal bits are locals
867 
868 \endverbatim \n
869 <hr size="1"/>
870 opPROGRAM_STOP Example \verbatim
871 
872  Stop program in user slot (1):
873 
874  opPROGRAM_STOP,LC0(USER_SLOT),
875 
876 
877  Bytes actually sent to brick:
878 
879  0700xxxx8000000201
880  bbbbmmmmtthhhhcccc
881 
882  bbbb = bytes in message, mm = message counter, tt = type of command, hhhh = header, cc/CC = byte codes.
883 
884  hhhh = 10 least significant bits are number of globals, 6 most significal bits are locals
885 
886 \endverbatim \n
887  */
888 
889 
919 /*
920  * NEW MOTOR/DAISY
921 Direct Command Bytes:
922  ,------,------,------,------,------,------,------,------,
923  |Byte 0|Byte 1|Byte 2|Byte 3|Byte 4|Byte 5| |Byte n|
924  '------'------'------'------'------'------'------'------'
925 
926  Byte 0 – 1: Command size, Little Endian\n
927 
928  Byte 2 – 3: Message counter, Little Endian\n
929 
930  Byte 4: Command type. see following defines */
931 
932  #define DIR_CMD_REPLY_WITH_BUSY 0x0F // Direct command, reply required
933  #define DIR_CMD_NO_REPLY_WITH_BUSY 0x8F // Direct command, reply not required
934 
935 
936 
937 enum
938 {
951 };
952 
953 #define MAX_MSG_SIZE 1024
954 #define NO_OF_MAILBOXES 30
955 #define MAILBOX_CONTENT_SIZE 250
956 #define USB_CMD_IN_REP_SIZE 1024
957 #define USB_CMD_OUT_REP_SIZE 1024
958 
959 
960 typedef UWORD CMDSIZE;
961 typedef UWORD MSGCNT;
962 
963 
964 typedef struct
965 {
969  UBYTE PayLoad[];
970 }
971 COMCMD;
972 
973 
974 typedef struct
975 {
979  UBYTE PayLoad[];
980 }
981 COMRPL;
982 
983 
984 typedef struct
985 {
988  UBYTE Code[];
989 }
990 DIRCMD;
991 
992 
993 typedef struct
994 {
1000  UBYTE Name[];
1001 }
1002 SYSCMDB;
1003 
1004 
1005 typedef struct
1006 {
1010  UBYTE Name[];
1011 }
1012 SYSCMDBUPL;
1013 
1014 typedef struct
1015 {
1020 }
1021 SYSCMDCUPL;
1022 
1023 typedef struct
1024 {
1027  UBYTE PayLoad[];
1028 }
1029 SYSCMDC;
1030 
1031 
1032 
1033 
1034 
1035 
1036 typedef struct
1037 {
1044  UBYTE Path[];
1045 }BEGIN_LIST;
1046 #define SIZEOF_BEGINLIST 6
1047 
1048 typedef struct
1049 {
1060  UBYTE PayLoad[];
1062 #define SIZEOF_RPLYBEGINLIST 12
1063 
1064 typedef struct
1065 {
1073 }CONTINUE_LIST;
1074 #define SIZEOF_CONTINUELIST 7
1075 
1076 
1077 typedef struct
1078 {
1085  UBYTE PayLoad[];
1087 #define SIZEOF_RPLYCONTINUELIST 8
1088 
1089 typedef struct
1090 {
1097  UBYTE Path[];
1099 #define SIZEOF_BEGINGETFILE 6
1100 
1101 typedef struct
1102 {
1113  UBYTE PayLoad[];
1115 #define SIZEOF_RPLYBEGINGETFILE 12
1116 
1117 typedef struct
1118 {
1127 #define SIZEOF_CONTINUEGETFILE 7
1128 
1129 typedef struct
1130 {
1141  UBYTE PayLoad[];
1143 #define SIZEOF_RPLYCONTINUEGETFILE 12
1144 
1145 typedef struct
1146 {
1153  UBYTE Path[];
1154 }BEGIN_READ;
1155 #define SIZEOF_BEGINREAD 6
1156 
1157 typedef struct
1158 {
1169  UBYTE PayLoad[];
1171 #define SIZEOF_RPLYBEGINREAD 12
1172 
1173 typedef struct
1174 {
1182 }CONTINUE_READ;
1183 #define SIZEOF_CONTINUEREAD 7
1184 
1185 typedef struct
1186 {
1193  UBYTE PayLoad[];
1195 #define SIZEOF_RPLYCONTINUEREAD 8
1196 
1197 typedef struct
1198 {
1203 }LIST_HANDLES;
1204 #define SIZEOF_LISTHANDLES 4
1205 
1206 typedef struct
1207 {
1213  UBYTE PayLoad[];
1215 #define SIZEOF_RPLYLISTHANDLES 7
1216 
1217 typedef struct
1218 {
1223  UBYTE Name[];
1224 }REMOVE_FILE;
1225 #define SIZEOF_REMOVEFILE 4
1226 
1227 typedef struct
1228 {
1235 #define SIZEOF_RPLYREMOVEFILE 7
1236 
1237 typedef struct
1238 {
1243  UBYTE Dir[];
1244 }MAKE_DIR;
1245 #define SIZEOF_MAKEDIR 4
1246 
1247 typedef struct
1248 {
1254 }RPLY_MAKE_DIR;
1255 #define SIZEOF_RPLYMAKEDIR 7
1256 
1257 typedef struct
1258 {
1264 }CLOSE_HANDLE;
1265 #define SIZEOF_CLOSEHANDLE 5
1266 
1267 typedef struct
1268 {
1276 #define SIZEOF_RPLYCLOSEHANDLE 8
1277 
1278 typedef struct
1279 {
1288  UBYTE Path[];
1289 // UBYTE PayLoad[];
1290 }BEGIN_DL;
1291 #define SIZEOF_BEGINDL 10
1292 
1293 typedef struct
1294 {
1301 }RPLY_BEGIN_DL;
1302 #define SIZEOF_RPLYBEGINDL 8
1303 
1304 typedef struct
1305 {
1311  UBYTE PayLoad[];
1312 }CONTINUE_DL;
1313 #define SIZEOF_CONTINUEDL 7
1314 
1315 typedef struct
1316 {
1324 #define SIZEOF_RPLYCONTINUEDL 8
1325 
1326 typedef struct
1327 {
1333  UBYTE Name[];
1334 }WRITE_MAILBOX;
1335 #define SIZEOF_WRITEMAILBOX 7
1336 
1337 typedef struct
1338 {
1341  UBYTE Payload[];
1343 #define SIZEOF_WRITETOMAILBOXPAYLOAD 2
1344 
1345 typedef struct
1346 {
1352  UBYTE Mac[13];
1354  UBYTE Pin[7];
1355 }BLUETOOTH_PIN;
1356 #define SIZEOF_BLUETOOTHPIN 7
1357 
1358 typedef struct
1359 {
1366  UBYTE Mac[13];
1368  UBYTE Pin[7];
1370 #define SIZEOF_RPLYBLUETOOTHPIN 7
1371 
1372 typedef struct
1373 {
1378  UBYTE BundleId[];
1379 }BUNDLE_ID;
1380 #define SIZEOF_BUNDLEID 6
1381 
1382 typedef struct
1383 {
1390 #define SIZEOF_RPLYBUNDLEID 7
1391 
1392 typedef struct
1393 {
1398  UBYTE BundleSeedId[];
1400 #define SIZEOF_BUNDLESEEDID 6
1401 
1402 typedef struct
1403 {
1410 #define SIZEOF_RPLYBUNDLESEEDID 7
1411 
1412 
1413 // Constants related to State
1414 enum
1415 {
1424 };
1425 
1426 
1427 // Constants related to sub state
1428 enum
1429 {
1433 };
1434 
1435 
1436 //Constants related to ReplyState
1437 enum
1438 {
1443 };
1444 
1445 RESULT cComInit(void);
1446 
1447 RESULT cComOpen(void);
1448 
1449 RESULT cComClose(void);
1450 
1451 RESULT cComExit(void);
1452 
1453 void cComRead(void);
1454 
1455 void cComWrite(void);
1456 
1457 void cComGet(void);
1458 
1459 void cComSet(void);
1460 
1461 void cComUpdate(void);
1462 
1463 void cComTxUpdate(UBYTE ChNo);
1464 
1465 void cComRemove(void);
1466 
1467 DATA8 cComGetUsbStatus(void);
1468 UBYTE cComGetBtStatus(void);
1469 UBYTE cComGetWifiStatus(void);
1470 
1471 void cComReady(void);
1472 void cComTest(void);
1473 
1474 void cComReadData(void);
1475 void cComWriteData(void);
1476 
1477 void cComWriteFile(void);
1478 
1479 void cComOpenMailBox(void);
1480 void cComWriteMailBox(void);
1481 void cComReadMailBox(void);
1482 void cComTestMailBox(void);
1483 void cComReadyMailBox(void);
1484 void cComCloseMailBox(void);
1485 
1486 void cComGetBrickName(DATA8 Length, DATA8 *pBrickName);
1487 DATA8 cComGetEvent(void);
1488 
1489 // DAISY chain
1490 // Write type data to chain
1491 RESULT cComSetDeviceInfo(DATA8 Length,UBYTE *pInfo);
1492 
1493 // Read type data from chain
1494 RESULT cComGetDeviceInfo(DATA8 Length,UBYTE *pInfo);
1495 
1496 // Write mode to chain
1497 RESULT cComSetDeviceType(DATA8 Layer,DATA8 Port,DATA8 Type,DATA8 Mode);
1498 
1499 // Read device data from chain
1500 RESULT cComGetDeviceData(DATA8 Layer,DATA8 Port,DATA8 Length,DATA8 *pType,DATA8 *pMode,DATA8 *pData);
1501 
1502 
1503 typedef struct
1504 {
1505  char Name[vmFILENAMESIZE];
1506  struct dirent **namelist;
1508  int File;
1509 
1513 }FIL;
1514 
1515 
1516 typedef struct
1517 {
1518  UBYTE Buf[1024];
1530  UBYTE Folder[vmFILENAMESIZE];
1531 }TXBUF;
1532 
1533 
1534 typedef struct
1535 {
1536  UBYTE Buf[1024];
1543 }RXBUF;
1544 
1545 
1546 typedef struct
1547 {
1548  UBYTE Name[50];
1555  ULONG Content[(MAILBOX_CONTENT_SIZE/4) + 1];
1556 }MAILBOX;
1557 
1558 
1559 typedef struct
1560 {
1561  //*****************************************************************************
1562  // Com Global variables
1563  //*****************************************************************************
1564  IMGDATA Image[sizeof(IMGHEAD) + sizeof(OBJHEAD) + USB_CMD_IN_REP_SIZE - sizeof(DIRCMD)]; // must be aligned
1566  UBYTE Globals[MAX_COMMAND_GLOBALS];
1568 
1569  UWORD (*ReadChannel[NO_OF_CHS])(UBYTE *, UWORD);
1570  UWORD (*WriteChannel[NO_OF_CHS])(UBYTE *, UWORD);
1571 
1572  FIL Files[MAX_FILE_HANDLES];
1573 
1576 
1578 
1579  int Cmdfd;
1582  UBYTE ActiveComCh; // Temporary fix until com channel functionality is in place, Ch interleaving not possible
1584 
1585  UBYTE BrickName[vmBRICKNAMESIZE];
1586 
1587 }COM_GLOBALS;
1588 
1589 #if (HARDWARE == SIMULATION)
1590  extern COM_GLOBALS * gComInstance;
1591  #define ComInstance (*gComInstance)
1592 
1593  void setComInstance(COM_GLOBALS * _Instance);
1595 #else
1596  extern COM_GLOBALS ComInstance;
1597 #endif
1598 
1599 #endif /* C_COM_H_ */
MSGCNT MsgCount
Definition: c_com.h:1307
CMDSIZE CmdSize
Definition: c_com.h:1328
UBYTE Cmd
Definition: c_com.h:1262
UBYTE Status
Definition: c_com.h:1253
Definition: c_com.h:974
CMDSIZE CmdSize
Definition: c_com.h:1374
UBYTE Cmd
Definition: c_com.h:1094
void cComOpenMailBox(void)
opMAILBOX_OPEN byte code
Definition: c_com.c:3573
MSGCNT MsgCount
Definition: c_com.h:1080
MSGCNT MsgCount
Definition: c_com.h:1120
CMDSIZE CmdSize
Definition: c_com.h:966
DATA32 Alignment
Definition: c_com.h:1565
UBYTE CmdType
Definition: c_com.h:1330
CMDSIZE CmdSize
Definition: c_com.h:1306
MSGCNT MsgCount
Definition: c_com.h:1361
CMDSIZE CmdSize
Definition: c_com.h:1066
CMDSIZE CmdSize
Definition: c_com.h:1384
MSGCNT MsgCount
Definition: c_com.h:1260
UBYTE CmdType
Definition: c_com.h:1149
UBYTE LengthLsb
Definition: c_com.h:1008
CMDSIZE CmdSize
Definition: c_com.h:1269
Definition: c_com.h:993
CMDSIZE CmdSize
Definition: c_com.h:1038
CMDSIZE CmdSize
Definition: c_com.h:1219
UBYTE BytesToReadLsb
Definition: c_com.h:1151
UBYTE Cmd
Definition: c_com.h:1298
ULONG Size
File size.
Definition: c_com.h:1507
UBYTE FileHandle
Definition: c_com.h:1524
UBYTE Globals
Definition: c_com.h:986
UBYTE RemoteFileHandle
Definition: c_com.h:1525
UBYTE LengthMsb
Definition: c_com.h:1009
MSGCNT MsgCount
Definition: c_com.h:1329
UBYTE Cmd
Definition: c_com.h:1350
UBYTE Status
Definition: c_com.h:1549
UBYTE FileSizeMsb
Definition: c_com.h:1287
UBYTE Handle
Definition: c_com.h:1168
SLONG DATA32
VM Type for 4 byte signed value.
Definition: lmstypes.h:63
UBYTE FileSizeNsb1
Definition: c_com.h:1109
UBYTE LengthMsb
Definition: c_com.h:999
Definition: c_com.h:1503
UBYTE cComGetBtStatus(void)
Definition: c_com.c:5557
UBYTE CmdType
Definition: c_com.h:1297
UBYTE Status
Definition: c_com.h:1299
UBYTE BytesToReadMsb
Definition: c_com.h:1072
Definition: c_com.h:940
UBYTE ListSizeLsb
Definition: c_com.h:1055
UBYTE SubState
Definition: c_com.h:1527
MSGCNT MsgCount
Definition: c_com.h:1092
UBYTE ListSizeMsb
Definition: c_com.h:1058
#define Globals
UBYTE BytesToReadMsb
Definition: c_com.h:1043
UBYTE MacSize
Definition: c_com.h:1351
CMDSIZE CmdSize
Definition: c_com.h:1091
CMDSIZE CmdSize
Definition: c_com.h:976
Definition: c_com.h:984
UBYTE BytesToReadMsb
Definition: c_com.h:1152
UBYTE FileSizeLsb
Definition: c_com.h:1164
void cComReadData(void)
Definition: c_com.c:3522
ULONG RxBytes
Definition: c_com.h:1538
Definition: c_com.h:1422
MSGCNT MsgCount
Definition: c_com.h:1270
UBYTE Locals
Definition: c_com.h:987
UBYTE CmdType
Definition: c_com.h:1231
void cComReadyMailBox(void)
opMAILBOX_READY byte code
Definition: c_com.c:3923
CMDSIZE CmdSize
Definition: c_com.h:1199
UBYTE ListSizeNsb1
Definition: c_com.h:1056
void cComReadMailBox(void)
opMAILBOX_READ byte code
Definition: c_com.c:3781
Definition: c_com.h:964
UBYTE CmdType
Definition: c_com.h:1177
FIL * pFile
Definition: c_com.h:1523
MSGCNT MsgCount
Definition: c_com.h:1348
RESULT cComGetDeviceInfo(DATA8 Length, UBYTE *pInfo)
Definition: c_com.c:256
UBYTE Cmd
Definition: c_com.h:1041
CMDSIZE CmdSize
Definition: c_com.h:1175
UBYTE Handle
Definition: c_com.h:1310
UBYTE CmdType
Definition: c_com.h:1052
CMDSIZE CmdSize
Definition: c_com.h:1317
MSGCNT MsgCount
Definition: c_com.h:1067
MSGCNT MsgCount
Definition: c_com.h:1051
DATA8 cComGetEvent(void)
Definition: c_com.c:5589
Definition: c_com.h:1416
void cComWriteFile(void)
Definition: c_com.c:3970
UBYTE CmdType
Definition: c_com.h:1319
MSGCNT MsgCount
Definition: c_com.h:1160
UBYTE CmdType
Definition: c_com.h:1376
CMDSIZE CmdSize
Definition: c_com.h:1249
UBYTE NameSize
Definition: c_com.h:1332
CMDSIZE CmdSize
Definition: c_com.h:1239
UBYTE FileSizeNsb1
Definition: c_com.h:1285
UBYTE Status
Definition: c_com.h:1054
MSGCNT MsgCount
Definition: c_com.h:1188
UBYTE CmdType
Definition: c_com.h:1161
RESULT cComSetDeviceType(DATA8 Layer, DATA8 Port, DATA8 Type, DATA8 Mode)
Definition: c_com.c:262
UBYTE Cmd
Definition: c_com.h:1309
CMDSIZE CmdSize
Definition: c_com.h:1229
CMDSIZE CmdSize
Definition: c_com.h:1404
CMDSIZE CmdSize
Definition: c_com.h:1159
UBYTE Cmd
Definition: c_com.h:1222
UBYTE BytesToReadLsb
Definition: c_com.h:1071
unsigned int ULONG
Basic Type used to symbolise 32 bit unsigned values.
Definition: lmstypes.h:31
RESULT cComGetDeviceData(DATA8 Layer, DATA8 Port, DATA8 Length, DATA8 *pType, DATA8 *pMode, DATA8 *pData)
Definition: c_com.c:268
UBYTE VmReady
Definition: c_com.h:1580
RESULT cComSetDeviceInfo(DATA8 Length, UBYTE *pInfo)
Definition: c_com.c:249
MSGCNT MsgCount
Definition: c_com.h:1209
UBYTE FileSizeNsb2
Definition: c_com.h:1286
void cComCloseMailBox(void)
opMAILBOX_CLOSE byte code
Definition: c_com.c:3958
UBYTE LengthLsb
Definition: c_com.h:996
MSGCNT MsgCount
Definition: c_com.h:1039
UBYTE CmdType
Definition: c_com.h:1040
UBYTE Status
Definition: c_com.h:1321
void cComWriteMailBox(void)
opMAILBOX_WRITE byte code
Definition: c_com.c:3628
#define MAILBOX_CONTENT_SIZE
Definition: c_com.h:955
UBYTE Cmd
Definition: c_com.h:1150
ULONG BufSize
Definition: c_com.h:1522
void cComTestMailBox(void)
opMAILBOX_TEST byte code
Definition: c_com.c:3891
Definition: d_pwm.c:329
UWORD WriteCnt
Definition: c_com.h:1554
UBYTE Cmd
Definition: c_com.h:1202
CMDSIZE CmdSize
Definition: c_com.h:1103
UBYTE Sys
Definition: c_com.h:1025
UBYTE FileSizeLsb
Definition: c_com.h:1284
void cComReady(void)
opCOM_READY byte code
Definition: c_com.c:3281
UBYTE Cmd
Definition: c_com.h:1178
UBYTE PinSize
Definition: c_com.h:1353
UBYTE CmdType
Definition: c_com.h:1261
ULONG SendBytes
Definition: c_com.h:1521
MSGCNT MsgCount
Definition: c_com.h:1385
MSGCNT MsgCount
Definition: c_com.h:1250
#define ComInstance
Definition: c_com.h:1591
Definition: c_com.h:939
CMDSIZE CmdSize
Definition: c_com.h:1050
ULONG MsgLen
Definition: c_com.h:1519
UWORD CMDSIZE
Definition: c_com.h:960
#define NO_OF_MAILBOXES
Definition: c_com.h:954
UBYTE Cmd
Definition: c_com.h:968
UBYTE FifoSize
Definition: c_com.h:1550
UBYTE LengthMsb
Definition: c_com.h:1019
MSGCNT MsgCnt
Definition: c_com.h:977
CMDSIZE CmdSize
Definition: c_com.h:1394
UBYTE CmdType
Definition: c_com.h:1201
MSGCNT MsgCount
Definition: c_com.h:1375
UBYTE State
Definition: c_com.h:1526
FIL * pFile
Definition: c_com.h:1540
UBYTE Handle
Definition: c_com.h:1300
MSGCNT MsgCount
Definition: c_com.h:1148
CMDSIZE CmdSize
Definition: c_com.h:1295
void cComRemove(void)
Definition: c_com.c:5516
RESULT cComExit(void)
Definition: c_com.c:233
UBYTE CmdType
Definition: c_com.h:1282
UBYTE CmdType
Definition: c_com.h:1251
ULONG Pointer
Definition: c_com.h:1511
UBYTE Handle
Definition: c_com.h:1322
UBYTE Handle
Definition: c_com.h:1059
UBYTE Writing
Definition: c_com.h:1528
UWORD DataSize
Definition: c_com.h:1552
UBYTE CmdType
Definition: c_com.h:1241
UBYTE FileSizeNsb1
Definition: c_com.h:1165
ULONG BlockLen
Definition: c_com.h:1520
MSGCNT MsgCount
Definition: c_com.h:1200
UWORD State
Definition: c_com.h:1512
UBYTE ComResult
Definition: c_com.h:1581
UBYTE Cmd
Definition: c_com.h:1387
UBYTE Cmd
Definition: c_com.h:978
UBYTE CommandReady
Definition: c_com.h:1567
CMDSIZE CmdSize
Definition: c_com.h:1208
UBYTE cComGetWifiStatus(void)
Definition: c_com.c:5563
void cComSet(void)
opCOM_SET byte code
Definition: c_com.c:5045
unsigned char UBYTE
Basic Type used to symbolise 8 bit unsigned values.
Definition: lmstypes.h:29
UBYTE Cmd
Definition: c_com.h:1242
UBYTE Status
Definition: c_com.h:1388
#define USB_CMD_IN_REP_SIZE
Definition: c_com.h:956
UWORD MSGCNT
Definition: c_com.h:961
UBYTE ReplyStatus
Definition: c_com.h:1583
struct dirent ** namelist
Definition: c_com.h:1506
UBYTE ActiveComCh
Definition: c_com.h:1582
UBYTE BytesToReadLsb
Definition: c_com.h:1042
UBYTE Sys
Definition: c_com.h:1007
UBYTE BytesToReadLsb
Definition: c_com.h:1180
UBYTE Cmd
Definition: c_com.h:1377
MSGCNT MsgCount
Definition: c_com.h:1230
UBYTE BytesToReadLsb
Definition: c_com.h:1095
Definition: c_com.h:1516
Definition: c_com.h:1534
COM_GLOBALS * gComInstance
Definition: c_com.c:68
void cComGetBrickName(DATA8 Length, DATA8 *pBrickName)
Definition: c_com.c:5583
UBYTE CmdType
Definition: c_com.h:1349
UBYTE CmdType
Definition: c_com.h:1396
UBYTE LengthLsb
Definition: c_com.h:1018
MSGCNT MsgCnt
Definition: c_com.h:967
UBYTE Cmd
Definition: c_com.h:1283
void cComTxUpdate(UBYTE ChNo)
Definition: c_com.c:2837
UBYTE CmdType
Definition: c_com.h:1068
UBYTE FileHandle
Definition: c_com.h:1541
CMDSIZE CmdSize
Definition: c_com.h:1147
unsigned short UWORD
Basic Type used to symbolise 16 bit unsigned values.
Definition: lmstypes.h:30
UBYTE Status
Definition: c_com.h:1163
UBYTE IMGDATA
Image base type.
Definition: lmstypes.h:69
DATA8 cComGetUsbStatus(void)
Definition: c_com.c:2831
CMDSIZE CmdSize
Definition: c_com.h:1187
void cComUpdate(void)
Definition: c_com.c:2448
UBYTE Status
Definition: c_com.h:1233
UBYTE Sys
Definition: c_com.h:995
CMDSIZE CmdSize
Definition: c_com.h:1259
UBYTE CmdType
Definition: c_com.h:1308
Definition: c_com.h:949
MSGCNT MsgCount
Definition: c_com.h:1281
UBYTE CmdType
Definition: c_com.h:1093
DIR * pDir
Definition: c_com.h:1529
ULONG Length
Total down load length.
Definition: c_com.h:1510
UBYTE Cmd
Definition: c_com.h:1252
UBYTE CmdType
Definition: c_com.h:1221
CMDSIZE CmdSize
Definition: c_com.h:1079
RESULT cComOpen(void)
Definition: c_com.c:203
MSGCNT MsgCount
Definition: c_com.h:1296
void cComGet(void)
opCOM_GET byte code
Definition: c_com.c:4208
UBYTE Type
Definition: c_com.h:1551
UBYTE Cmd
Definition: c_com.h:1331
UBYTE Handle
Definition: c_com.h:1179
MSGCNT MsgCount
Definition: c_com.h:1240
void setComInstance(COM_GLOBALS *_Instance)
Definition: c_com.c:70
SBYTE DATA8
VM Type for 1 byte signed value.
Definition: lmstypes.h:61
COM_GLOBALS * getComInstance()
Definition: c_com.c:75
UBYTE LengthNsb2
Definition: c_com.h:998
UBYTE BytesToReadLsb
Definition: c_com.h:1124
MSGCNT MsgCount
Definition: c_com.h:1395
UBYTE State
Definition: c_com.h:1542
RESULT cComInit(void)
Definition: c_com.c:104
void cComTest(void)
opCOM_TEST byte code
Definition: c_com.c:3350
UBYTE BytesToReadMsb
Definition: c_com.h:1096
UBYTE FileSizeNsb2
Definition: c_com.h:1110
void cComWriteData(void)
Definition: c_com.c:3536
Definition: c_com.h:1421
UBYTE Sys
Definition: c_com.h:1016
Definition: c_com.h:941
UBYTE BytesToReadMsb
Definition: c_com.h:1125
UBYTE FileSizeNsb2
Definition: c_com.h:1166
ULONG BufSize
Definition: c_com.h:1539
UBYTE CmdType
Definition: c_com.h:1386
UBYTE ListSizeNsb2
Definition: c_com.h:1057
UWORD ReadCnt
Definition: c_com.h:1553
CMDSIZE CmdSize
Definition: c_com.h:1347
void cComWrite(void)
opCOM_WRITE byte code
Definition: c_com.c:3472
CMDSIZE CmdSize
Definition: c_com.h:1119
UBYTE Handle
Definition: c_com.h:1026
int Cmdfd
Definition: c_com.h:1579
UBYTE Cmd
Definition: c_com.h:1069
MSGCNT MsgCount
Definition: c_com.h:1176
UBYTE BytesToReadMsb
Definition: c_com.h:1181
MSGCNT MsgCount
Definition: c_com.h:1318
RESULT cComClose(void)
Definition: c_com.c:213
UBYTE Handle
Definition: c_com.h:1017
ULONG MsgLen
Definition: c_com.h:1537
UBYTE Handle
Definition: c_com.h:1070
UBYTE LengthNsb1
Definition: c_com.h:997
UBYTE FileSizeMsb
Definition: c_com.h:1167
UBYTE Cmd
Definition: c_com.h:1397
CMDSIZE CmdSize
Definition: c_com.h:1280
void cComRead(void)
opCOM_READ byte code
Definition: c_com.c:3416
MSGCNT MsgCount
Definition: c_com.h:1220
CMDSIZE CmdSize
Definition: c_com.h:1360
UBYTE Handle
Definition: c_com.h:1263
int File
Definition: c_com.h:1508