#include <algorithm>
+#include <msp/core/maputils.h>
#include <msp/core/refptr.h>
#include <msp/io/print.h>
#include <msp/net/resolve.h>
namespace R2C2 {
-CentralStation::CentralStation(const string &host):
+CentralStation::CentralStation(const Options &opts):
socket(Net::INET),
pending_commands(0),
power(false),
accessories_synced(false),
sensors_synced(false)
{
- RefPtr<Net::SockAddr> addr = Net::resolve(host+":15471");
+ RefPtr<Net::SockAddr> addr = Net::resolve(opts.get<string>(string())+":15471");
socket.connect(*addr);
IO::print("Connected to central station at %s\n", addr->str());
return false;
}
+float CentralStation::get_telemetry_value(const string &name) const
+{
+ throw key_error(name);
+}
+
void CentralStation::tick()
{
while(Message msg = receive())