Development Page for EV3 Support

Links:

What works:

  • USB connection works via Libusb if Product Id is set to 0x0005 (we can read the serial number but no data transfer yet!)

What doesn´t work:

  • We can´t send or recieve data via libusb because we don´t know the correct endpoints test *0x81
  • Bluetooth connection
  • Wifi connection
  • MotorControl (i guess if we still need this it needs to be completely redone)

Infos:

  • EV3 is running Linux
  • Motors and most Sensors from NXT work with the EV3
  • Motors from EV3 work with NXT
  • Sensors from EV3 do NOT work with NXT
  • EV3 uses UART to communicate with new EV3 Sensors and I2C to communicate with NXT Sensors
  • Charger and Batterie Packs are NOT compatible
  • BT needs to be tested!
  • Vendor ID: 0x0694 Product ID: 0x0005
  • at least MotorControl needs to be redone! (don´t know about the rest yet)
  • if command bytes have changed name2commandbytes has to be redone as well
  • Wifi connection seems to be fairly easy
  • A Netgear WNA1100 Wifi dongle seems to be the only Wifi dongle that is supported (at the moment) by the EV3’s firmware source

—-

Communcation Protocol source

This paragraph will document the communication protocol that is supposed to be used across the
different communication platforms.

'''General Protocol Overview'''
,------,------,------,------,------,------,------,------,
|Byte 0|Byte 1|Byte 2|Byte 3|      |      |      |Byte n|
'------'------'------'------'------'------'------'------'

Byte 0 – 1: Command size, Little Endian

Byte 2 – 3: Message counter, Little Endian

Byte 4: Command type. The 7 lowest bit of this byte is used for identifying the command type.

Bit 7 (MSB) is used for identifying whether the command should give a reply message or not.

Byte 5 - n: Dependent on command type



There are two different command types:

System commands are thought of as commands used to controlling/utilizing some of the more overall
system functionalities (File download,...)


Direct commands are related to functionality which are controlled within by the virtual machine.


'''System Commands'''

System command are defined as: a command that's not implemented as a byte code (no VM intervention).

System Command Bytes:
,------,------,------,------,------,------,------,------,
|Byte 0|Byte 1|Byte 2|Byte 3|Byte 4|Byte 5|      |Byte n|
'------'------'------'------'------'------'------'------'

Byte 0 – 1: Command size, Little Endian

Byte 2 – 3: Message counter, Little Endian

Byte 4: Command type. see following defines */

  #define SYSTEM_COMMAND_REPLY 0x01 // System command, reply required
  #define SYSTEM_COMMAND_NO_REPLY 0x81 // System command, reply not required
                                                    /*
Byte 5: System Command. see following defines */

  #define BEGIN_DOWNLOAD 0x92 // Begin file down load
  #define CONTINUE_DOWNLOAD 0x93 // Continue file down load
  #define BEGIN_UPLOAD 0x94 // Begin file upload
  #define CONTINUE_UPLOAD 0x95 // Continue file upload
  #define BEGIN_GETFILE 0x96 // Begin get bytes from a file (while writing to the file)
  #define CONTINUE_GETFILE 0x97 // Continue get byte from a file (while writing to the file)
  #define CLOSE_FILEHANDLE 0x98 // Close file handle
  #define LIST_FILES 0x99 // List files
  #define CONTINUE_LIST_FILES 0x9A // Continue list files
  #define CREATE_DIR 0x9B // Create directory
  #define DELETE_FILE 0x9C // Delete
  #define LIST_OPEN_HANDLES 0x9D // List handles
  #define WRITEMAILBOX 0x9E // Write to mailbox
  #define BLUETOOTHPIN 0x9F // Transfer trusted pin code to brick
  #define ENTERFWUPDATE 0xA0 // Restart the brick in Firmware update mode
  #define SETBUNDLEID 0xA1 // Set Bundle ID for mode 2
  #define SETBUNDLESEEDID 0xA2 // Set bundle seed ID for mode 2

/*

Byte 6 - n: Dependent on System Command



System Command Response Bytes:
,------,------,------,------,------,------,------,------,
|Byte 0|Byte 1|Byte 2|Byte 3|      |      |      |Byte n|
'------'------'------'------'------'------'------'------'

Byte 0 – 1: Reply size, Little Endian

Byte 2 – 3: Message counter, Little Endian

Byte 4: Reply type. see following defines */

  #define SYSTEM_REPLY 0x03 // System command reply
  #define SYSTEM_REPLY_ERROR 0x05 // System command reply error
