Generic Master
Master Command Group
With the Master Commands, the interface can be used to implement or simulate a "Vending Machine Controller".
Any communication initiated with the following commands will send out on the "TX" line of the MDB interface, answers will be expected on the "RX" line.
The M command is used to start or stop Master Mode. On the Pi Hat interface starting Master Mode will automatically set the slave (RX) interface pull-up to active so that slaves can answer to the master.
Stopping Master Mode will disable the pull-up on the RX interface line.
M,1 #start master mode (and set the slave line pull-up)M,0 #stop master mode (and disable the slave line pull-up)Possible answers from the interface:
m,ACK #success on enable/disable master modem,NACK #unknown parameter on master controlRequest Command Group (used for Master implementation)
MDB Generic Master sends request to the Bus using "R" command set. These commands have the following structure.
R,xx,yyyy #send a command/request to slave xx with data yyyyThe xx and yyyy data has to be checked directly on the MDB protocol here
Possible answers from the interface:
These answers are actually sent by the slave (either simulated with the MDB interface or sent by an actual peripheral like a coin acceptor or a cashless device).
p,ACK #the slave device sent an ACK to the command (it received and acknowledged the command)p,NACK #the slave device did not answer to the command (maybe there is no slave with address xx)p,YYYY #the slave device answered with the YYYY commandR,14,01 - send "reader enable" command to cashless device on address 0x10
- note that the arguments are given in hexadecimal, 2 digits

R,RESET #issue a bus reset condition to the MDB Bus