4

I'm REing the Bluetooth protocol for the Ecoflow Delta 2 power station, and so far I've had some success. But there's a strange behaviour that, while not hampering my efforts, has me puzzled.

The packets come as a 16 byte header, a variable length payload, and a 2 byte CRC. The header contains the sorts of things you would expect: a magic number, payload length, and message type. But there's a 1-byte field that is used to XOR the payload. Most of the time this field is 0, but there are occasional runs of 0x34, 0x25, and rarely 0x28. I've not observed any other values, but they might occur. The CRC is calculated based on the raw payload, not the cleartext version.

I'm struggling to figure out why the designers should have done such a thing. It can't be for encryption because the field is 0 more often than not. It can't be for error-checking because the CRC is calculated on the "encrypted" array - and there's a CRC anyway.

There doesn't seem to be a pattern in the number of messages that are XORed either.

2
  • 2
    May be the protocol was derived from an older protocol that works closer on hardware level and thus needs to avoid situations where too many following zeros or ones are causing problems (today you would simply use 8b/10b encoding).
    – Robert
    Commented Apr 14, 2023 at 17:19
  • Nice idea! The packets do have strings of 0s most of the time. It doesn't explain why the XOR byte is 0 at least 50% of the time, but you could be on to something. Commented Apr 14, 2023 at 19:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.