GPS中间驱动程序不断返回0 0 LAT LNG [英] GPS Intermediate Driver Constantly Return 0 0 LAT LNG

查看:136
本文介绍了GPS中间驱动程序不断返回0 0 LAT LNG的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很困惑,因为我知道我的GPS设备状态和服务状态都为ON,但查看中的卫星"和纬度/经度"均为空白.我已将程序配置为使用端口GPD1,而我的硬件使用COM7.这似乎是正确的配置.为什么我什么也没得到退货?

I am confused because I know my GPS Device State and Service State are both ON, yet Satellites in View, and Latitude/Longitude are both blank. I have configured my programs to use port GPD1, and my Hardware uses COM7. This seems to be the correct configuration. Why am I getting nothing returned?

推荐答案

只有在存在Fix(有效地理位置)的情况下,纬度和经度才会填充:

Latitude and Longitude are only filled if there is a Fix (a valid geo position):

            // call native method passing in our native buffer
            int result = GPSGetPosition(gpsHandle, ptr, 500000, 0);
            if (result == 0)
            {
                // native call succeeded, marshal native data to our managed data
                gpsPosition = (GpsPosition)Marshal.PtrToStructure(ptr, typeof(GpsPosition));

                if (maxAge != TimeSpan.Zero)
                {
                    // check to see if the data is recent enough.
                    if (!gpsPosition.TimeValid || DateTime.Now - maxAge > gpsPosition.Time)
                    {
                        gpsPosition = null;
                    }
                }
            }

要进行定位(有效位置),GPS至少需要三颗有效卫星.

For a Fix (a valid position) the GPS needs at least three valid satellites.

请参阅我链接的 GPSsample 另一个问题.它将显示有关GPS信号发生情况的更多背景信息.

See my GPSsample I linked to your other question. It will show some more background information on what is going on with the GPS signals.

提示:首次定位时间(TTFF)可能会持续15-20分钟,如果没有备用EE数据源并且GPS模块没有移动太多,则可以自由观看天空. EE数据是通过卫星广播构建的,数据速率非常低. EE数据也可以通过Internet数据连接提供,但使用方式取决于所使用的GPS模块.此EE数据指定了两周内所有GPS卫星的真实位置. 如果关闭GPS接收器并移动约200公里,则必须从基准位置计算位置(可能还需要15分钟).

A tip: the time-to-first-fix (TTFF) may last up to 15-20 minutes with free view on the sky if there is no alternate EE data source and the GPS module is not moved to much. The EE data is built from the satellites broadcasts, the data rate is very low. The EE data can also be provided via a internet data connection, but the usage depends on the GPS module used. This EE data specifies the real position of all GPS satellites for two weeks. If a GPS receiver is switched off and moved ~200km, the location has to be calculated from base (may be another 15 minutes).

实际上,当前的GPS接收器为EE数据提供备用的提要",例如GPSeXtra(互联网数据)或MS辅助的GPS(手机塔ID和位置).

In reality, current GPS receivers provide alternate 'feeds' for EE data, for example GPSeXtra (internet data) or MS assisted GPS (cell phone tower ID and location).

这篇关于GPS中间驱动程序不断返回0 0 LAT LNG的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