Added decoding of receiving protocol everflourish
This commit is contained in:
parent
8565682ad8
commit
99f0b133a8
7 changed files with 76 additions and 4 deletions
|
@ -1,4 +1,7 @@
|
|||
#include "Controller.h"
|
||||
#include "Protocol.h"
|
||||
#include "ControllerMessage.h"
|
||||
#include <stdio.h> //TODO DEBUG
|
||||
|
||||
class Controller::PrivateData {
|
||||
public:
|
||||
|
@ -22,3 +25,15 @@ void Controller::publishData(const std::string &msg) const {
|
|||
data->controllerId = d->id;
|
||||
d->event->signal(data);
|
||||
}
|
||||
|
||||
void Controller::decodePublishData(const std::string &data) const {
|
||||
|
||||
ControllerMessage dataMsg(data);
|
||||
std::wstring protocolName = dataMsg.protocol();
|
||||
std::string dataParam = dataMsg.getParameter("data");
|
||||
std::list<std::string> msgList = Protocol::decodeData(protocolName, dataParam);
|
||||
|
||||
for (std::list<std::string>::iterator msgIt = msgList.begin(); msgIt != msgList.end(); ++msgIt){
|
||||
this->publishData(*msgIt);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue