7. 1 Introduction
This document describes the messages exchanged between the Thymio
II robot and the Integrated Development Environment (IDE). These mes-
sages are independent from the transport (USB, TCP/IP, …)
1
8.
9. 2 Message Format
Each packet is composed of an header and a body:
length
source
type
0x00
0x02
0x04
0x06
body
…
The length, source, and type are 16 bit unsigned integer encoded as little
endian. The length gives the size of the body in bytes. Note the the size
of the body is not nesessarly a multiple of two, this is why the size is given
in bytes an not in words1
.
“Aseba messages payload data must be 512 bytes or smaller, which means
that the total packets size (len + source + type + payload) must be 518 bytes
or smaller.”
The source is zero for the IDE.
All integer fields in the messages are 16 bit wide encoded in little endian.
This seems unusual for those who are used to work with communication
protocols such as TCP/IP, but it is the natural order in the Thymio II’s CPU.
Some messages contains fields of type String. In this type, the field always
start with an unsigned 8 bit integer giving the size of the string, and the
an array of bytes encoded in Unicode/UTF-8 with the actual characters of
1
In Aseba, 1 word = 2 byte = 16 bit
3
10. 2 Message Format
the string. The size gives the number of bytes and not the length of the
string.
4
11. 3 Messages
3.1 Messages from bootloader control program to a
specific node
3.1.1 BOOTLOADER_RESET
2
source
0x8000
0x00
0x02
0x04
0x06
dest
3.1.2 BOOTLOADER_READ_PAGE
4
source
0x8001
0x00
0x02
0x04
0x06
dest
pageNumber
0x08
5
21. 3.5 Messages from IDE to a specific node
3.4.1 GET_DESCRIPTION
2
source
0xA000
0x00
0x02
0x04
0x06
version
This message is also known as the “presence” message. It is usually the
first message sent by the IDE to initiate the dialog with the robots.
3.5 Messages from IDE to a specific node
The following messages target a specific robot. The first argument in the
message’s payload is always the id of the robot.
3.5.1 SET_BYTECODE
size
source
0xA001
0x00
0x02
0x04
0x06
dest
start
bytecode[0]
…
bytecode[n]
0x08
0x0A
…
15
23. 3.5 Messages from IDE to a specific node
3.5.5 STEP
2
source
0xA005
0x00
0x02
0x04
0x06
dest
3.5.6 STOP
2
source
0xA006
0x00
0x02
0x04
0x06
dest
3.5.7 GET_EXECUTION_STATE
2
source
0xA007
0x00
0x02
0x04
0x06
dest
17