Code snippet for reading out channel names

The command COMMAND_MODULE_NAME_REQUEST (0xEF) results in 3 messages COMMAND_MODULE_NAME_PART1 (0xF0),
COMMAND_MODULE_NAME_PART2 (0xF1) and
COMMAND_MODULE_NAME_PART3 (0xF2) for a certain channel.
But concatenating the name parts goes wrong from time to time. The docs say I have to read out the data bytes as long as the byte < 255, but I must overlook something else.

Does anybody have some code snippet on how to do this right? Javascript would be super, but any other language will do.

Here’s an example of my rubbish output:

{id: 1, name: "Bluebû ò"}
{id: 2, name: "Push button û ò2-û ðYellowÞû ñ_û ò"}
{id: 3, name: "Yellow_û ò"}
{id: 4, name: "EL LEDS OFFû ò"}
{id: 5, name: "Enable Alm 1Âû ò"}
{id: 6, name: "Enable Alm 2±û ò "}
{id: 7, name: "Push button Ãû ò@7"}
{id: 8, name: "Push button ƒû ò€8"}

Thanks!

See https://github.com/StefCoene/velserver/blob/master/lib/Velbus/Velbus.pm
Starting at line 168.

Stef

1 Like

Exactly what I need, thanks!

Thanks Stef, exactly what I need!
I think I should give all of your code another look: lots of interesting stuff in there :wink: