Table of Contents

Class Bmx280Base

Namespace
Iot.Device.Bmxx80
Assembly
Iot.Device.Bmxx80.dll

Represents the core functionality of the Bmx280 family.

[Interface("Represents the core functionality of the Bmx280 family.")]
public abstract class Bmx280Base : Bmxx80Base
Inheritance
Bmx280Base
Derived
Inherited Members

Constructors

Bmx280Base(byte, I2cDevice)

Initializes a new instance of the Bmx280Base class.

protected Bmx280Base(byte deviceId, I2cDevice i2cDevice)

Parameters

deviceId byte

The ID of the device.

i2cDevice I2cDevice

The I2cDevice to create with.

Fields

DefaultI2cAddress

Default I2C bus address.

public const byte DefaultI2cAddress = 119

Field Value

byte

OsToMeasCycles

Converts oversampling to needed measurement cycles for that oversampling.

protected static readonly int[] OsToMeasCycles

Field Value

int[]

SecondaryI2cAddress

Secondary I2C bus address.

public const byte SecondaryI2cAddress = 118

Field Value

byte

Properties

FilterMode

Gets or sets the IIR filter mode.

[Property]
public Bmx280FilteringMode FilterMode { get; set; }

Property Value

Bmx280FilteringMode

Exceptions

ArgumentOutOfRangeException

Thrown when the Bmx280FilteringMode is set to an undefined mode.

StandbyTime

Gets or sets the standby time between two consecutive measurements.

[Property]
public StandbyTime StandbyTime { get; set; }

Property Value

StandbyTime

Exceptions

ArgumentOutOfRangeException

Thrown when the StandbyTime is set to an undefined mode.

Methods

GetMeasurementDuration()

Gets the required time in ms to perform a measurement with the current sampling modes.

[Property("MeasurementDuration")]
public virtual int GetMeasurementDuration()

Returns

int

The time it takes for the chip to read data in milliseconds rounded up.

ReadPowerMode()

Read the Bmx280PowerMode state.

[Property("PowerMode")]
public Bmx280PowerMode ReadPowerMode()

Returns

Bmx280PowerMode

The current Bmx280PowerMode.

Exceptions

NotImplementedException

Thrown when the power mode does not match a defined mode in Bmx280PowerMode.

ReadStatus()

Get the current status of the device.

[Telemetry("Status")]
public DeviceStatus ReadStatus()

Returns

DeviceStatus

The DeviceStatus.

SetDefaultConfiguration()

Sets the default configuration for the sensor.

[Command]
protected override void SetDefaultConfiguration()

SetPowerMode(Bmx280PowerMode)

Sets the power mode to the given mode.

[Property("PowerMode")]
public void SetPowerMode(Bmx280PowerMode powerMode)

Parameters

powerMode Bmx280PowerMode

The Bmx280PowerMode to set.

TryReadAltitude(out Length)

Calculates the altitude in meters from the mean sea-level pressure.

public bool TryReadAltitude(out Length altitude)

Parameters

altitude Length

Contains the calculated metres above sea-level if the PressureSampling was not set to Skipped. Contains NaN otherwise.

Returns

bool
true
if pressure measurement was not skipped, otherwise
false
.

TryReadAltitude(Pressure, out Length)

Calculates the altitude in meters from the specified sea-level pressure(in hPa).

public bool TryReadAltitude(Pressure seaLevelPressure, out Length altitude)

Parameters

seaLevelPressure Pressure

Sea-level pressure.

altitude Length

Contains the calculated metres above sea-level if the PressureSampling was not set to Skipped. Contains NaN otherwise.

Returns

bool
true
if pressure measurement was not skipped, otherwise
false
.

TryReadPressure(out Pressure)

Reads the pressure. A return value indicates whether the reading succeeded.

[Telemetry("Pressure")]
public override bool TryReadPressure(out Pressure pressure)

Parameters

pressure Pressure

Contains the measured pressure in Pa if the PressureSampling was not set to Skipped. Contains NaN otherwise.

Returns

bool
true
if measurement was not skipped, otherwise
false
.

TryReadPressureCore(out Pressure, bool)

Performs a pressure reading.

protected bool TryReadPressureCore(out Pressure pressure, bool skipTempFineRead = false)

Parameters

pressure Pressure

Current preasure reeading.

skipTempFineRead bool

Don't know. Change it.

Returns

bool

True if the reading was sucesfully performed.

TryReadTemperature(out Temperature)

Reads the temperature. A return value indicates whether the reading succeeded.

[Telemetry("Temperature")]
public override bool TryReadTemperature(out Temperature temperature)

Parameters

temperature Temperature

Contains the measured temperature if the TemperatureSampling was not set to Skipped. Contains NaN otherwise.

Returns

bool
true
if measurement was not skipped, otherwise
false
.

TryReadTemperatureCore(out Temperature)

Performs a temperature reading.

protected bool TryReadTemperatureCore(out Temperature temperature)

Parameters

temperature Temperature

Current temperature reading.

Returns

bool

True if reading was sucesfully performed.