Is this discovery packet ok?

Hi folks, I’m still struggling with the lan protocol…

I use Ruby, with bit-struct or bindata gems to forge lifx protocol packets. With the help of wireshark I can dump the content of the packet I send to discover lifx devices, but I’m still unsure if this packet is correctly forged.

Could someone tell me if this dump is a correct one ?

24 00 24 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 00 00 02 00 00 00

Thank you

So if you read the discovery workflow it mentions that you need to set tagged to 1.

When I decode your packet I get:

lifx_packet(
  frame_header=frame_header(
    size=36,
    origin=0,
    tagged=0,
    addressable=0,
    protocol=36,
    source=1),
  frame_address=frame_address(
    target=0,
    reserved1=0,
    reserved2=0,
    ack_required=1,
    res_required=1,
    sequence=0),
  protocol_header=protocol_header(
    reserved1=0,
    pkt_type=2,
    reserved2=0),
  payload=payload_getservice()
)

Which shows that tagged is instead set to zero.

Thank you Daniel, seems that I’m still messing up with the 16 bits bitfields endianness of the frame header :frowning: