MDB Communication Protocal: Difference between revisions

From wizarPOS
No edit summary
No edit summary
Line 1: Line 1:
== Introduction ==
== Introduction ==
This manual describes the serial communication protocol between Q3v and MDB Interface Board, which will be short as “MIB” in follow content.
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
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.
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.
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 ==
== Protocol Packet Definition ==
=== Serial Port parameters ===
=== Serial Port parameters ===
Line 20: Line 13:
{| class="wikitable"
{| class="wikitable"
|-
|-
| Start code || Length || mode || MDB Raw Data || Checksum || End code
| Start code || Length || mode || Data || Checksum || End code
|}
|}
* '''Start code''' size 1 byte, always be 0x09
* '''Length''' size: 1byte, the number bytes of mode, data, and checksum.
* '''Mode''' size: 1, 0x00 means a master request packet, 0x01 means a slave response packet, other value is prohibited.
* '''Data '''size: n bytes. The data could be raw MDB commands, such as SETUP, VEND(please refer the Multi-Drop Bus Protocol V4.3 for detials).<br>
Or the MIB control commands, such as GET VERSION, SET PARAMETER.
* '''Checksum''' size: 1byte, using LRC algorithm, input data were "mode, data"
== MDB Forwarding mechanism ==
MIB will forward all the MDB cashless device commands (MDB spec section 7), except VMC request Poll.<br>
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.<br>
Taking the RESET for example, the transfer steps can be described as below.
# ''VMC -> MIB: 0x110 0x10''
# ''MIB -> Q3V: 0x09 0x04 0x00 0x10 0x10 0xE0 0x0D''
# ''VMC -> MIB: 0x00 0x100''
# ''VMC -> MIB: 0x00''

Revision as of 08:26, 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.


Protocol Packet Definition

Serial Port parameters

  • Baud rate 115200
  • 8bit, 1 stop bit, and no parity

Packet format

Start code Length mode Data Checksum End code
  • Start code size 1 byte, always be 0x09
  • Length size: 1byte, the number bytes of mode, data, and checksum.
  • Mode size: 1, 0x00 means a master request packet, 0x01 means a slave response packet, other value is prohibited.
  • Data size: n bytes. The data could be raw MDB commands, such as SETUP, VEND(please refer the Multi-Drop Bus Protocol V4.3 for detials).

Or the MIB control commands, such as GET VERSION, SET PARAMETER.

  • Checksum size: 1byte, using LRC algorithm, input data were "mode, data"


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 steps can be described as below.

  1. VMC -> MIB: 0x110 0x10
  2. MIB -> Q3V: 0x09 0x04 0x00 0x10 0x10 0xE0 0x0D
  3. VMC -> MIB: 0x00 0x100
  4. VMC -> MIB: 0x00