aboutsummaryrefslogtreecommitdiff
path: root/misc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'misc.cpp')
-rw-r--r--misc.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/misc.cpp b/misc.cpp
new file mode 100644
index 0000000..ffe174f
--- /dev/null
+++ b/misc.cpp
@@ -0,0 +1,35 @@
+#include "wifi-triangulator/core.h"
+
+namespace std {
+string to_string(wifi_triangulator::pb::packet_type t) {
+ using wifi_triangulator::pb::packet_type;
+
+ switch (t) {
+ case packet_type::probe_request:
+ return "probe request";
+ case packet_type::beacon:
+ return "beacon";
+ case packet_type::probe_response:
+ return "probe response";
+ case packet_type::null:
+ return "null";
+ case packet_type::ack:
+ return "ack";
+ case packet_type::data:
+ return "data";
+ case packet_type::cts:
+ return "cts";
+ case packet_type::rts:
+ return "rts";
+ case packet_type::cf_end:
+ return "cf-end";
+ case packet_type::cf_end_cf_ack:
+ return "cf-end+cf-ack";
+ case packet_type::ps_poll:
+ return "ps-poll";
+ case packet_type::unknown:
+ default:
+ return "unknown";
+ }
+}
+} // namespace std