Class EAAccessoryDevice
Creates an object to read from an iOS accessory like a Bluetooth device.
Implements
Inherited Members
Namespace: NmeaParser
Assembly: NmeaParser.dll
Syntax
public class EAAccessoryDevice : NmeaDevice, IDisposable
Remarks
It's worth nothing that iOS is very limited to what devices it can connect to, and generally needs to be MFI certified devices.
To connect to a device in an iOS app, the device must be supported by iOS and enabled in Info.plist.
As an example you can declare a Bad Elf GPS receiver like this in the plist:
<key>UISupportedExternalAccessoryProtocols</key>
<array>
<string>com.bad-elf.gps</string>
</array>
If using a bad-elf GPS, make sure you send the configuration to enable sending NMEA data. Example:
var device = new EAAccessoryDevice(accessory, "com.bad-elf.gps");
await device.OpenAsync();
// BadElf start packet.
// See https://github.com/BadElf/gps-sdk/blob/master/README.md#extended-nmea-sentences-with-gsa-and-gsv-satellite-data-and-dop-values
byte[] startPacket = new byte[] { 0x24, 0xbe, 0x00, 0x11, 0x16, 0x01, 0x02, 0xf4, 0x31, 0x0a, 0x32, 0x04, 0x33, 0x02, 0x5a, 0x0d, 0x0a };
await device.WriteAsync(startPacket, 0, startPacket.Length);
Constructors
| Name | Description |
|---|---|
| EAAccessoryDevice(EAAccessory, string) | Initializes a new instance of the EAAccessoryDevice class. |
Methods
| Name | Description |
|---|---|
| CloseStreamAsync(Stream) | Closes the stream the NmeaDevice is working on top off. |
| GetDevices() | Gets a list of supported known EAAccessories that support NMEA |
| OpenStreamAsync() | Creates and opens the stream the NmeaDevice is working on top off. |
Applies
| Target | Versions |
|---|---|
| .NET iOS | main, v3.0 |
| Xamarin.iOS | v2.2 |