vb.net 如何通过 USB 端口从设备读取 GPS 坐标

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14916469/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 12:21:43  来源:igfitidea点击:

How to read GPS coordinates from device via USB port

vb.netgpsusbcoordinatesgarmin

提问by Fritz45

I need to read GPS coordinates using a VB.NET program directly from a GPS device connected to the computer via USB (bluetooth also OK but prefer USB). My constraints are:

我需要使用 VB.NET 程序直接从通过 USB 连接到计算机的 GPS 设备读取 GPS 坐标(蓝牙也可以,但更喜欢 USB)。我的限制是:

  1. The computer running the software is NOT connected to the internet. It is a stand-alone machine in a moving vehicle.
  2. I need to be able to read GPS coordinates from the device while the vehicle moves and use the device to perform location-aware queries on a local database
  3. The GPS device can be anything (e.g. Garmin GPS or GPS card without display), as long at it can be purchased off the shelf or over the internet.
  4. The user group for this solution is quite small (about 40 users).
  1. 运行该软件的计算机未连接到互联网。它是移动车辆中的独立机器。
  2. 我需要能够在车辆移动时从设备读取 GPS 坐标,并使用设备在本地数据库上执行位置感知查询
  3. GPS 设备可以是任何东西(例如 Garmin GPS 或不带显示屏的 GPS 卡),只要它可以现成购买或通过互联网购买。
  4. 此解决方案的用户群很小(大约 40 个用户)。

I have already checked out GPSGate (http://gpsgate.com/) and emailed my requirements to them. They replied, and I quote: "I am sorry but we have no product for you." (end of reply).

我已经检查了 GPSGate ( http://gpsgate.com/) 并将我的要求通过电子邮件发送给他们。他们回答,我引用:“很抱歉,我们没有适合您的产品。” (回复结束)。

I also checked out Eye4Software) and tried using their demo product but it does not pick up my Garmin Nuvi via USB. They responded to my questions but unfortunately their OEM product is an ActiveX dll and I am looking for a .NET based solution.

我还检查了Eye4Software) 并尝试使用他们的演示产品,但它无法通过 USB 接收我的 Garmin Nuvi。他们回答了我的问题,但不幸的是他们的 OEM 产品是 ActiveX dll,我正在寻找基于 .NET 的解决方案。

So if anyone has a "home-grown" solution based on the .NET framework, that can be easily duplicated, I would really appreciate it. Many thanks!

因此,如果有人拥有基于 .NET 框架的“本土”解决方案,并且可以轻松复制,我将不胜感激。非常感谢!

采纳答案by fvu

Most of the USB GPS pucks will speak a standardized protocol called NMEA 0183. There are several .net protocols out there that decode this protocol, see herefor some pointers to get started.

大多数 USB GPS 圆盘会使用称为NMEA 0183的标准化协议。有几种 .net 协议可以解码此协议,请参阅此处以获取一些入门指南。

So, if when shopping around you just check that the device is able to generate NMEA you should be up and running in a minimum of time, and at a reasonable cost.

因此,如果您四处逛逛时只检查设备是否能够生成 NMEA,那么您应该能在最短的时间内以合理的成本启动并运行。

EDIT: a "gps puck" is a GPS receiver shaped more or less like a hockey puck, like this one

编辑:“gps puck”是一种形状或多或少像冰球的 GPS 接收器,就像这个

enter image description here

在此处输入图片说明

For in-car use there are specific versions that can be fixed onto the vehicle's roof

对于车内使用,有可以固定在车顶上的特定版本

enter image description here

在此处输入图片说明

They are pretty common (many online shopscarry them) but select them based on the chip that's inside, the popular Sirf Star 3 is still a solid performer, stable and accurate. I haven't had the chance to play with its successor, the Sirf Star 4 yet, and I'm not implying these are the only good chips around, only that I got most experience with this chip.

它们很常见(许多网上商店都有它们),但根据里面的芯片选择它们,流行的 Sirf Star 3 仍然表现出色,稳定且准确。我还没有机会和它的继任者 Sirf Star 4 一起玩,我并不是说这些是唯一的好筹码,只是我对这个筹码有最多的经验。