Skip to content

Commit

Permalink
fix: rename barometer to air pressure
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Mar 26, 2022
1 parent 3fb638c commit 1af8550
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ namespace Jacdac.Clients
{
/// <summary>
/// A sensor measuring air pressure of outside environment.
/// Implements a client for the Barometer service.
/// Implements a client for the Air Pressure service.
/// </summary>
/// <seealso cref="https://microsoft.github.io/jacdac-docs/services/barometer/" />
public partial class BarometerClient : SensorClient
/// <seealso cref="https://microsoft.github.io/jacdac-docs/services/airpressure/" />
public partial class AirPressureClient : SensorClient
{
public BarometerClient(JDBus bus, string name)
: base(bus, name, ServiceClasses.Barometer)
public AirPressureClient(JDBus bus, string name)
: base(bus, name, ServiceClasses.AirPressure)
{
}

Expand All @@ -24,7 +24,7 @@ public float Pressure
{
get
{
return (float)this.GetRegisterValue((ushort)BarometerReg.Pressure, BarometerRegPack.Pressure);
return (float)this.GetRegisterValue((ushort)AirPressureReg.Pressure, AirPressureRegPack.Pressure);
}
}

Expand All @@ -35,7 +35,7 @@ public float Pressure
bool TryGetPressureError(out float value)
{
object[] values;
if (this.TryGetRegisterValues((ushort)BarometerReg.PressureError, BarometerRegPack.PressureError, out values))
if (this.TryGetRegisterValues((ushort)AirPressureReg.PressureError, AirPressureRegPack.PressureError, out values))
{
value = (float)values[0];
return true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace Jacdac {
public static partial class ServiceClasses
{
public const uint Barometer = 0x1e117cea;
public const uint AirPressure = 0x1e117cea;
}
public enum BarometerReg : ushort {
public enum AirPressureReg : ushort {
/// <summary>
/// Read-only hPa u22.10 (uint32_t). The air pressure.
///
Expand All @@ -23,7 +23,7 @@ public enum BarometerReg : ushort {
PressureError = 0x106,
}

public static class BarometerRegPack {
public static class AirPressureRegPack {
/// <summary>
/// Pack format for 'pressure' register data.
/// </summary>
Expand Down

0 comments on commit 1af8550

Please sign in to comment.