ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Desktop.Core.DeviceLocation Namespace / SerialPortDeviceLocationSource Class
Members Example

In This Topic
    SerialPortDeviceLocationSource Class
    In This Topic
    Represents a location device source such as GPS/GNSS device that is connected via a serial port.
    Object Model
    SerialPortDeviceLocationSource ClassSpatialReference Class
    Syntax
    Example
    Get Current Device Location Source and Properties
    bool isConnected = DeviceLocationService.Instance.IsDeviceConnected();
    
    var src = DeviceLocationService.Instance.GetSource();
    
    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();
      });
    
    }
    var dlProps = DeviceLocationService.Instance.GetProperties();
    var accuracy = dlProps.AccuracyThreshold;
    
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase
          ArcGIS.Desktop.Core.DeviceLocation.DeviceLocationSource
             ArcGIS.Desktop.Core.DeviceLocation.SerialPortDeviceLocationSource

    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also