rawv1

package
v0.0.0-...-162f771 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataRAWv1

type DataRAWv1 struct {
	// contains filtered or unexported fields
}

DataRAWv1 is a concrete implementation of AdvertisementData interface Data format is described here: https://docs.ruuvi.com/communication/bluetooth-advertisements/data-format-3-rawv1

func NewDataRAWv1

func NewDataRAWv1(d []byte) (*DataRAWv1, error)

NewDataRAWv1 returns pointer to DataRAWv1 wrapping

func (*DataRAWv1) AccelerationX

func (d *DataRAWv1) AccelerationX() (float64, error)

AccelerationX returns the acceleration in X axis with unit G, if supported by data format

func (*DataRAWv1) AccelerationY

func (d *DataRAWv1) AccelerationY() (float64, error)

AccelerationY returns the acceleration in Y axis with unit G, if supported by data format

func (*DataRAWv1) AccelerationZ

func (d *DataRAWv1) AccelerationZ() (float64, error)

AccelerationZ returns the acceleration in Z axis with unit G, if supported by data format

func (*DataRAWv1) BatteryVoltage

func (d *DataRAWv1) BatteryVoltage() (float64, error)

BatteryVoltage returns battery voltage with unit V (volt), if supported by data format

func (*DataRAWv1) Copy

func (d *DataRAWv1) Copy()

Copy copies the raw bytes internally so the AdvertisementData object is safe to use for a longer time. Without Copy(), incoming BLE packets can overwrite the bytes

func (*DataRAWv1) DataFormat

func (d *DataRAWv1) DataFormat() int8

DataFormat returns format of underlying data

func (*DataRAWv1) Humidity

func (d *DataRAWv1) Humidity() (float64, error)

Humidity returns measured humidity as percentage

func (*DataRAWv1) MACAddress

func (d *DataRAWv1) MACAddress() ([]byte, error)

MACAddress returns MAC address (48 bits / 6 bytes) of broadcasting ruuvitag, if supported by data format

func (*DataRAWv1) MarshalJSON

func (d *DataRAWv1) MarshalJSON() ([]byte, error)

MarshalJSON outputs available data as JSON

func (*DataRAWv1) MeasurementSequenceNumber

func (d *DataRAWv1) MeasurementSequenceNumber() (int, error)

MeasurementSequenceNumber returns measurement sequence number, if supported by data format

func (*DataRAWv1) MovementCounter

func (d *DataRAWv1) MovementCounter() (int, error)

MovementCounter returns number of movements detected by accelerometer, if supported by data format

func (*DataRAWv1) Pressure

func (d *DataRAWv1) Pressure() (int, error)

Pressure returns measured atmospheric pressure with unit Pa (pascal)

func (*DataRAWv1) RawData

func (d *DataRAWv1) RawData() []byte

RawData returns the raw bytes. Make sure to copy the data, or it may be overwritten by the next broadcast.

func (*DataRAWv1) Temperature

func (d *DataRAWv1) Temperature() (float64, error)

Temperature returns measured temperature in degrees Celsius

func (*DataRAWv1) TransmissionPower

func (d *DataRAWv1) TransmissionPower() (float64, error)

TransmissionPower returns transmission power with unit dBm, if supported by data format

Jump to

Keyboard shortcuts

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