devices

package
v0.0.0-...-f9b8134 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
const DefaultRetry = 3

DefaultRetry times

View Source
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) Disable

func (s *MpuSensor) Disable() error

Disable mpuSensors measurements

func (*MpuSensor) Enable

func (s *MpuSensor) Enable() error

Enable mpuSensors measurements

func (MpuSensor) GetName

func (s MpuSensor) GetName() string

GetName return's the sensor name

func (*MpuSensor) IsEnabled

func (s *MpuSensor) IsEnabled() (bool, error)

IsEnabled check if mpu measurements are enabled

func (*MpuSensor) IsNotifying

func (s *MpuSensor) IsNotifying() (bool, error)

IsNotifying check if mpu sensors are notifying

func (*MpuSensor) Read

func (s *MpuSensor) Read() (float64, error)

Read value from the mpu sensors

func (*MpuSensor) StartNotify

func (s *MpuSensor) StartNotify(macAddress string) error

StartNotify enable mpuDataChannel

func (*MpuSensor) StopNotify

func (s *MpuSensor) StopNotify() error

StopNotify disable DataChannel for mpu sensors

type Sensor

type Sensor interface {
	GetName() string
	IsEnabled() (bool, error)
	Enable() error
	Disable() error
}

Sensor generic sensor interface

type SensorTag

type SensorTag struct {
	*api.Device
	Temperature TemperatureSensor
	Humidity    HumiditySensor
	Mpu         MpuSensor
	Barometric  BarometricSensor
	Luxometer   LuxometerSensor
	DeviceInfo  SensorTagDeviceInfo
}

SensorTag a SensorTag object representation

func NewSensorTag

func NewSensorTag(d *api.Device) (*SensorTag, error)

NewSensorTag creates a new sensortag instance

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

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) Enable

func (s *TemperatureSensor) Enable() error

Enable 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL