IRealTimeFeedManager realTimeFeedMgr = new RealTimeFeedManagerClass(); IGpsFeed gpsFeed = realTimeFeedMgr.GpsFeed; IGpsConnection gpsConnection = gpsFeed.Connection; gpsConnection.CommPort = 1; gpsConnection.BaudRate = (short)esriGpsBaudRate.esriGpsBaudRate9600; gpsConnection.DataBits = 8; gpsConnection.Parity = esriGpsParity.esriGpsParityNone; gpsConnection.StopBits = 1; gpsFeed.Connection = gpsConnection; realTimeFeedMgr.RealTimeFeed = (IRealTimeFeed)gpsFeed; realTimeFeed.Start(); System.Diagnostics.Debug.WriteLine("Status: " + realTimeFeed.Status.ToString()); esriGpsConnectionError conError = realTimeFeed.ConnectionError; System.Diagnostics.Debug.WriteLine(conError.ToString()); esriGpsPositionInfo posInfo = realTimeFeed.CurrentPosition; System.Diagnostics.Debug.WriteLine("Position: " + posInfo.latitude.ToString() + "," + posInfo.longitude); realTimeFeed.Stop();
Solved! Go to Solution.