ArcGIS Pro 2.7 API Reference Guide
DeviceLocationService Class
Members  Example 

ArcGIS.Desktop.Core.DeviceLocation Namespace : DeviceLocationService Class
Represents the device location service for connecting to GPS/GNSS devices.
Object Model
DeviceLocationService ClassSnapshot ClassDeviceLocationProperties ClassDeviceLocationSource ClassIDeviceLocationService Interface
Syntax
public sealed class DeviceLocationService : IDeviceLocationService  
Public NotInheritable Class DeviceLocationService 
   Implements IDeviceLocationService 
Remarks
There can only be one device location source open at any one time.

You cannot create a DeviceLocationService instance. Instead use the Instance property to access the singleton DeviceLocationService instance which will have been already created.

Subscribe to ArcGIS.Desktop.Core.DeviceLocation.Events.SnapshotChangedEvent event to receive coordinates and metadata from the open device location source Snapshot.

To interact with the current or active map view using the device location, use the ArcGIS.Desktop.Mapping.DeviceLocation.MapDeviceLocationService instance.

Subscribe to the ArcGIS.Desktop.Core.DeviceLocation.Events.DeviceLocationSourceChangedEvent to receive notifications when the current device location source is changed.

Example
var sp = new SerialPortDeviceLocationSource()
{
  ComPort = "COM4",
};
            
await QueuedTask.Run(() =>
{
  DeviceLocationService.Instance.Open(sp);
});
Inheritance Hierarchy

System.Object
   ArcGIS.Desktop.Core.DeviceLocation.DeviceLocationService

Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

DeviceLocationService Members
ArcGIS.Desktop.Core.DeviceLocation Namespace