// Sets a value.
// All types allowed except complex and uintptr.
Sets a value.
All types allowed except complex and uintptr.
// Sets a value . // All types allowed except complex and uintptr .
func (r *SensorChannel) SetValue(val interface{}) *SensorChannel {
	switch t := val.(type) {
	case float32, float64:
		r.Float = "1"
		r.Value = fmt.Sprintf("%v", t)
	case int8, uint8, int16, uint16, int32, uint32, uint64, int64, uint, int, string:
		r.Float = "0"
		r.Value = fmt.Sprintf("%v", t)
	case bool:
		r.Float = "0"
		r.Value = "0"
		if t {
			r.Value = "1"
		}
	default:
		fmt.Printf("type of %v is not supported\n", t)
	}
	return r
}
func ( r * SensorChannel ) SetValue ( val interface { } ) * SensorChannel { switch t := val . ( type ) { case float32 , float64 : r . Float = " " r . Value = fmt . Sprintf ( " " , t ) case int8 , uint8 , int16 , uint16 , int32 , uint32 , uint64 , int64 , uint , int , string : r . Float = " " r . Value = fmt . Sprintf ( " " , t ) case bool : r . Float = " " r . Value = " " if t { r . Value = " " } default : fmt . Printf ( " \n " , t ) } return r }
Sets a value.
Sets a value .