Gathering first data from textPacket
This commit is contained in:
parent
9c18c50640
commit
5d3e861fc9
@ -2,10 +2,32 @@
|
|||||||
#define EE781A91_6D07_47AC_B3C4_F99E29F3731F
|
#define EE781A91_6D07_47AC_B3C4_F99E29F3731F
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include "../DTO/packet.hpp"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
|
std::vector<std::string> split(const std::string& s, char delimiter)
|
||||||
|
{
|
||||||
|
std::vector<std::string> tokens;
|
||||||
|
std::string token;
|
||||||
|
std::istringstream tokenStream(s);
|
||||||
|
while (std::getline(tokenStream, token, delimiter))
|
||||||
|
{
|
||||||
|
tokens.push_back(token);
|
||||||
|
}
|
||||||
|
return tokens;
|
||||||
|
}
|
||||||
|
|
||||||
void textPacketHandler(std::vector<std::string> textPacket){
|
void textPacketHandler(std::vector<std::string> textPacket){
|
||||||
/// Here we have to parse the packet
|
/// Here we have to parse the packet
|
||||||
|
// Create empty packet
|
||||||
|
Packet packet;
|
||||||
|
|
||||||
|
const std::string textHeader = textPacket[0];
|
||||||
|
|
||||||
|
const std::vector<std::string> headerData = split(textHeader, ' ');
|
||||||
|
|
||||||
|
std::string textTimestamp = headerData[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* EE781A91_6D07_47AC_B3C4_F99E29F3731F */
|
#endif /* EE781A91_6D07_47AC_B3C4_F99E29F3731F */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user