-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add formatting to the MAC Address DeviceInfo
#154 non-breaking
- Loading branch information
Showing
4 changed files
with
29 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/SharpBrick.PoweredUp/Bluetooth/IPoweredUpBluetoothDeviceInfoWithMacAddress.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
using System.Linq; | ||
|
||
namespace SharpBrick.PoweredUp.Bluetooth | ||
{ | ||
public interface IPoweredUpBluetoothDeviceInfoWithMacAddress | ||
{ | ||
byte[] MacAddress { get; } | ||
} | ||
|
||
public static class IPoweredUpBluetoothDeviceInfoWithMacAddressExtensions | ||
{ | ||
public static string ToIdentificationString(this IPoweredUpBluetoothDeviceInfoWithMacAddress self) | ||
=> string.Join(":", self.MacAddress.Select(b => b.ToString("X2")).ToArray()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters