Documentation
¶
Index ¶
- type Mock
- func (f *Mock) BatteryLevel() float64
- func (f *Mock) BatteryLevelRaw() int
- func (f *Mock) Buzz(n int) (err error)
- func (f *Mock) Close() error
- func (f *Mock) ConnectionStatus() scale.ConnectionStatus
- func (f *Mock) ElapsedTime() time.Duration
- func (f *Mock) IsBuzzingOnTouch() bool
- func (f *Mock) ResetTimer() error
- func (f *Mock) SetDataChannel(ch chan scale.DataPoint)
- func (f *Mock) SetDataHandler(fn func(data scale.DataPoint))
- func (f *Mock) SetStateChangeChannel(ch chan scale.ConnectionStatus)
- func (f *Mock) SetStateChangeHandler(fn func(status scale.ConnectionStatus))
- func (f *Mock) SetUnit(unit scale.Unit) error
- func (f *Mock) StartTimer() error
- func (f *Mock) StopTimer() error
- func (f *Mock) Tare() error
- func (f *Mock) ToggleBuzzingOnTouch() error
- func (f *Mock) TogglePrecision() error
- func (f *Mock) Unit() scale.Unit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mock ¶
type Mock struct {
// contains filtered or unexported fields
}
Mock denotes a Mock bluetooth scale
func (*Mock) BatteryLevel ¶
BatteryLevel returns the current battery level
func (*Mock) BatteryLevelRaw ¶
BatteryLevelRaw returns the current battery level in its raw form
func (*Mock) ConnectionStatus ¶
func (f *Mock) ConnectionStatus() scale.ConnectionStatus
ConnectionStatus returns the current status of the bluetooth device
func (*Mock) ElapsedTime ¶
ElapsedTime returns the current timer value
func (*Mock) IsBuzzingOnTouch ¶
IsBuzzingOnTouch returns if the scale buzzer is turned on or not (on user interaction)
func (*Mock) SetDataChannel ¶
SetDataChannel defines a handler function that is called upon retrieval of data
func (*Mock) SetDataHandler ¶
SetDataHandler defines a handler function that is called upon retrieval of data
func (*Mock) SetStateChangeChannel ¶
func (f *Mock) SetStateChangeChannel(ch chan scale.ConnectionStatus)
SetStateChangeChannel defines a handler function that is called upon state change
func (*Mock) SetStateChangeHandler ¶
func (f *Mock) SetStateChangeHandler(fn func(status scale.ConnectionStatus))
SetStateChangeHandler defines a handler function that is called upon state change
func (*Mock) ToggleBuzzingOnTouch ¶
ToggleBuzzingOnTouch turns the buzzer (on user interaction) on / off
func (*Mock) TogglePrecision ¶
TogglePrecision toggles the weight precision between 0.1 and 0.01