Documentation
¶
Index ¶
Constants ¶
View Source
const ( RetryDelay = 3 * time.Second SerialReadTimeout = 5 * time.Second BaudRate = 9600 )
Variables ¶
View Source
var BrandCommands = map[string]string{
"rhino": "P",
"rhino bar 8rs": "P",
}
BrandCommands maps scale brands to their weight request commands
Functions ¶
func GenerateSimulatedWeights ¶
func GenerateSimulatedWeights() []float64
GenerateSimulatedWeights creates a sequence of realistic weight readings Returns 5 fluctuating values followed by a stable reading
func GetCommand ¶
GetCommand returns the command for a given brand Defaults to "P" if brand is unknown
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader manages serial port communication with the scale
func (*Reader) ClosePort ¶
func (r *Reader) ClosePort()
ClosePort closes the serial port for config changes
Click to show internal directories.
Click to hide internal directories.