Documentation ¶
Index ¶
- type DataRAWv2
- func (d *DataRAWv2) AccelerationX() (float64, error)
- func (d *DataRAWv2) AccelerationY() (float64, error)
- func (d *DataRAWv2) AccelerationZ() (float64, error)
- func (d *DataRAWv2) BatteryVoltage() (float64, error)
- func (d *DataRAWv2) Copy()
- func (d *DataRAWv2) DataFormat() int8
- func (d *DataRAWv2) Humidity() (float64, error)
- func (d *DataRAWv2) MACAddress() ([]byte, error)
- func (d *DataRAWv2) MarshalJSON() ([]byte, error)
- func (d *DataRAWv2) MeasurementSequenceNumber() (int, error)
- func (d *DataRAWv2) MovementCounter() (int, error)
- func (d *DataRAWv2) Pressure() (int, error)
- func (d *DataRAWv2) RawData() []byte
- func (d *DataRAWv2) Temperature() (float64, error)
- func (d *DataRAWv2) TransmissionPower() (float64, error)
- type InvalidValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataRAWv2 ¶
type DataRAWv2 struct {
// contains filtered or unexported fields
}
DataRAWv2 is a concrete implementation of AdvertisementData interface Data format is described here: https://docs.ruuvi.com/communication/bluetooth-advertisements/data-format-5-rawv2
func NewDataRAWv2 ¶
NewDataRAWv2 returns pointer to DataRAWv2 wrapping
func (*DataRAWv2) AccelerationX ¶
AccelerationX returns the acceleration in X axis with unit G, if supported by data format
func (*DataRAWv2) AccelerationY ¶
AccelerationY returns the acceleration in Y axis with unit G, if supported by data format
func (*DataRAWv2) AccelerationZ ¶
AccelerationZ returns the acceleration in Z axis with unit G, if supported by data format
func (*DataRAWv2) BatteryVoltage ¶
BatteryVoltage returns battery voltage with unit V (volt), if supported by data format
func (*DataRAWv2) Copy ¶
func (d *DataRAWv2) 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 (*DataRAWv2) DataFormat ¶
DataFormat returns format of underlying data
func (*DataRAWv2) MACAddress ¶
MACAddress returns MAC address (48 bits / 6 bytes) of broadcasting ruuvitag, if supported by data format
func (*DataRAWv2) MarshalJSON ¶
MarshalJSON outputs available data as JSON
func (*DataRAWv2) MeasurementSequenceNumber ¶
MeasurementSequenceNumber returns measurement sequence number, if supported by data format
func (*DataRAWv2) MovementCounter ¶
MovementCounter returns number of movements detected by accelerometer, if supported by data format
func (*DataRAWv2) RawData ¶
RawData returns the raw bytes. Make sure to copy the data, or it may be overwritten by the next broadcast.
func (*DataRAWv2) Temperature ¶
Temperature returns measured temperature in degrees Celsius
func (*DataRAWv2) TransmissionPower ¶
TransmissionPower returns transmission power with unit dBm, if supported by data format
type InvalidValue ¶
type InvalidValue struct {
// contains filtered or unexported fields
}
InvalidValue is error returned when raw data contains data specified as invalid, i.e. 0xFFFF for unsigned values or 0x8000 for signed values
func (*InvalidValue) Error ¶
func (iv *InvalidValue) Error() string
func (*InvalidValue) Is ¶
func (iv *InvalidValue) Is(target error) bool
Is makes it possible to use errors.Is() on this error type