V2RFEncoding.h 520 B

12345678910111213141516171819202122
  1. #include <Arduino.h>
  2. #include <inttypes.h>
  3. #ifndef _V2_RF_ENCODING_H
  4. #define _V2_RF_ENCODING_H
  5. #define V2_OFFSET_JUMP_START 0x54
  6. class V2RFEncoding {
  7. public:
  8. static void encodeV2Packet(uint8_t* packet);
  9. static void decodeV2Packet(uint8_t* packet);
  10. static uint8_t xorKey(uint8_t key);
  11. static uint8_t encodeByte(uint8_t byte, uint8_t s1, uint8_t xorKey, uint8_t s2);
  12. static uint8_t decodeByte(uint8_t byte, uint8_t s1, uint8_t xorKey, uint8_t s2);
  13. private:
  14. static uint8_t const V2_OFFSETS[][4];
  15. };
  16. #endif