diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/wifi-triangulator/core.h | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/include/wifi-triangulator/core.h b/include/wifi-triangulator/core.h index 042490a..15fb07b 100644 --- a/include/wifi-triangulator/core.h +++ b/include/wifi-triangulator/core.h @@ -9,6 +9,10 @@ namespace wifi_triangulator { +extern std::string app_name; + +typedef std::basic_string<uint8_t> bstring; + struct eth_mac { uint8_t a, b, c, d, e, f; @@ -45,21 +49,36 @@ struct eth_mac { class data { public: - pb::packet_type type; + pb::frame_type type; long sec; long usec; int rssi; + int mhz; eth_mac src, dst; - data(pb::packet_type type, long sec, long usec, int rssi, eth_mac src, eth_mac dst) : - type(type), sec(sec), usec(usec), src(src), rssi(rssi), dst(dst) {} + data(pb::frame_type type, long sec, long usec, int rssi, int mhz, eth_mac src, eth_mac dst) : + type(type), sec(sec), usec(usec), rssi(rssi), mhz(mhz), src(src), dst(dst) {} }; int launch_capture(std::string dev, std::function<void(const class data &)>); +int launch_reader(std::function<bool(uint16_t size, const uint8_t *data)> on_buffer); + +int launch_reader_envelope(std::function<bool(const pb::envelope &)> on_envelope); + +ssize_t read_stdin(uint8_t *data, size_t left); + +//void write_stdout(const bstring &s); + +void write_stdout(const std::string &s); + +void write_stdout(const uint8_t *data, size_t count); + +void write_envelope(pb::letter_type lt, pb::envelope &envelope); + } // namespace wifi_triangulator namespace std { -string to_string(wifi_triangulator::pb::packet_type t); +string to_string(wifi_triangulator::pb::frame_type t); } // namespace std |