Documentation ¶
Index ¶
- type DataRAWv1
- func (d *DataRAWv1) AccelerationX() (float64, error)
- func (d *DataRAWv1) AccelerationY() (float64, error)
- func (d *DataRAWv1) AccelerationZ() (float64, error)
- func (d *DataRAWv1) BatteryVoltage() (float64, error)
- func (d *DataRAWv1) Copy()
- func (d *DataRAWv1) DataFormat() int8
- func (d *DataRAWv1) Humidity() (float64, error)
- func (d *DataRAWv1) MACAddress() ([]byte, error)
- func (d *DataRAWv1) MarshalJSON() ([]byte, error)
- func (d *DataRAWv1) MeasurementSequenceNumber() (int, error)
- func (d *DataRAWv1) MovementCounter() (int, error)
- func (d *DataRAWv1) Pressure() (int, error)
- func (d *DataRAWv1) RawData() []byte
- func (d *DataRAWv1) Temperature() (float64, error)
- func (d *DataRAWv1) TransmissionPower() (float64, error)
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 ¶
NewDataRAWv1 returns pointer to DataRAWv1 wrapping
func (*DataRAWv1) AccelerationX ¶
AccelerationX returns the acceleration in X axis with unit G, if supported by data format
func (*DataRAWv1) AccelerationY ¶
AccelerationY returns the acceleration in Y axis with unit G, if supported by data format
func (*DataRAWv1) AccelerationZ ¶
AccelerationZ returns the acceleration in Z axis with unit G, if supported by data format
func (*DataRAWv1) BatteryVoltage ¶
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 ¶
DataFormat returns format of underlying data
func (*DataRAWv1) MACAddress ¶
MACAddress returns MAC address (48 bits / 6 bytes) of broadcasting ruuvitag, if supported by data format
func (*DataRAWv1) MarshalJSON ¶
MarshalJSON outputs available data as JSON
func (*DataRAWv1) MeasurementSequenceNumber ¶
MeasurementSequenceNumber returns measurement sequence number, if supported by data format
func (*DataRAWv1) MovementCounter ¶
MovementCounter returns number of movements detected by accelerometer, if supported by data format
func (*DataRAWv1) RawData ¶
RawData returns the raw bytes. Make sure to copy the data, or it may be overwritten by the next broadcast.
func (*DataRAWv1) Temperature ¶
Temperature returns measured temperature in degrees Celsius
func (*DataRAWv1) TransmissionPower ¶
TransmissionPower returns transmission power with unit dBm, if supported by data format