// Configure sets a Device configuration
Configure sets a Device configuration
// Configure sets a Device configuration
func (d *Device) Configure(c Config) error {
	if c.Repeat <= 0 {
		c.Repeat = 10
	}
	if c.Protocol <= 0 {
		c.Protocol = 1
	}
	if c.Protocol > len(protocols) {
		return fmt.Errorf("Protocol %d not supported valid: 1-%d", c.Protocol, len(protocols))
	}
	d.c = c
	return nil
}
func ( d * Device ) Configure ( c Config ) error { if c . Repeat <= 0 { c . Repeat = 10 } if c . Protocol <= 0 { c . Protocol = 1 } if c . Protocol > len ( protocols ) { return fmt . Errorf ( " " , c . Protocol , len ( protocols ) ) } d . c = c return nil }
Configure sets a Device configuration
Configure sets a Device configuration
// "protocol notation", protocol 1 is protocols[0] and so on