aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2017-04-07 21:49:36 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2017-04-07 21:49:36 +0200
commit4eba89add8db804c33e8692edf5b27c2d3a2e365 (patch)
tree5fba0a0fa4d6010d13f99215508212086a116063 /include
parent36e59a1991f075e36e117a08321d5e4c4dc00eac (diff)
downloadwifi-triangulator-master.tar.gz
wifi-triangulator-master.tar.bz2
wifi-triangulator-master.tar.xz
wifi-triangulator-master.zip
o Cleaning up code, fixing many small bugs.HEADmaster
o Making a better envelope format. o Reading out the interface's channel.
Diffstat (limited to 'include')
-rw-r--r--include/wifi-triangulator/core.h27
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