Method FromAccessory
FromAccessory(EAAccessory, String)
Creates a NMEA LocationDataSource based on an iOS External
Declaration
public static NmeaLocationDataSource FromAccessory(EAAccessory accessory, string protocol)
Parameters
Type | Name | Description |
---|---|---|
External |
accessory | The accessory to read NMEA from. |
System. |
protocol | The accessory protocol used to read data. See External |
Returns
Type | Description |
---|---|
Nmea |
A NMEA Location Datasource that reads from the specified accessory |
Remarks
The created datasource will automatically handle opening the specified accessory and reading data from it
when the datasource is started. Once the datasource has been started, the Nmea
To use the device in an iOS app, ensure the device is supported and enabled in Info.plist
. For example this is required to enable support for a Bad Elf GPS receiver:
<key>UISupportedExternalAccessoryProtocols</key>
<array>
<string>com.bad-elf.gps</string>
</array>
To obtain a supported accessory use the External
foreach (var accessory in ExternalAccessory.EAAccessoryManager.SharedAccessoryManager.ConnectedAccessories)
{
if (accessory.Name == "Bad Elf GNSS Surveyor")
{
return NmeaLocationDataSource.FromAccessory(accessory, "com.bad-elf.gps");
}
}
Applies to
Platforms and versions
Target | Versions |
---|---|
.NET iOS | 200.0 - 200.6 |
Xamarin.iOS | 100.10 - 100.15 |