Tarcontar/ArduinoMDB

[Question] Command translation

Closed this issue · 2 comments

I am seeing in the documentation of MDB 4.2 the commands for example for CoinChanger:

image

However, in your code you have the following commands to send https://github.com/Tarcontar/ArduinoMDB/blob/master/CoinChanger.cpp#L7.

I understand that there is some translation for you get for example for POLL-> 0BH -> 0x02.

The question is: Could you know how this translation is done?

Thank you.

Hi,
that's because those commands in the MdB spec are setup like that:
DeviceAdress | commandID.
For the poll command (0x03) of the coin changer (device Adress 0x08) the result is 0x08 | 0x03 = 0x0B.

Hope that helps.

Regards Tarcontar

Ahh ok, now I understand, I had not realized the relationship between the DeviceAddress and the command, it was very simple but I did not see it.
Thank you very much for your explanation.