]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/centralstation.cpp
Add helper class for processing driver options
[r2c2.git] / source / libr2c2 / centralstation.cpp
index 124c1beed8aa14efba0fc96bc59a8ab17ca7a709..fc7855b0726fc9fbcf8183d45e3b05ddd57d35ad 100644 (file)
@@ -14,7 +14,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 +23,7 @@ CentralStation::CentralStation(const string &host):
        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());