X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Fcentralstation.cpp;h=5e82f2e5f117c23d9137bb80ff41b0b4359d2ecb;hb=b78b49d85fbb9b2901c77e6450cfd41c0a818ac1;hp=124c1beed8aa14efba0fc96bc59a8ab17ca7a709;hpb=73e4a36bbf828e07b83a779b696875e1f80045cc;p=r2c2.git diff --git a/source/libr2c2/centralstation.cpp b/source/libr2c2/centralstation.cpp index 124c1be..5e82f2e 100644 --- a/source/libr2c2/centralstation.cpp +++ b/source/libr2c2/centralstation.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -14,7 +15,7 @@ using namespace Msp; namespace R2C2 { -CentralStation::CentralStation(const string &host): +CentralStation::CentralStation(const Options &opts): socket(Net::INET), pending_commands(0), power(false), @@ -23,7 +24,7 @@ CentralStation::CentralStation(const string &host): accessories_synced(false), sensors_synced(false) { - RefPtr addr = Net::resolve(host+":15471"); + RefPtr addr = Net::resolve(opts.get(string())+":15471"); socket.connect(*addr); IO::print("Connected to central station at %s\n", addr->str()); @@ -328,6 +329,11 @@ bool CentralStation::get_sensor(unsigned addr) const return false; } +float CentralStation::get_telemetry_value(const string &name) const +{ + throw key_error(name); +} + void CentralStation::tick() { while(Message msg = receive())