IV. High level protocol
A. Overview
The high level protocol is available by using our demo application that is connecting to the
serial port and that can be accessed by the user’s application through a socket.
The application requires Python 3 to be installed on the user’s application computer and,
also, depends on PySerial (tested with PySerial versions 3.0.1, 3.2.4 and 3.3).
The demo application requires one parameter (serial port name) and listens on port 5127
TCP.
You can use telnet or other similar application to test the daemon, sending simple
commands and receiving JSON response messages.
The JSON answer is a list containing the hexadecimal values of the binary low level
protocol in chapter III or an interpreted message, depending on the issued command.
B. Protocol description
1. Write to memory - METWRITEMEM
This command writes a set of bytes starting at a specified address. The data set length
cannot be longer than 64 bytes. The dataset is a list of bytes, in decimal format.
Command
Example, setting second price to 1600 (EUR16.00)
METWRITEMEM(4,0,0,6,64)
First parameter of this function is the address to start writing, the rest of the parameters are byte values to write
Device response
{"DeviceResponse": "Acknowledge","MessageID": 101}
{"Error": "Syntax Error","ErrorCode": 1001}
{"Error": "Unknown command","ErrorCode": 1002}
2. Read from memory - METREADMEM
This command writes a set of bytes starting at a specified address. The data set length
cannot be longer than 120 bytes. The dataset is a list of bytes, in decimal format.
Command
Example, reading second price
METREADMEM(4,4)
First parameter of this function is the address to start reading, the second parameter is the length (in bytes) to read
Device response
"{DeviceMessage": "ReadMemory",
"StartAddress": 0,
"DataLegth": 10,
"MemoryData": [0,0,0,100,0,0,0,150,0,0]}
© - 2018 – AUTOMATROM SRL –