You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
734 B

  1. #pragma once
  2. #include <SIM808_Types.h>
  3. #include "PositionsBackup.h"
  4. #define POSITION_SIZE 115
  5. struct PositionEntryMetadata {
  6. int8_t batteryLevel; //sizeof = 1
  7. int16_t batteryVoltage; //sizeof = 2
  8. float temperature; //sizeof = 4
  9. uint16_t timeToFix; //sizeof = 2
  10. SIM808_GPS_STATUS status; //sizeof = 1
  11. }; //sizeof = 10
  12. struct PositionEntry {
  13. PositionEntryMetadata metadata; //sizeof = 10
  14. char position[POSITION_SIZE]; //sizeof = 115
  15. }; //sizeof = 125
  16. namespace positions {
  17. void setup();
  18. bool acquire(PositionEntryMetadata &metadata);
  19. void appendLast(const PositionEntryMetadata &metadata);
  20. bool get(uint16_t index, PositionEntry &entry);
  21. bool moveNext(uint16_t &index);
  22. void doBackup();
  23. }