LoopbackDevice unserializes and serializes

This way the loopback backend is more similar to regular backends
This commit is contained in:
Albert Vaca 2013-08-30 19:07:08 +02:00
parent 0f2ec417ce
commit 4eb5dda9c1
2 changed files with 11 additions and 4 deletions

View file

@ -27,3 +27,13 @@ LoopbackDeviceLink::LoopbackDeviceLink(const QString& deviceId, LoopbackLinkProv
{
}
bool LoopbackDeviceLink::sendPackage(const NetworkPackage& toSend) const
{
NetworkPackage toReceive("");
NetworkPackage::unserialize(toSend.serialize(), &toReceive);
Q_EMIT receivedPackage(toReceive);
return true;
}

View file

@ -31,10 +31,7 @@ class LoopbackDeviceLink
public:
LoopbackDeviceLink(const QString& d, LoopbackLinkProvider* a);
bool sendPackage(const NetworkPackage& np) const {
Q_EMIT receivedPackage(np);
return true;
}
bool sendPackage(const NetworkPackage& np) const;
};