GPS 中间驱动程序问题
我的 GPS 中间驱动程序存在一些问题,我已在相机/GPS 硬件中添加了一个虚拟串行端口以公开原始 NMEA 数据,现在可以正常工作,任何需要原始 NMEA 数据的应用程序都可以连接到 COM8 并接收它。
如果涉及GPS中间驱动程序,即“设置|外部GPS”将硬件端口设置为COM8,将程序端口设置为COM7。然后,当应用程序从 COM7 请求数据时,数据看起来会有所不同。我只是说出现是因为我无法检查物理输出,请参阅下面的注释 A。
区别似乎在于它的返回速度明显比直接连接到 COM8 慢,而且像 VisualGPS 这样的应用程序虽然显示锁定到 6 颗卫星,但不会显示 3D GPS 修复。只有当连接到 COM8 时,我才会收到 3D GPS 修复,这对我来说表明 Microsoft 软件正在更改数据而不是简单地共享数据,从而给想要使用驱动程序在多个应用程序之间共享数据的用户带来问题。
任何人都知道为什么 Microsoft 中间驱动程序会导致我出现此类问题,但有关它的信息似乎很少。
注 A) - WM6 专业版似乎没有诊断程序可以读取 COM 端口或至少将流量重定向到连接到 PC 的 COM 端口。如果有人可以推荐一个 WM6 程序来连接和查看来自 COM 端口的数据,最好带有时间戳。或者一个重定向流量的程序,即从 COM7 读取、打开 COM6 并通过 COM6 发送数据。我可以将数据推送到系统中,只是我找到的程序都不会将数据推送出去。
Im having some issues with the GPS intermediate driver, I have added a virtual serial port to our Camera/GPS hardware to expose the raw NMEA data and this is now working without a problem, any application requiring raw NMEA data can connect to COM8 and receive it.
If the GPS Intermediate Driver is involved, i.e. "Setting | External GPS" has hardware port set to COM8 and program port to COM7. Then when applications request data from COM7 the data appears to be different. I only say appears as I am unable to check the physically output, see Note A below.
The difference appears to be it is returned noticeably slower than connecting to COM8 directly, but also applications like visualGPS whilst they show locked onto 6 satellites will not show a 3D GPS fix. Only when connected to COM8 will I receive a 3D GPS fix, this to me indicates the Microsoft software is changing the data rather than simply sharing it and thus causing issues for users who want to use the driver to share data across several applications.
Anyone have any ideas on why the Microsoft intermediate driver is causing me such issues, there seems to be very little information about it.
Note A) - There seems to be no diagnostic program for WM6 professional that will read COM ports or at least redirect traffic to a COM port connected to the PC. If anyone can recommend a program for WM6 to connect and view data from COM ports, ideally with timestamps. Or a program to redirect traffic i.e. read from COM7, Open COM6 and send data over COM6. I can push data into the system, just no programs I can locate will push data out.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
更改设备数据是 GPS 中间驱动程序应该做的事情。它将您的应用程序与 GPS 设备的实现细节隔离开来,以便您的代码可以与任何 GPS 设备配合使用。我无法从您的问题中诊断出您遇到的确切问题,我只能推荐 文档。
Altering the device data is what the GPS Intermediate Driver is supposed to do. It isolates your app from the implementation details of the GPS device so that your code can work with any GPS device. I can't diagnose the exact problem you are having from your question, I can only recommend the docs.
我已与移动设备制造商合作来诊断此问题。他们必须使用我们的设备和操作系统的调试版本来隔离它,即使如此,问题也不是双方(驱动程序与操作系统)的一行代码。我们的读取方法没有超时,作为一个软件端口,这并不重要,但它是必需的。
必须添加这样的东西。
即使超时为 0,它也允许线程休眠并允许其他进程继续。问题是没有它,应用程序读取 COM 端口的次数太多,导致中间驱动程序调用和创建互斥锁产生开销。像 pocketputty 这样多次读取 1 个字节的应用程序会导致此问题,但像 copilot 这样的 SatNav 软件每秒读取 1024 次就没有问题。
I have worked with the mobile device manufacturer to diagnose this. They had to use our device and a debug version of the OS to isolate it, and even then its not a line of code on either side (driver vs OS) that is the problem. Our read method does not have a timeout, being a software port it doesn't really matter but it is required.
Something like this MUST be added.
Even with a timeout of 0, it allows the thread to sleep and other processes to continue. The problem was without it, applications were reading the COM port so much it was causing a overhead in the intermediate driver making calls and creating mutex locks. Applications that do many reads of 1 byte like pocketputty cause this issue, but SatNav software like copilot reading 1024 once a second have no issue.