ArcGIS Pro 2.8 API Reference Guide
Open Method (DeviceLocationService)
Example 

ArcGIS.Desktop.Core.DeviceLocation Namespace > DeviceLocationService Class : Open Method
A DeviceLocationSource.
A DeviceLocationProperties.
Connects to a new device location source such as a GPS/GNSS device via a COM port. This method must be called on the MCT. Use QueuedTask.Run.
Syntax

Parameters

source
A DeviceLocationSource.
props
A DeviceLocationProperties.
Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
Value cannot be null: source
DeviceLocationSource ComPort cannot be null
Remarks
At a minimum, a ComPort must be specified in the DeviceLocationSource parameter.
Example
var sp = new SerialPortDeviceLocationSource()
{
  ComPort = "COM4",
};
            
await QueuedTask.Run(() =>
{
  DeviceLocationService.Instance.Open(sp);
});
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

DeviceLocationService Class
DeviceLocationService Members