diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2017-04-07 17:45:02 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2017-04-07 17:45:02 +0200 |
commit | 84939234eb66fe7957eaf39956f18224e3108c25 (patch) | |
tree | 97a6d77c92ad373199cd3aecb2cbcb6488357480 /misc.cpp | |
parent | bed4c80f31051ec47463caa3e9511374062c6536 (diff) | |
download | wifi-triangulator-84939234eb66fe7957eaf39956f18224e3108c25.tar.gz wifi-triangulator-84939234eb66fe7957eaf39956f18224e3108c25.tar.bz2 wifi-triangulator-84939234eb66fe7957eaf39956f18224e3108c25.tar.xz wifi-triangulator-84939234eb66fe7957eaf39956f18224e3108c25.zip |
o Refactoring into two parts, sender and receiver that sends protobuf messages over UDP.
Diffstat (limited to 'misc.cpp')
-rw-r--r-- | misc.cpp | 35 |
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 |