Hi All,
I think I have my decoding for the received UDP messages from the bulbs messed up, is any able to decode the raw and tell me what i should be getting, Thanks.
What I have: Raw:
0x 29 00 00 54 00 00 00 00 D0 73 D5 00 07 43 00 00 4C 49 46 58 56 32 00 00 C4 F4 D9 50 ED 03 2A 14 03 00 00 00 01 7C DD 00 00
Header:
Size: 41
Origin: 1
Tagged: false
Addressable: true
Protocol: 1024
Source: 0
Target: 0x D0:73:D5:00:07:43:00:00
ReservedA: 0x 4C:49:46:58:56:32
ReservedB: 0
AckRequired: false
ResRequired: false
Sequence: 0
ReservedA: 536883882
PacketType: 3
ReservedD: 0
Payload:
0x 01 7C DD 00 00
What I am looking to do is identify the message as a LIFX bulb and then decode to update my status in my program.
Instead of listening on port 56700 I recommend listening to an ephemeral port, and then sending them through that socket. This way the packets will be sent with the source port of the port you are listening on. Then if you set the source field to non zero the packets will be returned to that port and your listening socket. You are much less likely to see other traffic this way.
One way to possibly tell if the packet comes from a LIFX bulb would be to look at the MAC address. Currently all LIFX MAC addresses should start with D0:73:D5. This isn’t really future proof though as in the future we might get more MAC address ranges.