-
-
Notifications
You must be signed in to change notification settings - Fork 212
Bluetooth Low Energy
Low Energy uses the Generic Attribute Profile to support a hierarchy of Read/Write/Notify operations on a set of Characteristics rather than using a constantly open stream like classic Rfcomm connections.
Bluetooth Low Energy is supported on Windows 8.1 and later, iOS, macOS, tvOS, Android, Tizen and other platforms. Capabilities vary depending on OS and version. 32feet has a pre-release library for Bluetooth LE - InTheHand.BluetoothLE.
Add
<uses-permission android:name="android.permission.BLUETOOTH" />
to your AndroidManifest. If you want to allow discovery in the app use
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
too. You'll need to request location permission from the user via:-
RequestPermissions(new string[] { Manifest.Permission.AccessCoarseLocation, Manifest.Permission.BluetoothAdmin }, 1);
If your app requires Fine Location too, just request one of these permissions, Bluetooth will work with either but Coarse Location is the minimum required.
You must add a display prompt for "NSBluetoothPeripheralUsageDescription" to your info.plist. On the latest iOS versions also use "NSBluetoothAlwaysUsageDescription" to use Bluetooth LE for foreground or background use.
The current version of Windows 10 is the Creators Update and this supports Bluetooth LE with support for acting as a GATT Server, and discovering and interacting with unpaired devices. You must declare the "bluetooth" capability to use any Bluetooth LE functionality in your application.
32feet.NET - Personal Area Networking for .NET
In The Hand Ltd