patlux / node-cec

cec-client wrapper in nodejs
29 stars 6 forks source link

commands send in a burst get mashed up into something invalid #3

Closed Garfonso closed 8 years ago

Garfonso commented 8 years ago

I did something like this in my code: cec.sendCommand(senderAddress + device.address, CEC.Opcode.GIVE_OSD_NAME); cec.sendCommand(senderAddress + device.address, CEC.Opcode.GIVE_AUDIO_STATUS); cec.sendCommand(senderAddress + device.address, CEC.Opcode.GIVE_PHYSICAL_ADDRESS); cec.sendCommand(senderAddress + device.address, CEC.Opcode.GIVE_DEVICE_POWER_STATUS);

The result was traffic like this: 50:46:71:83:8f

Obviously libcec recognized all of this was meant to go to the same devices and compressed the single commands into one big. I could not find anything in CEC specifications that allows this. My TV also did not understand what I want and ignored the command. I tried a bit more and even if I send commands to different devices (i.e. query power status of multiple devices in a for loop) the commands get mashed up into one string. So something is not right with this.

The fix is quite easy: Add a newline at the end of the command in sendCommand ( here https://github.com/patlux/node-cec/blob/master/src/node-cec.coffee#L62 ).

patlux commented 8 years ago

Hi Grafonos,

thank you! I will look at this issue in the next few days..