momodalo / broadlinkjs

A Node.JS library for controlling Broadlink RM2/3 (Pro) remote controls
MIT License
53 stars 33 forks source link

MAC address incorrect #5

Open lprhodes opened 7 years ago

lprhodes commented 7 years ago

Hey,

Just wondering why you commented out the hex reference on line 173 (which is the correct)

momodalo commented 7 years ago

I am an old school programmer, so prefer copy method more than assign :)

momodalo commented 7 years ago

wait...Do you think the address range is incorrect? I tested with hex dump and think this one is correct. May need to check again.

lprhodes commented 7 years ago

The original address range commented out on line 173 is correct though it returns in an odd order. The correct order is as follows:

msg.copy(mac, 0x00, 0x3D);
msg.copy(mac, 0x01, 0x3E);
msg.copy(mac, 0x02, 0x3F);
msg.copy(mac, 0x03, 0x3C);
msg.copy(mac, 0x04, 0x3B);
msg.copy(mac, 0x05, 0x3A);