Show / Hide Table of Contents

Class BluetoothDevice

A Bluetooth NMEA device

Inheritance
object
NmeaDevice
BluetoothDevice
Implements
IDisposable
Inherited Members
NmeaDevice.OpenAsync()
NmeaDevice.ReadAsync(byte[], int, int, CancellationToken)
NmeaDevice.CloseAsync()
NmeaDevice.MessageReceived
NmeaDevice.DeviceDisconnected
NmeaDevice.Dispose()
NmeaDevice.Dispose(bool)
NmeaDevice.IsOpen
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
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

TargetVersions
.NET Windowsmain
.NET Androidmain, v3.0
UWPmain, v3.0, v2.2, v2.1, v2.0
Xamarin.Androidv2.2, v2.1, v2.0
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX