MDB Communication Protocal: Difference between revisions
(Created page with "== Introductio == This doc defines a serial protocol for Q3V application to communicate with MDB vending machine. Basically, the protocol is a f === Heading text ===") |
No edit summary |
||
Line 1: | Line 1: | ||
== | == Introduction == | ||
This | This manual describes the serial communication protocol between Q3v and MDB Interface Board, which will be short as “MIB” in follow content. | ||
The basic baud rate of serial port is set as 115200 | |||
=== | As the Q3 Pos could be receive command from MIB as a slave, and also could send command to MIB as a master (e.g., send “begin session” command to inform the MDB VMC it’s ready for pay), a mode byte was added in serial frame to show if a command is slave response or a master request. | ||
The request command always anticipates a response command except the checksum is wrong, or the incorrect serial format, in another word, the slave will use silence as a NAK. | |||
== MDB Forwarding mechanism == | |||
MIB will forward all the MDB cashless device commands (MDB spec section 7), except VMC request Poll. | |||
When the MIB receive the VMC request, it removes the MDB mode bit, fill into serial packet data area, and transmit to serial port. In the opposite direction, the MIB receive the response, it unwraps the packet, and adding mode bit to the tail bytes, sending to the VMC, wait for the acknowledge. | |||
Taking the RESET for example, the transfer data flow can be described as below. | |||
* VMC -> MIB: 0x110 0x10 | |||
* MIB -> Q3V: 0x09 0x04 0x00 0x10 0x10 0xE0 0x0D | |||
* MIB -> Q3V: 0x09 0x04 0x01 0x00 0x00 0xFF 0x0D | |||
* VMC -> MIB: 0x00 0x100 | |||
* VMC -> MIB: 0x00 | |||
== Protocol Packet Definition == | |||
=== Serial Port parameters === | |||
* Baud rate 115200 | |||
* 8bit, 1 stop bit, and no parity | |||
=== Packet format === | |||
{| class="wikitable" | |||
|- | |||
| Start code || Length || mode || MDB Raw Data || Checksum || End code | |||
|} |
Revision as of 07:51, 22 July 2022
Introduction
This manual describes the serial communication protocol between Q3v and MDB Interface Board, which will be short as “MIB” in follow content. The basic baud rate of serial port is set as 115200 As the Q3 Pos could be receive command from MIB as a slave, and also could send command to MIB as a master (e.g., send “begin session” command to inform the MDB VMC it’s ready for pay), a mode byte was added in serial frame to show if a command is slave response or a master request. The request command always anticipates a response command except the checksum is wrong, or the incorrect serial format, in another word, the slave will use silence as a NAK.
MDB Forwarding mechanism
MIB will forward all the MDB cashless device commands (MDB spec section 7), except VMC request Poll. When the MIB receive the VMC request, it removes the MDB mode bit, fill into serial packet data area, and transmit to serial port. In the opposite direction, the MIB receive the response, it unwraps the packet, and adding mode bit to the tail bytes, sending to the VMC, wait for the acknowledge. Taking the RESET for example, the transfer data flow can be described as below.
- VMC -> MIB: 0x110 0x10
- MIB -> Q3V: 0x09 0x04 0x00 0x10 0x10 0xE0 0x0D
- MIB -> Q3V: 0x09 0x04 0x01 0x00 0x00 0xFF 0x0D
- VMC -> MIB: 0x00 0x100
- VMC -> MIB: 0x00
Protocol Packet Definition
Serial Port parameters
- Baud rate 115200
- 8bit, 1 stop bit, and no parity
Packet format
Start code | Length | mode | MDB Raw Data | Checksum | End code |