#ifndef INDOOR_WIFIRAW_H #define INDOOR_WIFIRAW_H #include /** * parse raw binary wifi packets as defined within the standard */ class WiFiRAW { public: enum Tags { TAG_SSID = 0x00 }; struct TaggedParams { std::string ssid; }; /** parsed tagged params within wifi packets: [tag][len][len-bytes][tag][len][len-bytes]... */ static TaggedParams parseTaggedParams(const uint8_t* data, const size_t len) { TaggedParams res; int pos = 0; while(pos < len) { const int tag = data[pos+0]; // the tag-ID const int len = data[pos+1]; // the lenght of the following data switch(tag) { case TAG_SSID: res.ssid = std::string( (const char*) &(data[pos+2]), len); break; } // position at the start of the next tag pos += 1 + 1 + len; } return res; } }; #endif // INDOOR_WIFIRAW_H