Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

31 rader
742 B

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