2019-08-30 17:08:56 -06:00
|
|
|
#pragma once
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <unistd.h>
|
2019-09-09 12:49:31 -06:00
|
|
|
#include <time.h>
|
|
|
|
#include <string>
|
2019-10-01 07:03:30 -06:00
|
|
|
#include <tuple>
|
2019-09-09 12:49:31 -06:00
|
|
|
|
2019-08-30 17:08:56 -06:00
|
|
|
struct EofException{};
|
|
|
|
size_t readn2(int fd, void* buffer, size_t len);
|
2019-09-09 12:49:31 -06:00
|
|
|
std::string humanTime(time_t t);
|
2019-10-01 07:03:30 -06:00
|
|
|
std::string humanTime(time_t t, uint32_t nanoseconds);
|
|
|
|
struct SatID
|
|
|
|
{
|
|
|
|
uint32_t gnss{255}; // these could all be 'int16_t' but leads to howling numbers of warnings with protobuf
|
|
|
|
uint32_t sv{0};
|
|
|
|
uint32_t sigid{0};
|
|
|
|
bool operator<(const SatID& rhs) const
|
|
|
|
{
|
|
|
|
return std::tie(gnss, sv, sigid) < std::tie(rhs.gnss, rhs.sv, rhs.sigid);
|
|
|
|
}
|
|
|
|
};
|