patlux / node-cec

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

Get mi address #4

Open chumager opened 7 years ago

chumager commented 7 years ago

Hi, how can I know my own address?

if I set the -m flag, when I send a poll I only get the POLLING event from my packet and no response.

the only thing I can figure out is to take off the -m flag and count the repeated polling messages, the one who repeats twice is my address...

any ideas?

Best regards.

krellsebastian commented 6 years ago

I had the same problem, I've managed to read out the own logical address with:

cec.on('REPORT_PHYSICAL_ADDRESS', function (packet, status) {
  cec_src_and_dest = parseInt(packet.source + '0',16);
});

the cec-client in the background broadcasts it's physical address when initializing, so i use this to read out my own LA out of the source field. Be aware that i also add a 0 in hex because all of my commands then are directed to the TV.

chumager commented 6 years ago

good one @krellsebastian thks...