Skip to content
Kirill Shumilov edited this page May 6, 2020 · 7 revisions

Watch values

Since: 0.14.0 (Oct 4, 2017)

Direction: Board -> IDE

Format: +XOD:tNow:nodeId:value\r\n

name type description
tNow integer time when value was sent (in milliseconds since program start)
nodeId integer id of a watch node
value string stringified value

Example: +XOD:3781:5:3.141592\r\n

Tweak values

Since: 0.27.0 (Feb 8, 2019)

Direction: IDE -> Board

Format: +XOD:nodeId:value\r\n

name type description
nodeId integer id of a tweak node
value any value for the tweak node's output pin, generated code will know what type of value to expect

Example: +XOD:5:Hello there\r\n

Tethering internet communication

To provide a tethering internet from the connected PC to a program that runs on a microcontroller or in the simulation it supports two-way communication. This communication works on the same rules as Watch and Tweak values and an additional one: synchronous answer.

The data from a program to the PC is formatted as a Watch value: +XOD:tNow:nodeId:commandOrData\r\n. It contains an AT command or data to send to the socket. Each line of data is prepended with a such prefix.

On the most commands, the PC answers with the synchronous answer without any prefixing the message. The tethering internet node waits for the answer right after it sends a command.

The data from the socket to the program is formatted as a Tweak value: +XOD:nodeId:pkgSize:data\r\n. As you see the default value of tweak value contains additional metadata: the package size. The program will read all characters, including \r\n until receiving all bytes specified with this metadata.

When the package is readen by microcontroller it sends back to the PC an \6 character (acknowledge, char code 6), prepended with the watch-like prefix.

When the socket is closed the PC sends to the program (end of transmission, char code 4) character, prepended with the tweak-like prefix.

Example of communication:

sender type message description
MCU Watch-like +XOD:1001:1:AT\r\n Checks that tethering internet is ready to work
PC Synchronous OK\r\n Responses OK
MCU Watch-like +XOD:2001:1:AT+CIPSTART="TCP","10.0.0.1",80,0\r\n Command to open the TCP socket
PC Syncronous OK\r\n Responses OK
MCU Watch-like +XOD:3001:1:AT+CIPSEND=90\r\n Command to start sending data to the socket
PC Syncronous >\r\n Prompt symbol tells us that the PC is ready to read data to send
MCU Watch-like +XOD:4001:1:GET / HTTP/1.1\r\n The first line of HTTP request
MCU Watch-like +XOD:4001:1:Host: 10.0.0.1:80\r\n The second line
MCU Watch-like ... And so on until...
MCU Watch-like +XOD:4001:1:\r\n The request ends with two lines with EOL
PC Tweak-like +XOD:1:53:HTTP/1.1 200 OK\r\nServer: Apache\r\nContent-Type: t The first chunk of response
MCU Watch-like +XOD:5001:1:\6\r\n Microcontroller tells the PC that package is completely read and it's ready to receive the next one
PC Tweak-like +XOD:1:53:ext/html; charset=utf-8\r\nDate: Tue, 5 May 2020 12: The second and so on...
PC Tweak-like +XOD:1:1:␄ Connection closed

Report errors

Since: 0.30.0 (Jul 17, 2019)

Direction: Board -> IDE

Format: +XOD_ERR:tNow:nodeId:errType\r\n

name type description
tNow integer time when value was sent (in milliseconds since program start)
nodeId integer id of a node which emitted error
errorFlags 8-bit integer a mask where each bit represents an error for output

Add breakpoint (Pause execution before node...)

Since: ???

Direction: IDE -> Board

Remove breakpoint

Since: ???

Direction: IDE -> Board

Step forward

Since: ???

Direction: IDE -> Board

Resume execution (until next breakpoint)

Since: ???

Direction: IDE -> Board

Enable pausing on breakpoints

Since: ???

Direction: IDE -> Board

Disable pausing on breakpoints

Since: ???

Direction: IDE -> Board