From 61f3c432c9da8bd031245d81e2013f385a35666f Mon Sep 17 00:00:00 2001 From: Ruakij Date: Mon, 22 Nov 2021 21:26:17 +0100 Subject: [PATCH] Moved head-analyzing to own function --- handler/textPacketHandler.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/handler/textPacketHandler.hpp b/handler/textPacketHandler.hpp index 4ec9ac9..f4d99c1 100644 --- a/handler/textPacketHandler.hpp +++ b/handler/textPacketHandler.hpp @@ -29,11 +29,15 @@ const std::unordered_map PACKET_TYPE_MAP({ {"BA", PacketType::BlockAcknowledgment} }); +void parseHeader(Packet &packet, const std::vector &textPacket); void textPacketHandler(const std::vector textPacket){ /// Here we have to parse the packet // Create empty packet Packet packet; + parseHeader(packet, textPacket); +} +void parseHeader(Packet &packet, const std::vector &textPacket){ const std::string textHeader = textPacket[0]; const std::vector headerData = split(textHeader, ' '); @@ -142,6 +146,8 @@ void textPacketHandler(const std::vector textPacket){ // Write to packet probeResponsePacket.responseSsid = responseSsid; } +} + // }