elsys

package
v0.0.0-...-9ff0318 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TYPE_TEMP          = 0x01 //temp 2 bytes -3276.8°C -->3276.7°C
	TYPE_RH            = 0x02 //Humidity 1 byte  0-100%
	TYPE_ACC           = 0x03 //acceleration 3 bytes X,Y,Z -128 --> 127 +/-63=1G
	TYPE_LIGHT         = 0x04 //Light 2 bytes 0-->65535 Lux
	TYPE_MOTION        = 0x05 //No of motion 1 byte  0-255
	TYPE_CO2           = 0x06 //Co2 2 bytes 0-65535 ppm
	TYPE_VDD           = 0x07 //VDD 2byte 0-65535mV
	TYPE_ANALOG1       = 0x08 //VDD 2byte 0-65535mV
	TYPE_GPS           = 0x09 //3bytes lat 3bytes long binary
	TYPE_PULSE1        = 0x0A //2bytes relative pulse count
	TYPE_PULSE1_ABS    = 0x0B //4bytes no 0->0xFFFFFFFF
	TYPE_EXT_TEMP1     = 0x0C //2bytes -3276.5C-->3276.5C
	TYPE_EXT_DIGITAL   = 0x0D //1bytes value 1 or 0
	TYPE_EXT_DISTANCE  = 0x0E //2bytes distance in mm
	TYPE_ACC_MOTION    = 0x0F //1byte number of vibration/motion
	TYPE_IR_TEMP       = 0x10 //2bytes internal temp 2bytes external temp -3276.5C-->3276.5C
	TYPE_OCCUPANCY     = 0x11 //1byte data
	TYPE_WATERLEAK     = 0x12 //1byte data 0-255
	TYPE_GRIDEYE       = 0x13 //65byte temperature data 1byte ref+64byte external temp
	TYPE_PRESSURE      = 0x14 //4byte pressure data (hPa)
	TYPE_SOUND         = 0x15 //2byte sound data (peak/avg)
	TYPE_PULSE2        = 0x16 //2bytes 0-->0xFFFF
	TYPE_PULSE2_ABS    = 0x17 //4bytes no 0->0xFFFFFFFF
	TYPE_ANALOG2       = 0x18 //2bytes voltage in mV
	TYPE_EXT_TEMP2     = 0x19 //2bytes -3276.5C-->3276.5C
	TYPE_EXT_DIGITAL2  = 0x1A // 1bytes value 1 or 0
	TYPE_EXT_ANALOG_UV = 0x1B // 4 bytes signed int (uV)
	TYPE_TVOC          = 0x1C // 2 bytes (ppb)
	TYPE_DEBUG         = 0x3D // 4bytes debug
)

Variables

This section is empty.

Functions

func Decoder

func Decoder(ctx context.Context, deviceID string, e application.SensorEvent) ([]lwm2m.Lwm2mObject, error)

Types

type ElsysPayload

type ElsysPayload struct {
	Temperature         *float32 `json:"temperature,omitempty"`
	ExternalTemperature *float32 `json:"externalTemperature,omitempty"`
	Humidity            *int8    `json:"humidity,omitempty"`

	//Acceleration
	X *int8 `json:"x,omitempty"`
	Y *int8 `json:"y,omitempty"`
	Z *int8 `json:"z,omitempty"`

	Light   *uint16 `json:"light,omitempty"`
	Motion  *uint8  `json:"motion,omitempty"`
	CO2     *uint16 `json:"co2,omitempty"`
	VDD     *uint16 `json:"vdd,omitempty"`
	Analog1 *uint16 `json:"analog1,omitempty"`

	//GPS
	Lat *float32 `json:"lat,omitempty"`
	Lon *float32 `json:"long,omitempty"`

	Pulse         *uint16  `json:"pulse1,omitempty"`
	PulseAbs      *uint32  `json:"pulseAbs,omitempty"`
	Pressure      *float32 `json:"pressure,omitempty"`
	Occupancy     *uint8   `json:"occupancy,omitempty"`
	DigitalInput  *bool    `json:"digital,omitempty"`
	DigitalInput2 *bool    `json:"digital2,omitempty"`
	Waterleak     *uint8   `json:"waterleak,omitempty"`
}

Jump to

Keyboard shortcuts

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