/*
Byte 5: System command this is the response to

Byte 6: Reply status
*/

  // SYSTEM command return codes
  #define SUCCESS 0x00
  #define UNKNOWN_HANDLE 0x01
  #define HANDLE_NOT_READY 0x02
  #define CORRUPT_FILE 0x03
  #define NO_HANDLES_AVAILABLE 0x04
  #define NO_PERMISSION 0x05
  #define ILLEGAL_PATH 0x06
  #define FILE_EXITS 0x07
  #define END_OF_FILE 0x08
  #define SIZE_ERROR 0x09
  #define UNKNOWN_ERROR 0x0A
  #define ILLEGAL_FILENAME 0x0B
  #define ILLEGAL_CONNECTION 0x0C

/*
Byte 7 - n: Response dependent on System Command


The example below is build around the host application (X3 software) that wants to send a file to a P-
Brick where the VM, Green layer and Black layer reference to the firmware architecture. The
architecture document below on the host side only consists of our current understanding of the
implementation. At this point we have chosen to reference to the firmware architecture instead of the 7
layer OSI model.

*** ''see source for diagram'' ***

Our current thoughts are as follows:
1. The host application initiates the communication by sending a request to the BrickServer that the application wants to send a file. The parameters within this call will include: 
File name for the file that should be send, and some description for the destination.
2. The brick server processes the request by sending a request to the USB driver which includes the following parameter: 
Specific command (Begin down load), File size and file name.
3. The USB driver will send out a command including: 
Command size, Command byte (Begin
down load), File size and file name.
4. The P-bricks black layer with receive and validate the USB packages. It will transfer the received packages up to the green layer.
5. The green layer will evaluate the packages and as it is a begin down load ask the VM if it is okay to receive a packages now.
6. When the VM has replied OK to the green layer the green layer will ask the USB driver to reply OK and include a handle number to use within next packages for this communication.
7. When the OK signal is received with the USB driver (On the host side) the host will start transmitting additional data which include the follow parameters: Command size, Command type, Command byte (Continue D/L), Handle, Pay load data.

Command size: 2 bytes (Tells the amount of bytes which belongs to this specific command).
Command type: 1 byte
File size: 4 Bytes
Handle: 1 Byte


Additional consideration
Above scenario allows for having multiple file action running at the same time as we have a handle which identifies which process new data relates to. It also allows for interleaved communication during a potential long down load process. But our current knowledge and considerations are also that interleaved commands and splitting up larger data chunks slows down Bluetooth communication a lot.
Bluetooth communication requires large data chunks to be pushed through the channel all the time with as less packages division as possible. Therefore the command size parameter is also included to enable sending larger data packages as one call.
Above protocol architecture enables implementing the following two different scenarios which performs the same functionality (Sending a 60 Kbyte file to the brick):

Scenario 1: (It is not possible to interleave during file down load) (60 K bytes data package):
1. Command size (0x06,0x00), Command type, Begin D/L, File size (0x60,0xEA,0x00,0x00), File Name (0x30)
2. Command size (0x62,0xEA), Command type, Continue D/L, Handle (0x01), Data ............

Scenario 2 (This enables the host to interleave during file down load) (500 bytes data packages):
1. Command size (0x06,0x00),Command Type, Begin D/L, File size (0x60,0xEA,0x00,0x00), File Name (0x30)
2. Command size (0xF6,0x01), Command type, Continue D/L, Handle (0x01), Data ............
3. ..
4. ..
5. Command size (0xF6,0x01), Command type ,Continue D/L, Handle (0x01), Data ............


- File Down Load
- Destination filename path is relative from "lms2012/sys"
- Destination folders are automatically created from filename path
- First folder name must be: "apps", "prjs" or "tools" (see \ref UIdesign)
- Second folder name in filename path must be equal to byte code executable name

- File Upload (File read)
- BEGIN_UPLOAD and CONTINUE_UPLOAD closes automatically the file handle when file has been uploaded
- BEGIN_GETFILE and CONTINUE_GETFILE does not close the file handle when EOF has been reached
- CONTINUE_GETFILE does also return the complete file size

- Directory upload
- LIST_FILES should work as long as list does not exceed 1014 bytes. CONTINUE_LISTFILES has NOT
been implemented yet.

- File handles
- CLOSE_FILEHANDLE is partly implemented - hash is not working


Examples:
*********************************************************************************************************

File down load:
---------------

Download file "../apps/tst/tst.rbf"

BEGIN_DOWNLOAD:

Bytes sent to brick:

1C00xxxx0192xxxxxxxx2E2E2F617070732F7473742F7473742E72626600 (Hex)
bbbbmmmmttssllllllllnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn

bbbb = bytes in message, mm = message counter, tt = type of command, ss = system command,
llllllll = file length, nn.. = filename


Bytes received from brick:

0600xxxx03920000 (Hex)
bbbbmmmmttssrrhh

bbbb = bytes in message, mm = message counter, tt = type of command, ss = system command,
rr = return status, hh = handle to file


CONTINUE_DOWNLOAD:

Bytes sent to brick:

xxxxxxxx819300xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (Hex)
bbbbmmmmttsshhpppppppppppppppppppppppppppppppppppppppp

bbbb = bytes in message, mm = message counter, tt = type of command, ss = system command, hh = handle to file (from BEGIN_DOWNLOAD), pp.. = pay load


Bytes received from brick:

0600xxxx03930000 (Hex)
bbbbmmmmttssrrhh

bbbb = bytes in message, mm = message counter, tt = type of command, ss = system command,
rr = return status, hh = handle to file


File Upload:
------------

BEGIN_UPLOAD:

Bytes send to the brick:

xxxxxxxx0194xxxxxxx
bbbbmmmmttssllllnnn...

bbbb = bytes in message, mmmm = message counter, tt = type of command, ss = system command,
llll = bytes to read, nnn... = filename incl. path


Bytes received form the brick:

xxxxxxxx039400xxxxxxxx00xxx
bbbbmmmmttssrrllllllllhhppp...

bbbb = bytes in massage, mmmm = message counter, tt = type of command, ss = system command,
rr = return status, llllllll = file size, hh = file handle, ppp... = payload


CONTINUE_UPLOAD:

Bytes send to the brick:

0700xxxx019500xxxx
bbbbmmmmttsshhllll

bbbb = bytes in the message, mmmm = message counter, tt = type of command, ss = system command,
hh = file handle, llll = bytes to read


Bytes send to the PC:

xxxxxxxx03950000xxx
bbbbmmmmttssrrhhppp...

bbbb = bytes in the message, mmmm = message counter, tt = type of command, ss = system command,
rr = return status, hh = handle, pppp.. = payload



Getting file content
--------------------

Used to upload datalog files - file handle is only closed when reaching EOF and file is not
open for writing

BEGIN_GETFILE:

Bytes send to the brick:

xxxxxxxx0196xxxxxxx
bbbbmmmmttssllllnnn...

bbbb = Bytes in massage, mmmm = message counter, tt = type of command, ss = system command,
llll = max bytes to read, nnnn.... = path


Bytes send to the PC:

xxxxxxxx039600xxxxxxxx00xxx
bbbbmmmmttssrrllllllllhhppp...

bbbb = bytes ion massage, mmmm = message counter, tt = type of command, ss = system command,
rr = return status, llllllll = File size, hh = Handle, ppp... = payload


CONTINUE_GETFILE:

Bytes send to the brick:

0700xxxx019700xxxx
bbbbmmmmttsshhllll

bbbb = bytes in massage, mmmm = message counter, tt = type of command, ss = system command,
hh = handle, llll = max bytes to read


Bytes send to the PC:

xxxxxxxx039700xxxxxxxx00xxx
bbbbmmmmttssrrllllllllhhppp...

bbbb = bytes in massage, mmmm = message counter, tt = type of command, ss = system command,
rr = return status, llllllll = File size, hh = Handle, ppp... = payload



Listing files and folders:
--------------------------

LIST_FILES:

The new line delimited list is formatted as:

If it is a file:
32 chars (hex) of MD5SUM + space + 8 chars (hex) of filesize + space + filename + new line

If it is a folder:
foldername + / + new line


Bytes send to the brick:

xxxxxxxx0199xxxxxxx
bbbbmmmmttssllllnnn...

bbbb = bytes in message, mmmm = message counter, tt = type of message, ss = system command,
llll = Max bytes to read, nnn.. = path name


Bytes send to the PC:

xxxxxxxx0399xxxxxxxxxxxxxxx
bbbbmmmmttssrrllllllllhhnnn...

bbbb = bytes in message, mmmm = message counter, tt = type of message, ss = system command,
rr = return status, llllllll = List size, hh = Handle, nnn.. = new line delimited lists


CONTINUE_LIST_FILES:

Bytes send to the brick:

0700xxxx019Axxxxxx
bbbbmmmmttsshhllll

bbbb = bytes in massage, mmmm = message counter, tt = type of command, ss = system command,
hh = handle, llll = max bytes to read


Bytes send to the PC:

xxxxxxxx039Axxxxxxx
bbbbmmmmttssrrhhppp...

bbbb = bytes in massage, mmmm = message counter, tt = type of command, ss = system command,
rr = return status, hh = Handle, ppp... = payload


CLOSE_FILEHANDLE:
-----------------

Bytes send to the brick:

xxxxxxxx019800xxxxxxxxxxxxxxxx
bbbbmmmmttsshhpppppppppppppppp

bbbb = bytes in the message, mmmm = message counter, tt = type of message, ss = system command,
hh = handle, ppp... = hash


Bytes send to the PC:

0500xxxx039800
bbbbmmmmttssrr

bbbb = bytes in massage, mmmm = message counter, tt = type of message, ss = system command,
rr = return status



CREATE_DIR:
-----------

Bytes to send to the brick:

xxxxxxxx019Bxxxxxx...
bbbbmmmmttsspppppp...

bbbb = bytes in massage, mmmm = message counter, tt = type of message, ss = system command,
pp = null terminated full path of directory to create


Bytes send to the PC:

0500xxxx039Bxx
bbbbmmmmttssrr

bbbb = bytes in massage, mmmm = message counter, tt = type of message, ss = system command,
rr = return status



DELETE_FILE:
-------------

Bytes to send to the brick:

xxxxxxxx019Cxxxxxx...
bbbbmmmmttsspppppp...

bbbb = bytes in massage, mmmm = message counter, tt = type of message, ss = system command,
pp = null terminated full path of the file to delete


Bytes send to the PC:

0500xxxx039Cxx
bbbbmmmmttssrr

bbbb = bytes in massage, mmmm = message counter, tt = type of message, ss = system command,
rr = return status



LIST_OPEN_HANDLES:
----------_-------

Bytes to send to the brick:

xxxxxxxx019D
bbbbmmmmttss

bbbb = bytes in massage, mmmm = message counter, tt = type of message, ss = system command


Bytes send to the PC:

xxxxxxxx039Dxxxxxx....
bbbbmmmmttssrrpppp....

bbbb = bytes in massage, mmmm = message counter, tt = type of message, ss = system command,
rr = return status, pppp = bits indicating whether handles are busy or not.



WRITEMAILBOX:
-------------

Bytes sent to another brick:

Mailbox name has to be zero terminated but name length has to be number of chars excluding
the zero termination.

xxxxxxxx819Exxxxxxxxxxxxxxxxxxxx
bbbbmmmmttssllaaaaa...LLLLppp...

bbbb = bytes in the message, mmmm = message counter, tt = type of message, ss = system command,
ll = Name Length, aaa... = Name, LLLL = Payload length, ppp... = Payload


Reply received from another brick:

- Not valid


BLUETOOTHPIN:
--------------

This command can only be sent by USB for safety reasons
Bluetooth address does not contain colons
Bluetooth MAC address is a zero terminated string type
Bluetooth pin code is a zero terminated string type

Bytes sent to the brick:

0E00xxxx019F06xxxxxxxxxxxx04xxxx
bbbbmmmmttssllaaaaaaaaaaaaLLpppp

bbbb = bytes in the message, mmmm = message counter, tt = type of message, ss = system command,
ll = MAC Length, aaa.. = MAC address of PC, LL = Pin length, ppp... = Pin code


Bytes send to the PC:

0F00xxxx039Fxx06xxxxxxxxxxxx04xxxx
bbbbmmmmttssrrllaaaaaaaaaaaaLLpppp

bbbb = bytes in massage, mmmm = message counter, tt = type of message, ss = system command,
rr = return status, ll = MAC length, MAC address, Pin length, Pin


ENTERFWUPDATE:
--------------

This command is used to force the brick into firmware update mode. The command will not
send any response back to the host. The filesystem will not be updated when closing
Linux.

Bytes send to the brick:

0400xxxx81A0
bbbbmmmmttss

bbbb = bytes in massage, mmmm = message counter, tt = type of message, ss = system command,


SETBUNDLEID
-------------

Sets the default Bundle ID for mode 2. Default bundle ID is "com.lego.lms".


xxxxxxxx01A1xxxxxx....
bbbbmmmmttsspppppp....

bbbb = bytes in massage, mmmm = message counter, tt = type of message, ss = system command,
pppppp = null terminated ID string. Max. length = 24 chars including the null termination


SETBUNDLESEEDID
------------------

Sets the default Bundle seed ID for mode 2. Default bundle seed ID is "9RNK8ZF528".

xxxxxxxx01A1xxxxxx....
bbbbmmmmttsspppppp....

bbbb = bytes in massage, mmmm = message counter, tt = type of message, ss = system command,
pppppp = null terminated SEED ID string. Max. length = 11 chars including the null termination



*********************************************************************************************************

Beside running user programs the VM is able to execute direct commands from the Communication Module.
In fact direct commands are small programs that consists of regular byte codes and they are executed
in parallel with a running user program.\n
Special care MUST be taken when writing direct commands because the decision until now is NOT to
restrict the use of "dangerous" codes and constructions (loops in a direct command are allowed).

If a new direct command from the same source is going to be executed an actual running direct command is terminated.

Because of a small header objects are limited to one VMTHREAD only - SUBCALLs and BLOCKs is of
course not possible.
This header contains information about number of global variables (for response), number of local variables
and command size.

Direct commands that has data response can place the data in the global variable space. The global
variable space is equal to the communication response buffer. The composition of the direct command
defines at which offset the result is placed (global variable 0 is placed at offset 0 in the buffer).

Offset in the response buffer (global variables) must be aligned (float/32bits first and 8 bits last).

Direct Command Bytes:
,------,------,------,------,------,------,------,------,
|Byte 0|Byte 1|Byte 2|Byte 3|Byte 4|Byte 5|      |Byte n|
'------'------'------'------'------'------'------'------'

Byte 0 – 1: Command size, Little Endian

Byte 2 – 3: Message counter, Little Endian

Byte 4: Command type. see following defines */

  #define DIRECT_COMMAND_REPLY 0x00 // Direct command, reply required
  #define DIRECT_COMMAND_NO_REPLY 0x80 // Direct command, reply not required

                                                    /*

Byte 5 - 6: Number of global and local variables (compressed).

Byte 6 Byte 5
76543210 76543210
-------- --------
llllllgg gggggggg

gg gggggggg Global variables [0..MAX_COMMAND_GLOBALS]

llllll Local variables [0..MAX_COMMAND_LOCALS]

Byte 7 - n: Byte codes



Direct Command Response Bytes:
,------,------,------,------,------,------,------,------,
|Byte 0|Byte 1|Byte 2|Byte 3| | | |Byte n|
'------'------'------'------'------'------'------'------'

Byte 0 – 1: Reply size, Little Endian\n

Byte 2 – 3: Message counter, Little Endian\n

Byte 4: Reply type. see following defines */

  #define DIRECT_REPLY 0x02 // Direct command reply
  #define DIRECT_REPLY_ERROR 0x04 // Direct command reply error

                                                    /*

Byte 5 - n: Response buffer (global variable values)



===Direct Command Examples===


'''opOUTPUT_START Example'''

Start motor connected to port A with speed 20:

Byte codes: opOUTPUT_POWER,LC0(0),LC0(0x01),LC0(20), opOUTPUT_START,LC0(0),LC0(0x01)
\ /
\ /
Hex values send: 0C00xxxx800000A4000114A60001


'''opOUTPUT_STOP Example''' 

Stop and float motor connected to port A:

Byte codes: opOUTPUT_STOP,LC0(0),LC0(0x01),LC0(0),
\ /
\ /
Hex values send: 0900xxxx800000A3000100


'''opINPUT_READ Example'''

Read sensor connected to port 1:

Byte codes: opINPUT_READ,LC0(0),LC0(0),LC0(0),LC0(0),GV0(0),
\ /
\ /
Hex values send: 0B00xxxx0001009A0000000060


Hex values received: 0400xxxx0200
^-
|
Command global variable (response buffer offset) 0=sensor value.


'''opINPUT_DEVICE GET_NAME Example'''

Read sensor name connected to port 1:

Byte codes: opINPUT_DEVICE,LC0(0),LC0(0),LC0(GET_NAME),LC0(16),GV0(0),
\ /
\ /
Hex values send: 0B00xxxx001000990000151060


Hex values received: 1300xxxx024F70656E202020202020202020202000
^-------------------------------
|
Command global variable (response buffer offset) 0..15=sensor name "Open ".


'''opINPUT_DEVICE_LIST Example''' 

Get all device types connected to input ports:

Byte codes: opINPUT_DEVICE_LIST,LC0(4),GV0(0),GV0(4),
\ /
\ -------
\ /
Hex values send: 0900xxxx00050098046064


Hex value received: 0800xxxx027E7E7E7D00
^---------
|
Command global variable (response buffer offset) 0=port 1 type, 1=port 2 type, 2=port 3 type, 3=port4 type, 4=change flag.

'''opMEMORY_WRITE Example''' 

Write 0x01 0x02 0x03 0x04 0x05 into global variable 4..8 of user program running in slot 1:

opINIT_BYTES,LV0(0),LC0(5),1,2,3,4,5,
opMEMORY_WRITE,LC0(1),LC0(0),LC0(4),LC0(5),LV0(0),

Bytes actually sent to brick:

1300xxxx8000142F400501020304057E0100040540
bbbbmmmmtthhhhccccccccccccccccCCCCCCCCCCCC

bbbb = bytes in message, mm = message counter, tt = type of command, hhhh = header, cc/CC = byte codes.

hhhh = 10 least significant bits are number of globals, 6 most significal bits are locals


Bytes received from brick:

0600xxxx02
bbbbmmmmtt

bbbb = bytes in message, mm = message counter, tt = type of command, rr = global variables (response).


'''opMEMORY_READ Example''' 

Read global variable 4..8 from user program running in slot 1:
opMEMORY_READ,LC0(1),LC0(0),LC0(4),LC0(5),GV0(0),

Bytes actually sent to brick:

0B00xxxx0005007F0100040560
bbbbmmmmtthhhhcccccccccccc

bbbb = bytes in message, mm = message counter, tt = type of command, hhhh = header, cc = byte codes.

hhhh = 10 least significant bits are number of globals, 6 most significal bits are locals


Bytes received from brick:

0800xxxx02xxxxxxxxxx
bbbbmmmmttrrrrrrrrrr

bbbb = bytes in message, mm = message counter, tt = type of command, rr = global variables (response).


'''opINFO GET_ID Example'''

Read 6 bytes ID from brick:

opINFO,LC0(GET_ID),LC0(6),GV0(0)

Bytes actually sent to brick:

0900xxxx0006007C000660
bbbbmmmmtthhhhcccccccc

bbbb = bytes in message, mm = message counter, tt = type of command, hhhh = header, cc = byte codes.

hhhh = 10 least significant bits are number of globals, 6 most significal bits are locals


Bytes received from brick:

0900xxxx02xxxxxxxxxxxx
bbbbmmmmttrrrrrrrrrrrr

bbbb = bytes in message, mm = message counter, tt = type of command, rr = global variables (response).


'''opPROGRAM_START Example'''

Run app byte code file (../apps/tst/tst.rbf) in user slot (1):


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),
opPROGRAM_START,LC0(USER_SLOT),LV0(0),LV0(4),LC0(0),

Bytes actually sent to brick:

2400xxxx800020C00801802E2E2F617070732F7473742F7473742E7262660040440301404400
bbbbmmmmtthhhhccccccccccccccccccccccccccccccccccccccccccccccccccccCCCCCCCCCC

bbbb = bytes in message, mm = message counter, tt = type of command, hhhh = header, cc/CC = byte codes.

hhhh = 10 least significant bits are number of globals, 6 most significal bits are locals



'''opPROGRAM_STOP Example''' 

Stop program in user slot (1):

opPROGRAM_STOP,LC0(USER_SLOT),


Bytes actually sent to brick:

0700xxxx8000000201
bbbbmmmmtthhhhcccc

bbbb = bytes in message, mm = message counter, tt = type of command, hhhh = header, cc/CC = byte codes.

hhhh = 10 least significant bits are number of globals, 6 most significal bits are locals

To be able to follow the development of the communication system and benchmark the performance some
test cases are defined. These test cases will give reproducible results for all involved.


*********************************************************************************************************
Case 1. Direct Command to Brick without hardware intervention response:

Move 32 bit constant to global variable (response buffer)


Byte codes: opMOVE32_32,LC4(1),GV0(0)
\ / \
\ / \
Hex values send to brick: 0C00xxxx0004003A830100000060
========
/
32 bit value copied to response
/
========
Hex values received from brick: 0700xxxx0201000000

—-

Last modified 4 years ago Last modified on Sep 27, 2013, 11:16:07 AM