galmon/navmon.hh

22 lines
560 B
C++
Raw Normal View History

#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
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);
}
};