uhf_data.h 665 B

1234567891011121314151617181920212223242526272829
  1. #pragma once
  2. #include <stdint.h>
  3. #include <stdlib.h>
  4. #define MAX_DATA_SIZE 32
  5. typedef struct UHFData {
  6. uint8_t data[MAX_DATA_SIZE];
  7. size_t length;
  8. bool start;
  9. bool end;
  10. struct UHFData* next;
  11. } UHFData;
  12. typedef struct UHFResponseData {
  13. UHFData* data;
  14. size_t size;
  15. } UHFResponseData;
  16. UHFData* uhf_data_alloc();
  17. int uhf_data_append(UHFData* uhf_data, uint8_t data);
  18. void uhf_data_reset(UHFData* uhf_data);
  19. void uhf_data_free(UHFData* uhf_data);
  20. UHFResponseData* uhf_response_data_alloc();
  21. UHFData* add_uhf_data_to_uhf_response_data(UHFResponseData* uhf_response_data);
  22. void uhf_response_data_free(UHFResponseData* uhf_response_data);