Documentation ¶
Index ¶
- Constants
- type BarometricSensor
- func (s *BarometricSensor) Disable() error
- func (s *BarometricSensor) Enable() error
- func (s BarometricSensor) GetName() string
- func (s *BarometricSensor) IsEnabled() (bool, error)
- func (s *BarometricSensor) IsNotifying() (bool, error)
- func (s *BarometricSensor) Read() (float64, error)
- func (s *BarometricSensor) StartNotify(macAddress string) error
- func (s *BarometricSensor) StopNotify() error
- type HumiditySensor
- func (s *HumiditySensor) Disable() error
- func (s *HumiditySensor) Enable() error
- func (s HumiditySensor) GetName() string
- func (s *HumiditySensor) IsEnabled() (bool, error)
- func (s *HumiditySensor) IsNotifying() (bool, error)
- func (s *HumiditySensor) Read() (float64, error)
- func (s *HumiditySensor) StartNotify() error
- func (s *HumiditySensor) StopNotify() error
- type LuxometerSensor
- func (s *LuxometerSensor) Disable() error
- func (s *LuxometerSensor) Enable() error
- func (s LuxometerSensor) GetName() string
- func (s *LuxometerSensor) IsEnabled() (bool, error)
- func (s *LuxometerSensor) IsNotifying() (bool, error)
- func (s *LuxometerSensor) Read() (float64, error)
- func (s *LuxometerSensor) StartNotify(macAddress string) error
- func (s *LuxometerSensor) StopNotify() error
- type MpuSensor
- func (s *MpuSensor) Disable() error
- func (s *MpuSensor) Enable() error
- func (s MpuSensor) GetName() string
- func (s *MpuSensor) IsEnabled() (bool, error)
- func (s *MpuSensor) IsNotifying() (bool, error)
- func (s *MpuSensor) Read() (float64, error)
- func (s *MpuSensor) StartNotify(macAddress string) error
- func (s *MpuSensor) StopNotify() error
- type Sensor
- type SensorTag
- type SensorTagDataEvent
- type SensorTagDeviceInfo
- type TemperatureSensor
- func (s *TemperatureSensor) Disable() error
- func (s *TemperatureSensor) Enable() error
- func (s TemperatureSensor) GetName() string
- func (s *TemperatureSensor) IsEnabled() (bool, error)
- func (s *TemperatureSensor) IsNotifying() (bool, error)
- func (s *TemperatureSensor) Read() (float64, error)
- func (s *TemperatureSensor) StartNotify() error
- func (s *TemperatureSensor) StopNotify() error
Constants ¶
const ( TemperaturePeriodHigh = 0x32 // 500 ms, TemperaturePeriodMedium = 0x64 // 1000 ms, TemperaturePeriodLow = 0x128 // 2000 ms, )
Period =[Input*10]ms,(lowerlimit 300 ms, max 2500ms),default 1000 ms
const DefaultRetry = 3
DefaultRetry times
const DefaultRetryWait = 500
DefaultRetryWait in millis
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BarometricSensor ¶
type BarometricSensor struct {
// contains filtered or unexported fields
}
BarometricSensor structure
func (*BarometricSensor) Disable ¶
func (s *BarometricSensor) Disable() error
Disable barometric measurements
func (*BarometricSensor) Enable ¶
func (s *BarometricSensor) Enable() error
Enable barometric measurements
func (BarometricSensor) GetName ¶
func (s BarometricSensor) GetName() string
GetName return the sensor name
func (*BarometricSensor) IsEnabled ¶
func (s *BarometricSensor) IsEnabled() (bool, error)
IsEnabled check if BarometricSensor measurements are enabled
func (*BarometricSensor) IsNotifying ¶
func (s *BarometricSensor) IsNotifying() (bool, error)
IsNotifying check if BarometricSensor sensors are Notifying
func (*BarometricSensor) Read ¶
func (s *BarometricSensor) Read() (float64, error)
Read value from the BarometricSensor sensors
func (*BarometricSensor) StartNotify ¶
func (s *BarometricSensor) StartNotify(macAddress string) error
StartNotify enable BarometricSensorDataChannel
func (*BarometricSensor) StopNotify ¶
func (s *BarometricSensor) StopNotify() error
StopNotify disable Barometric Sensor DataChannel
type HumiditySensor ¶
type HumiditySensor struct {
// contains filtered or unexported fields
}
HumiditySensor struct
func (*HumiditySensor) Disable ¶
func (s *HumiditySensor) Disable() error
Disable humidity measurements
func (*HumiditySensor) Enable ¶
func (s *HumiditySensor) Enable() error
Enable humidity measurements
func (HumiditySensor) GetName ¶
func (s HumiditySensor) GetName() string
GetName return the sensor name
func (*HumiditySensor) IsEnabled ¶
func (s *HumiditySensor) IsEnabled() (bool, error)
IsEnabled check if humidity measurements are enabled
func (*HumiditySensor) IsNotifying ¶
func (s *HumiditySensor) IsNotifying() (bool, error)
IsNotifying check if humidity sensor is notyfing
func (*HumiditySensor) Read ¶
func (s *HumiditySensor) Read() (float64, error)
Read value from the humidity sensor
func (*HumiditySensor) StartNotify ¶
func (s *HumiditySensor) StartNotify() error
StartNotify enable DataChannel for humidity
func (*HumiditySensor) StopNotify ¶
func (s *HumiditySensor) StopNotify() error
StopNotify disable DataChannel for humidity sensor
type LuxometerSensor ¶
type LuxometerSensor struct {
// contains filtered or unexported fields
}
LuxometerSensor sensor structure
func (*LuxometerSensor) Disable ¶
func (s *LuxometerSensor) Disable() error
Disable LuxometerSensor measurements
func (*LuxometerSensor) Enable ¶
func (s *LuxometerSensor) Enable() error
Enable LuxometerSensor measurements
func (LuxometerSensor) GetName ¶
func (s LuxometerSensor) GetName() string
GetName return the sensor name
func (*LuxometerSensor) IsEnabled ¶
func (s *LuxometerSensor) IsEnabled() (bool, error)
IsEnabled check if LuxometerSensor measurements are enabled
func (*LuxometerSensor) IsNotifying ¶
func (s *LuxometerSensor) IsNotifying() (bool, error)
IsNotifying check if LuxometerSensor sensors are Notifying
func (*LuxometerSensor) Read ¶
func (s *LuxometerSensor) Read() (float64, error)
Read value from the LuxometerSensor sensors
func (*LuxometerSensor) StartNotify ¶
func (s *LuxometerSensor) StartNotify(macAddress string) error
StartNotify enable LuxometerSensorDataChannel
func (*LuxometerSensor) StopNotify ¶
func (s *LuxometerSensor) StopNotify() error
StopNotify disable Luxometer Sensor DataChannel
type MpuSensor ¶
type MpuSensor struct {
// contains filtered or unexported fields
}
MpuSensor structure
func (*MpuSensor) IsNotifying ¶
IsNotifying check if mpu sensors are notifying
func (*MpuSensor) StartNotify ¶
StartNotify enable mpuDataChannel
func (*MpuSensor) StopNotify ¶
StopNotify disable DataChannel for mpu sensors
type SensorTag ¶
type SensorTag struct { *api.Device Temperature TemperatureSensor Humidity HumiditySensor Mpu MpuSensor Barometric BarometricSensor Luxometer LuxometerSensor DeviceInfo SensorTagDeviceInfo }
SensorTag a SensorTag object representation
type SensorTagDataEvent ¶
type SensorTagDataEvent struct { Device *api.Device SensorType string AmbientTempValue interface{} AmbientTempUnit string ObjectTempValue interface{} ObjectTempUnit string SensorID string BarometericPressureValue interface{} BarometericPressureUnit string BarometericTempValue interface{} BarometericTempUnit string HumidityValue interface{} HumidityUnit string HumidityTempValue interface{} HumidityTempUnit string MpuGyroscopeValue interface{} MpuGyroscopeUnit string MpuAccelerometerValue interface{} MpuAccelerometerUnit string MpuMagnetometerValue interface{} MpuMagnetometerUnit string LuxometerValue interface{} LuxometerUnit string FirmwareVersion string HardwareVersion string Manufacturer string Model string }
SensorTagDataEvent contains SensorTagSpecific data structure
type SensorTagDeviceInfo ¶
type SensorTagDeviceInfo struct {
// contains filtered or unexported fields
}
SensorTagDeviceInfo sensorTag structure
func (*SensorTagDeviceInfo) Read ¶
func (s *SensorTagDeviceInfo) Read() (*SensorTagDataEvent, error)
Read device info from sensorTag
type TemperatureSensor ¶
type TemperatureSensor struct {
// contains filtered or unexported fields
}
TemperatureSensor the temperature sensor structure
func (*TemperatureSensor) Disable ¶
func (s *TemperatureSensor) Disable() error
Disable measurements
func (TemperatureSensor) GetName ¶
func (s TemperatureSensor) GetName() string
GetName return the sensor name
func (*TemperatureSensor) IsEnabled ¶
func (s *TemperatureSensor) IsEnabled() (bool, error)
IsEnabled check if measurements are enabled
func (*TemperatureSensor) IsNotifying ¶
func (s *TemperatureSensor) IsNotifying() (bool, error)
IsNotifying check if notyfing
func (*TemperatureSensor) Read ¶
func (s *TemperatureSensor) Read() (float64, error)
Read value from the sensor
func (*TemperatureSensor) StartNotify ¶
func (s *TemperatureSensor) StartNotify() error
StartNotify enable temperature DataChannel
func (*TemperatureSensor) StopNotify ¶
func (s *TemperatureSensor) StopNotify() error
StopNotify disable temperature DataChannel