From 4eba89add8db804c33e8692edf5b27c2d3a2e365 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 7 Apr 2017 21:49:36 +0200 Subject: o Cleaning up code, fixing many small bugs. o Making a better envelope format. o Reading out the interface's channel. --- include/wifi-triangulator/core.h | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'include') 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 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); +int launch_reader(std::function on_buffer); + +int launch_reader_envelope(std::function 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 -- cgit v1.2.3