MDB-RS232 Codec
Talks to vending-machine peripherals on the MDB bus (coin changers, bill validators, cashless readers) through a WEFU MDB-RS232 adapter, or a pin-compatible clone, on a serial port at 9600-8-N-1. The adapter does the real-time MDB polling itself; CycBox sends it commands and reads what it reports.
The link is asymmetric, and the codec handles both directions:
- Sending: commands go out as raw bytes with no terminator. For example, send
14 01(cashless READER ENABLE) as hex from a message input. Sent commands show in hex in the message list. - Receiving: the adapter prints the MDB bytes as ASCII hex pairs on a
\r\n-terminated line, such as10 01 03. The codec turns each line back into the bytes0x10 0x01 0x03, so the hex view shows the real MDB data. Lines that are not hex are kept as received. If 4 KiB arrive without a line ending, they are flushed as one raw message.
Each received message is classified in its metadata, so a Lua script can route it.
mdb_frame_kind is one of:
auto_report: the line starts with a known device address:08coin,10/60cashless 1 / 2,30bill,40universal satellite device,68age verification. These messages also carrymdb_device(the device name) and the valuemdb_device_id(the address byte).response: an unaddressed line received right after a command.unknown: anything else.
Configuration reference
| Config ID | mdb_codec |
| Selected by | app_codec = "mdb_codec" |
| Platforms | Linux, Windows, Android |
| License | Free |
WEFU MDB-RS232 serial adapter: raw HEX out, ASCII-hex lines in (parsed to MDB bytes)
This codec has no settings of its own.
Example config
Default values as they appear in a saved configuration (for example the JSON block at the end of a cycbox/examples/*.lua file). Settings detected at runtime are omitted.
{
"app": {
"app_codec": "mdb_codec"
}
}