decoder.h 711 B

12345678910111213141516171819202122232425262728
  1. #pragma once
  2. #include <stdbool.h>
  3. #include <stdint.h>
  4. #include <stddef.h>
  5. typedef struct SubGhzBlockDecoder SubGhzBlockDecoder;
  6. struct SubGhzBlockDecoder {
  7. uint32_t parser_step;
  8. uint32_t te_last;
  9. uint64_t decode_data;
  10. uint8_t decode_count_bit;
  11. };
  12. /**
  13. * Add data bit when decoding.
  14. * @param decoder Pointer to a SubGhzBlockDecoder instance
  15. * @param bit data, 1bit
  16. */
  17. void subghz_protocol_blocks_add_bit(SubGhzBlockDecoder* decoder, uint8_t bit);
  18. /**
  19. * Getting the hash sum of the last randomly received parcel.
  20. * @param decoder Pointer to a SubGhzBlockDecoder instance
  21. * @return hash Hash sum
  22. */
  23. uint8_t subghz_protocol_blocks_get_hash_data(SubGhzBlockDecoder* decoder, size_t len);