Skip to content

Commit

Permalink
bindings: csharp: Add iio.Device.hwmon property
Browse files Browse the repository at this point in the history
This readonly property will be True if the device is a hardware
monitoring device, False if it is a IIO device.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
  • Loading branch information
pcercuei committed Jan 11, 2022
1 parent a0f54fd commit 113e029
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bindings/csharp/Device.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ public override void write(string str)
/// <summary>The label of this device.</summary>
public string label { get; private set; }

/// <summary>True if the device is a hardware monitoring device, False if it is a IIO device.</summary>
public bool hwmon { get; private set; }

/// <summary>A <c>list</c> of all the attributes that this device has.</summary>
public readonly List<Attr> attrs;

Expand Down Expand Up @@ -271,6 +274,7 @@ internal Device(Context ctx, IntPtr dev)
IntPtr label_ptr = iio_device_get_label(dev);

label = label_ptr == IntPtr.Zero ? "" : Marshal.PtrToStringAnsi(label_ptr);
hwmon = id[0] == 'h';
}

/// <summary>Get the <see cref="iio.Channel"/> object of the specified name.</summary>
Expand Down

0 comments on commit 113e029

Please sign in to comment.