Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Bluetooth MAC address. #612

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading