Documentation
¶
Index ¶
Constants ¶
View Source
const ( CommandLogin = "login" CommandLogout = "logout" CommandSleep = "sleep" CommandAwake = "awake" CommandChangeSampleFrequency = "changeSampleFrequency" CommandDelete = "delete" )
Variables ¶
View Source
var ValidCommands = map[string]bool{ CommandLogin: true, CommandLogout: true, CommandSleep: true, CommandAwake: true, CommandChangeSampleFrequency: true, CommandDelete: true, }
Functions ¶
func HandleMeasurement ¶
method from sensorstate maybe
Types ¶
type SensorState ¶
type SensorState struct { Sensor Sensor // 16 bytes (string) LogsInfo chan string // 16 bytes LogsWarning chan string // 16 bytes LogsError chan string // 16 bytes SampleFrequency float64 // 8 bytes SampleFrequencyChangeChan chan float64 // 8 bytes IsSleep bool // 1 byte, at the end to avoid memory layout (7 bytes of padding) IsSleepChan chan bool // 1 byte, at the end to avoid memory layout (7 bytes of padding) }
func NewSensorState ¶
func NewSensorState(serialNumber string, SampleFrequency float64) *SensorState
func (*SensorState) HandleAwake ¶
func (sensorState *SensorState) HandleAwake()
func (*SensorState) HandleChangeSampleFrequency ¶
func (sensorState *SensorState) HandleChangeSampleFrequency(params map[string]interface{})
func (*SensorState) HandleSleep ¶
func (sensorState *SensorState) HandleSleep()
Click to show internal directories.
Click to hide internal directories.