]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/driver.cpp
Add driver for my custom Arduino-based control device
[r2c2.git] / source / libr2c2 / driver.cpp
index ea903afd14bbee7403052975457d2966a004ef4a..04df5f4e82465f9c8d57ab28b0e24ec222e122bb 100644 (file)
@@ -1,11 +1,5 @@
-/* $Id$
-
-This file is part of R²C²
-Copyright © 2010  Mikkosoft Productions, Mikko Rasa
-Distributed under the GPL
-*/
-
-#include <msp/core/except.h>
+#include "arducontrol.h"
+#include "centralstation.h"
 #include "driver.h"
 #include "dummy.h"
 #include "intellibox.h"
@@ -25,10 +19,14 @@ Driver *Driver::create(const string &str)
 
        if(type=="ib" || type=="intellibox")
                return new Intellibox(params);
+       else if(type=="cs" || type=="centralstation")
+               return new CentralStation(params);
+       else if(type=="ac" || type=="arducontrol")
+               return new ArduControl(params);
        else if(type=="dummy")
-               return new Dummy;
+               return new Dummy(params);
 
-       throw Msp::InvalidParameterValue("Unknown driver");
+       throw invalid_argument("Driver::create");
 }
 
 } // namespace R2C2