-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix "Same MAC, same name - only difference is LE #1":
Add "--type" command line option to specify which (LE or nonLE) device to use.
- Loading branch information
1 parent
7258e93
commit f17776a
Showing
7 changed files
with
65 additions
and
80 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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
namespace BluetoothDevicePairing.Command.Utils | ||
{ | ||
enum DeviceType | ||
{ | ||
Bluetooth, | ||
BluetoothLE, | ||
Any | ||
} | ||
|
||
static class DeviceTypeExtensions | ||
{ | ||
public static bool Equals(DeviceType type1, Bluetooth.DeviceType type2) | ||
{ | ||
if (type1 == DeviceType.Any) | ||
{ | ||
return true; | ||
} | ||
|
||
if ( type1 == DeviceType.Bluetooth && type2 == Bluetooth.DeviceType.Bluetooth | ||
|| type1 == DeviceType.BluetoothLE && type2 == Bluetooth.DeviceType.BluetoothLe) | ||
{ | ||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
} | ||
} |