Skip to content

Commit

Permalink
Merge pull request #612 from WildernessLabs/AddBluetoothMacAddress
Browse files Browse the repository at this point in the history
Add support for Bluetooth MAC address.
  • Loading branch information
adrianstevens authored Jan 7, 2025
2 parents 3fe6a6c + 9c10919 commit 5f9dde0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Source/v2/Meadow.HCom/DeviceInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public string? this[string propname]
public string? SerialNumber => this["SerialNo"];
public string? MacAddress => this["WiFiMAC"];
public string? SoftAPMacAddress => this["SoftAPMac"];
public string?BluetoothMacAddress => this["BtMac"];

/// <summary>
/// String representation of an unknown MAC address.
Expand Down Expand Up @@ -72,6 +73,11 @@ public override string ToString()
macCount++;
macAddresses += $"\tAP: {SoftAPMacAddress}{Environment.NewLine}";
}
if (!string.IsNullOrEmpty(BluetoothMacAddress) && BluetoothMacAddress != UNKNOWN_MAC_ADDRESS)
{
macCount++;
macAddresses += $"\tBluetooth: {BluetoothMacAddress}{Environment.NewLine}";
}
if (macCount > 0)
{
if (macCount > 1)
Expand All @@ -82,7 +88,7 @@ public override string ToString()
{
deviceInfo.AppendLine(" MAC Address - ");
}
deviceInfo.AppendLine($"{macAddresses}");
deviceInfo.Append($"{macAddresses}");
}

deviceInfo.AppendLine();
Expand Down

0 comments on commit 5f9dde0

Please sign in to comment.