

Public Class SerialPortDeviceLocationSource Inherits DeviceLocationSource Implements System.ComponentModel.INotifyPropertyChanged, System.IEquatable(Of SerialPortDeviceLocationSource)
public class SerialPortDeviceLocationSource : DeviceLocationSource, System.ComponentModel.INotifyPropertyChanged, System.IEquatable<SerialPortDeviceLocationSource>
{
// Check if a device is connected
bool isConnected = DeviceLocationService.Instance.IsDeviceConnected();
if (!isConnected)
return; // no device connected
// Get the current device location source
var src = DeviceLocationService.Instance.GetSource();
// Check if the source is a SerialPortDeviceLocationSource
//Set values for the SerialPortDeviceLocationSource
if (src is SerialPortDeviceLocationSource serialPortSrc)
{
var port = serialPortSrc.ComPort;
var antennaHeight = serialPortSrc.AntennaHeight;
var dataBits = serialPortSrc.DataBits;
var baudRate = serialPortSrc.BaudRate;
var parity = serialPortSrc.Parity;
var stopBits = serialPortSrc.StopBits;
// retrieving spatial reference needs the MCT
var sr = await QueuedTask.Run(() =>
{
return serialPortSrc.GetSpatialReference();
});
}
//Get current device location properties being used.
var dlProps = DeviceLocationService.Instance.GetProperties();
var accuracy = dlProps.AccuracyThreshold;
}
System.Object
ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase
ArcGIS.Desktop.Core.DeviceLocation.DeviceLocationSource
ArcGIS.Desktop.Core.DeviceLocation.SerialPortDeviceLocationSource
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)