// HandleWriteCommands passes a slice of CommandRequest struct each representing
// a ResourceOperation for a specific device resource.
// Since the commands are actuation commands, params provide parameters for the individual
// command.
HandleWriteCommands passes a slice of CommandRequest struct each representing
a ResourceOperation for a specific device resource.
Since the commands are actuation commands, params provide parameters for the individual
command.
// HandleWriteCommands passes a slice of CommandRequest struct each representing // a ResourceOperation for a specific device resource . // Since the commands are actuation commands params provide parameters for the individual // command .
func (w *WebcamDriver) HandleWriteCommands(deviceName string, protocols map[string]contract.ProtocolProperties, reqs []dsModels.CommandRequest,
	params []*dsModels.CommandValue) error {
	w.lc.Debug("WebcamDriver.HandleWriteCommands called")
	if len(reqs) != 1 {
		err := fmt.Errorf("WebcamDriver.HandleWriteCommands; too many command requests; only one supported")
		return err
	}
	if len(params) != 1 {
		err := fmt.Errorf("WebcamDriver.HandleWriteCommands; the number of parameter is not correct; only one supported")
		return err
	}
	w.lc.Debug(fmt.Sprintf("WebcamDriver.HandleWriteCommands: protocols: %v, resource: %v, parameters: %v", protocols, reqs[0].DeviceResourceName, params))
	w.lc.Debug("WebcamDriver.HandleWriteCommands exited")
	return nil
}
func ( w * WebcamDriver ) HandleWriteCommands ( deviceName string , protocols map [ string ] contract . ProtocolProperties , reqs [ ] dsModels . CommandRequest , params [ ] * dsModels . CommandValue ) error { w . lc . Debug ( " " ) if len ( reqs ) != 1 { err := fmt . Errorf ( " " ) return err } if len ( params ) != 1 { err := fmt . Errorf ( " " ) return err } w . lc . Debug ( fmt . Sprintf ( " " , protocols , reqs [ 0 ] . DeviceResourceName , params ) ) w . lc . Debug ( " " ) return nil }
HandleWriteCommands passes a slice of CommandRequest struct each representing
a ResourceOperation for a specific device resource.
HandleWriteCommands passes a slice of CommandRequest struct each representing a ResourceOperation for a specific device resource .
// TODO: make the FPS and input source configurable // var err error // if s.switchButton, err = params[0].BoolValue(); err != nil { // 	err := fmt.Errorf("WebcamDriver.HandleWriteCommands; the data type of parameter should be Boolean, parameter: %s", params[0].String()) // 	return err // }