Class BluetoothDevice
A Bluetooth NMEA device
Implements
Inherited Members
Namespace: NmeaParser
Assembly: NmeaParser.dll
Syntax
public class BluetoothDevice : NmeaDevice, IDisposable
Remarks
To use this device, ensure you have the necessary permissions in the AndroidManifest.xml file:
```xml
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.BLUETOOTH" />
```
Next see MainActivity.cs in the Android sample as a reference: https://github.com/dotMorten/NmeaParser/blob/main/src/SampleApp.Droid/MainActivity.cs
Constructors
| Name | Description |
|---|---|
| BluetoothDevice(BluetoothDevice) | Initializes a new instance of the BluetoothDevice class. |
| BluetoothDevice(BluetoothDevice, Context) | Initializes a new instance of the BluetoothDevice class. |
Properties
| Name | Description |
|---|---|
| CanWrite | Gets a value indicating whether this device supports writing |
Methods
| Name | Description |
|---|---|
| CloseStreamAsync(Stream) | Closes the stream the NmeaDevice is working on top off. |
| GetBluetoothSerialDevices() | Gets a list of bluetooth devices that supports serial communication |
| GetBluetoothSerialDevices(Context) | Gets a list of bluetooth devices that supports serial communication |
| OpenStreamAsync() | Creates and opens the stream the NmeaDevice is working on top off. |
| WriteAsync(byte[], int, int) | Writes to the device stream. Useful for transmitting RTCM corrections to the device Check the CanWrite property before calling this method. |
Applies
| Target | Versions |
|---|---|
| .NET Windows | main |
| .NET Android | main, v3.0 |
| UWP | main, v3.0, v2.2, v2.1, v2.0 |
| Xamarin.Android | v2.2, v2.1, v2.0 |