StartDriver is now optional

This commit is contained in:
Adrian Zankich 2013-11-12 23:41:22 -08:00
parent 7ae04386a9
commit 0480de0cf4
1 changed files with 4 additions and 1 deletions

View File

@ -23,7 +23,10 @@ func NewDevice(driver interface{}, r *Robot) *Device {
func (d *Device) Start() {
fmt.Println("Device " + d.Name + " started")
reflect.ValueOf(d.Driver).MethodByName("StartDriver").Call([]reflect.Value{})
r := reflect.ValueOf(d.Driver).MethodByName("StartDriver")
if r.IsValid() {
r.Call([]reflect.Value{})
}
}
func (d *Device) Command(method_name string, arguments []string) {