-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Improve events provided by cross-platform interop code to surface more events to the custom app implementation. Based on these improvements, the UWP example app now again correctly displays status and error messages. * Adds BeaconAdded event to the BeaconManager class * Updated sample code to also include handling Proximity Beacon frames (iBeacon compatible) * UWP Sample app handles additional Bluetooth error status codes
- Loading branch information
Showing
20 changed files
with
379 additions
and
78 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
35 changes: 35 additions & 0 deletions
35
Library/UniversalBeacon.Library.Core/Interop/BLEAdvertisementWatcherStatusCodes.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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace UniversalBeacon.Library.Core.Interop | ||
{ | ||
/// <summary> | ||
/// Possible status codes of the Bluetooth LE Advertisment Watcher. | ||
/// Binary compatible to the UWP implementation. | ||
/// </summary> | ||
public enum BLEAdvertisementWatcherStatusCodes | ||
{ | ||
// | ||
// Summary: | ||
// The initial status of the watcher. | ||
Created = 0, | ||
// | ||
// Summary: | ||
// The watcher is started. | ||
Started = 1, | ||
// | ||
// Summary: | ||
// The watcher stop command was issued. | ||
Stopping = 2, | ||
// | ||
// Summary: | ||
// The watcher is stopped. | ||
Stopped = 3, | ||
// | ||
// Summary: | ||
// An error occurred during transition or scanning that stopped the watcher due | ||
// to an error. | ||
Aborted = 4 | ||
} | ||
} |
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,61 @@ | ||
namespace UniversalBeacon.Library.Core.Interop | ||
{ | ||
public class BTError | ||
{ | ||
/// <summary> | ||
/// Possible error codes for Bluetooth handling. | ||
/// Binary compatible to the UWP implementation. | ||
/// </summary> | ||
public enum BluetoothError | ||
{ | ||
// | ||
// Summary: | ||
// The operation was successfully completed or serviced. | ||
Success = 0, | ||
// | ||
// Summary: | ||
// The Bluetooth radio was not available. This error occurs when the Bluetooth radio | ||
// has been turned off. | ||
RadioNotAvailable = 1, | ||
// | ||
// Summary: | ||
// The operation cannot be serviced because the necessary resources are currently | ||
// in use. | ||
ResourceInUse = 2, | ||
// | ||
// Summary: | ||
// The operation cannot be completed because the remote device is not connected. | ||
DeviceNotConnected = 3, | ||
// | ||
// Summary: | ||
// An unexpected error has occurred. | ||
OtherError = 4, | ||
// | ||
// Summary: | ||
// The operation is disabled by policy. | ||
DisabledByPolicy = 5, | ||
// | ||
// Summary: | ||
// The operation is not supported on the current Bluetooth radio hardware. | ||
NotSupported = 6, | ||
// | ||
// Summary: | ||
// The operation is disabled by the user. | ||
DisabledByUser = 7, | ||
// | ||
// Summary: | ||
// The operation requires consent. | ||
ConsentRequired = 8, | ||
// | ||
TransportNotSupported = 9 | ||
} | ||
|
||
|
||
public BluetoothError BluetoothErrorCode { get; set; } | ||
|
||
public BTError(BluetoothError btErrorCode) | ||
{ | ||
BluetoothErrorCode = btErrorCode; | ||
} | ||
} | ||
} |
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
Oops, something went wrong.