mirror of
https://github.com/muccc/WomoLIN.git
synced 2026-03-12 20:16:48 +01:00
28 lines
588 B
C++
28 lines
588 B
C++
#include "include/managerbase.h"
|
|
|
|
namespace womolin::manager
|
|
{
|
|
ManagerBase::ManagerBase(
|
|
womolin::lib::common::interface::ISerial & serial )
|
|
: serial( serial )
|
|
, protocol ( womolin::protocol::Protocol() )
|
|
{
|
|
|
|
}
|
|
|
|
void ManagerBase::doWork()
|
|
{
|
|
message = "";
|
|
serial.readData( message );
|
|
auto key = message.substr(0, message.find(","));
|
|
auto value = message.substr(message.find(",") + 1);
|
|
|
|
if (signalVector.count(key))
|
|
{
|
|
signalVector.at(key)->UpdateUnit(key, value);
|
|
}
|
|
|
|
serial.writeData( key );
|
|
}
|
|
}
|