ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Core.DeviceLocation Namespace / SerialPortDeviceLocationSource Class / ComPort Property
Example

In This Topic
    ComPort Property
    In This Topic
    Gets and sets the COM port which the communication between ArcGIS Pro and a location device such as GPS/GNSS taken place.
    Syntax
    public string ComPort {get; set;}
    Public Property ComPort As String
    Remarks
    var sp = new SerialPortDeviceLocationSource() { ComPort = "COM4", };
    Example
    var sp = new SerialPortDeviceLocationSource()
    {
      ComPort = "COM4",
    };
    Connect to a Device Location Source
    var newSrc = new SerialPortDeviceLocationSource();
    
    //Specify the COM port the device is connected to
    newSrc.ComPort = "Com3";
    newSrc.BaudRate = 4800;
    newSrc.AntennaHeight = 3;  // meters
                               //fill in other properties as needed
    
    var props = new DeviceLocationProperties();
    props.AccuracyThreshold = 10;   // meters
    
    // jump to the background thread
    await QueuedTask.Run(() =>
    {
      //open the device
      DeviceLocationService.Instance.Open(newSrc, props);
    });
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also