ArcGIS Runtime SDK for iOS
100.15
|
An NMEA location data source object.
An instance of this class will parse specific NMEA messages pushed into it. Valid GGA, GSA, GST, GSV, RMC, VTG messages are parsed and, depending upon the message type and contents, an locationDataSource:locationDidChange: (AGSLocationChangeHandlerDelegate-p)
or NMEALocationDataSource:satellitesDidChange: (AGSNMEALocationDataSourceDelegate-p)
may be raised. The locationDataSource:locationDidChange: (AGSLocationChangeHandlerDelegate-p)
will return an AGSNMEALocation
. The NMEALocationDataSource:satellitesDidChange: (AGSNMEALocationDataSourceDelegate-p)
will return an array of AGSNMEASatelliteInfo
. This data source is based on NMEA version 4.11 (November 2018).
This object can parse NMEA messages pushed into it creating an AGSNMEALocation
object that is obtained via the locationDataSource:locationDidChange: (AGSLocationChangeHandlerDelegate-p)
The Apple AppStore has guidelines and restrictions for apps that communicate with MFi accessories (for example: an external GPS receiver). Apps that use NMEA data need to satisfy the Apple requirements to be accepted in the store. Apps need to declare support via PPID in their submission and the MFi provider needs to list the bundle ID so Apple can cross reference it. For more information, see the site MFi Program.
Instance Methods | |
(void) | - didStartOrFailWithError: |
(void) | - didStop |
(void) | - didUpdateHeading: |
(void) | - didUpdateLocation: |
(void) | - doStart |
(void) | - doStop |
(instancetype) | - init |
(nullable instancetype) | - initWithEAAccessory:protocol: |
(instancetype) | - initWithReceiverSpatialReference: |
(instancetype) | - initWithReceiverSpatialReference:outputSpatialReference: |
(instancetype) | - initWithReceiverSpatialReference:outputSpatialReference:outputDatumTransformation: |
(void) | - pushData: |
(void) | - startWithCompletion: |
(void) | - stop |
(void) | - stopWithCompletion: |
Class Methods | |
(instancetype) | + NMEALocationDataSource |
(nullable instancetype) | + NMEALocationDataSourceWithEAAccessory:protocol: |
(instancetype) | + NMEALocationDataSourceWithReceiverSpatialReference: |
(instancetype) | + NMEALocationDataSourceWithReceiverSpatialReference:outputSpatialReference: |
(instancetype) | + NMEALocationDataSourceWithReceiverSpatialReference:outputSpatialReference:outputDatumTransformation: |
- (void) didStartOrFailWithError: | (nullable NSError *) | error |
Subclasses must call this in doStart (AGSLocationDataSource(ForSubclassEyesOnly))
once the datasource has started.
Provided by category AGSLocationDataSource(ForSubclassEyesOnly).
- (void) didStop |
Subclasses must call this in doStop (AGSLocationDataSource(ForSubclassEyesOnly))
once the datasource has stopped.
Provided by category AGSLocationDataSource(ForSubclassEyesOnly).
- (void) didUpdateHeading: | (double) | heading |
Subclasses must call this once they have a new heading.
Provided by category AGSLocationDataSource(ForSubclassEyesOnly).
- (void) didUpdateLocation: | (AGSLocation *) | location |
Subclasses must call this once they have a new location.
Provided by category AGSLocationDataSource(ForSubclassEyesOnly).
- (void) doStart |
Subclasses must implement this method to start the datasource. Once the datasource has started or failed to start it should call didStartOrFailWithError: (AGSLocationDataSource(ForSubclassEyesOnly))
. As updates are received, the datasource should call didUpdateLocation: (AGSLocationDataSource(ForSubclassEyesOnly))
or didUpdateHeading: (AGSLocationDataSource(ForSubclassEyesOnly))
.
Provided by category AGSLocationDataSource(ForSubclassEyesOnly).
- (void) doStop |
Subclasses must implement this method to stop the datasource. Once the datasource has stopped it should call didStop (AGSLocationDataSource(ForSubclassEyesOnly))
Provided by category AGSLocationDataSource(ForSubclassEyesOnly).
- (instancetype) init |
Creates an NMEA data source object.
Locations created from an NMEA data source object instantiated with this initializer will have an AGSSpatialReference
of WGS84.
- (nullable instancetype) initWithEAAccessory: | (EAAccessory *) | accessory | |
protocol: | (NSString *) | protocolString | |
Creates an NMEA data source object with the provided EAAccessory
and the protocolString
and reads input data from the connected NMEA hardware.
Use this initializer when you have a bluetooth connected NMEA hardware connected to your iOS device. When the data source is started, incoming data is automatically read, so you don't have to call pushData:
.
Note that you are still responsible for NMEA hardware device discoverabilty. Once connected via bluetooth, the connected accessories can be obtained by using the connectedAccessories
property on the shared EAAccessoryManager
.
Locations created from an NMEA data source object instantiated with this initializer will have an AGSSpatialReference
of WGS84.
accessory | The EAAccessory object NMEA hardware device that the iOS device is connected via bluetooth. |
protocolString | The protocol string for the NMEA device connected. Protocol string names are formatted as reverse-DNS strings. For example, the string “com.apple.myProtocol” might represent a custom protocol defined by Apple. Manufacturers can define custom protocols for their accessories or work with other manufacturers and organizations to define standard protocols for different accessory types. The protocol strings of an accessory can be discovered using protocolStrings property on the EAAccessory object. You are required to provide this protocol string in Information Property List Key UISupportedExternalAccessoryProtocols . For more information, see here |
- (instancetype) initWithReceiverSpatialReference: | (AGSSpatialReference *) | receiverSpatialReference |
Creates an NMEA data source object.
Locations created from an NMEA data source object instantiated with this constructor will have an AGSSpatialReference
defined by the receiverSpatialReference
parameter. This initializer can be used when a receiver is outputting locations in an AGSSpatialReference
object other than WGS84, such as when using a reference base station.
receiverSpatialReference | The AGSSpatialReference object of incoming NMEA receiver data. |
- (instancetype) initWithReceiverSpatialReference: | (AGSSpatialReference *) | receiverSpatialReference | |
outputSpatialReference: | (nullable AGSSpatialReference *) | outputSpatialReference | |
Creates an NMEA data source object.
Locations created from an NMEA data source object instantiated with this initializer will be projected from the AGSSpatialReference
defined by the receiverSpatialReference
parameter to the AGSSpatialReference
defined by the outputSpatialReference
parameter. If the outputSpatialReference
parameter is nil
, the locations will not be projected and the locations will be in the receiverSpatialReference
. This initializer can be used when a receiver is outputting locations in an AGSSpatialReference
other than WGS84, such as when using a reference base station, and/or the application requires the output locations to be projected to a different AGSSpatialReference
.
receiverSpatialReference | The AGSSpatialReference object of incoming NMEA receiver data. |
outputSpatialReference | The AGSSpatialReference object to project the AGSNMEALocation object to. |
- (instancetype) initWithReceiverSpatialReference: | (AGSSpatialReference *) | receiverSpatialReference | |
outputSpatialReference: | (nullable AGSSpatialReference *) | outputSpatialReference | |
outputDatumTransformation: | (nullable AGSDatumTransformation *) | outputDatumTransformation | |
Creates an NMEA data source object.
Locations created from an NMEA data source object instantiated with this initializer will be projected from the AGSSpatialReference
object defined by the receiverSpatialReference
parameter to the AGSSpatialReference
object defined by the outputSpatialReference
parameter using the outputDatumTransformation
. If the outputSpatialReference
parameter is nil
, the locations will not be projected and the locations will be in the receiverSpatialReference
, if the outputDatumTransformation
parameter is set it will be ignored. This initializer can be used when a receiver is outputting locations in an AGSSpatialReference
other than WGS84, such as when using a reference base station, and/or the application requires the output locations to be projected to a different AGSSpatialReference
using an AGSDatumTransformation
.
receiverSpatialReference | The AGSSpatialReference object of incoming NMEA receiver data. |
outputSpatialReference | The AGSSpatialReference object to project the AGSNMEALocation object to. |
outputDatumTransformation | The AGSDatumTransformation object to use to project the AGSNMEALocation object. |
+ (instancetype) NMEALocationDataSource |
Creates an NMEA data source object.
Locations created from an NMEA data source object instantiated with this constructor will have an AGSSpatialReference
of WGS84.
+ (nullable instancetype) NMEALocationDataSourceWithEAAccessory: | (EAAccessory *) | accessory | |
protocol: | (NSString *) | protocolString | |
Creates an NMEA data source object with the provided EAAccessory
object and the protocolString
parameter and reads input data from the connected NMEA hardware.
Use this initializer when you have a bluetooth connected NMEA hardware connected to your iOS device. When the data source is started, incoming data is automatically read, so you don't have to call pushData:
.
Note that you are still responsible for NMEA hardware device discoverabilty. Once connected via bluetooth, the connected accessories can be obtained by using the connectedAccessories
property on the shared EAAccessoryManager
object.
Locations created from an NMEA data source object instantiated with this initializer will have an AGSSpatialReference
of WGS84.
accessory | The EAAccessory object NMEA hardware device that the iOS device is connected via bluetooth. |
protocolString | The protocol string for the NMEA device connected. Protocol string names are formatted as reverse-DNS strings. For example, the string “com.apple.myProtocol” might represent a custom protocol defined by Apple. Manufacturers can define custom protocols for their accessories or work with other manufacturers and organizations to define standard protocols for different accessory types. The protocol strings of an accessory can be discovered using protocolStrings property on the EAAccessory object. You are required to provide this protocol string in Information Property List Key UISupportedExternalAccessoryProtocols . For more information, see here |
+ (instancetype) NMEALocationDataSourceWithReceiverSpatialReference: | (AGSSpatialReference *) | receiverSpatialReference |
Creates an NMEA data source object.
Locations created from an NMEA data source object instantiated with this constructor will have an AGSSpatialReference
defined by the receiverSpatialReference
parameter. This initializer can be used when a receiver is outputting locations in an AGSSpatialReference
other than WGS84, such as when using a reference base station.
receiverSpatialReference | The AGSSpatialReference object of incoming NMEA receiver data. |
+ (instancetype) NMEALocationDataSourceWithReceiverSpatialReference: | (AGSSpatialReference *) | receiverSpatialReference | |
outputSpatialReference: | (nullable AGSSpatialReference *) | outputSpatialReference | |
Creates an NMEA data source object.
Locations created from an NMEA data source object instantiated with this initializer will be projected from the AGSSpatialReference
defined by the receiverSpatialReference
parameter to the AGSSpatialReference
defined by the outputSpatialReference
parameter. If the outputSpatialReference
parameter is nil
, the locations will not be projected and the locations will be in the receiverSpatialReference
. This initializer can be used when a receiver is outputting locations in an AGSSpatialReference
object other than WGS84, such as when using a reference base station, and/or the application requires the output locations to be projected to a different AGSSpatialReference
object.
receiverSpatialReference | The AGSSpatialReference object of incoming NMEA receiver data. |
outputSpatialReference | The AGSSpatialReference object to project the AGSNMEALocation object to. |
+ (instancetype) NMEALocationDataSourceWithReceiverSpatialReference: | (AGSSpatialReference *) | receiverSpatialReference | |
outputSpatialReference: | (nullable AGSSpatialReference *) | outputSpatialReference | |
outputDatumTransformation: | (nullable AGSDatumTransformation *) | outputDatumTransformation | |
Creates an NMEA data source object.
Locations created from an NMEA data source object instantiated with this initializer will be projected from the AGSSpatialReference
object defined by the receiverSpatialReference
parameter to the AGSSpatialReference
defined by the outputSpatialReference
parameter using the outputDatumTransformation
. If the outputSpatialReference
parameter is nil
, the locations will not be projected and the locations will be in the receiverSpatialReference
, if the outputDatumTransformation
parameter is set it will be ignored. This initializer can be used when a receiver is outputting locations in an AGSSpatialReference
object other than WGS84, such as when using a reference base station, and/or the application requires the output locations to be projected to a different AGSSpatialReference
using an AGSDatumTransformation
.
receiverSpatialReference | The AGSSpatialReference object of incoming NMEA receiver data. |
outputSpatialReference | The AGSSpatialReference object to project the AGSNMEALocation object to. |
outputDatumTransformation | The AGSDatumTransformation object to use to project the AGSNMEALocation object. |
- (void) pushData: | (NSData *) | data |
Reads the input NMEA data creating an AGSNMEALocation
object. The NMEA location data source needs to be started before calling this method.
When pushing data:
data | The data buffer that contains NMEA data. |
- (void) startWithCompletion: | (nullable void(^)(NSError *__nullable error)) | completion |
This is invoked by the location display on the datasource to initiate requesting location updates. Internally this method calls doStart (AGSLocationDataSource(ForSubclassEyesOnly))
which subclasses must implement.
completion | block which will be invoked when the operation completes. If the dataSource failed to start, the error property will be populated. |
- (void) stop |
This is invoked by the location display on the datasource to stop requesting location updates. Internally this method calls doStop (AGSLocationDataSource(ForSubclassEyesOnly))
which subclasses must implement.
stopWithCompletion:
. Provided by category AGSLocationDataSource(AGSDeprecated).
- (void) stopWithCompletion: | (nullable void(^)(void)) | completion |
This is invoked by the location display on the datasource to stop requesting location updates. Internally this method calls doStop (AGSLocationDataSource(ForSubclassEyesOnly))
which subclasses must implement.
|
readnonatomicstronginherited |
The error that prevented the datasource from starting or was encountered while retrieving a location udpate
|
readwritenonatomicweak |
The delegate which will receive satellite info updates from the data source.
|
readnonatomicstrong |
The AGSDatumTransformation
object to be used in the project operation.
|
readnonatomicstrong |
The spatial reference to which the AGSNMEALocation
object is projected.
If this property is nil
, the AGSNMEALocation::position
proprety will contain the original incoming x, y, z values from the NMEA data sentence and the AGSNMEALocationDataSource::receiverSpatialReference
property.
|
readnonatomicstrong |
The AGSSpatialReference
object applied when an NMEALocation
object is created.
By default this will be WGS84 for its horizontal (WKID=4326) and vertical reference systems (WKID=115700), though a different value can be passed during initialization if a receiver returns locations in a different reference system.
|
readnonatomicassigninherited |
YES
if the data source has been started, NO
otherwise.
AGSLocationDataSource::status
. Provided by category AGSLocationDataSource(AGSDeprecated).
|
readnonatomicassigninherited |
The status of the data source.