如何从 GPS 设备获取 NMEA?
我正在尝试使用诺基亚 N95 读取 GPS 设备的当前位置。 我读到我需要我的设备将 NMEA 线返回到串行端口,然后我将解析/拆分它以获得我想要的东西,但一直以来我不知道要向串行端口写入什么以使设备返回 NMEA?
就像 AT 还有其他命令用于消息传递等...是否有任何特定命令发送到串行端口以获取 NMEA ???
im trying to read the current position of GPS Device...using N95 from Nokia.
I read tht i will need my device to return the NMEA lines to the serialport and then i will parse/split it to get things I want but all along I dont know what to write to the serialport to make device return the NMEA ?
Like There are other commands of AT for messaging etc...Is there any specific command to send to serialport to get NMEA ???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
我找到了这个网站 site 似乎可以指导您完成您需要做的一切。
I found this site site which seems to guide you through everything you need to do.
我不确定它在 N95 中如何工作,但在我的 HTC 手机中,您无法向 GPS 设备发送命令以使其以某种方式运行。 连接到 GPS 设备使用的串行端口后,我可以读取来自该设备的数据流,这恰好是 NMEA 数据。 我发现无法向设备发送命令来告诉它如何行为。
I am not sure how it works in the N95, but in my HTC phone you cannot send commands to the GPS device to have it behave in a certain manner. Once I am connected to the serial port that the GPS device uses I can read a stream of data coming from it, which happens to be NMEA data. There is no way that I have found to send commands to the device to tell it how to behave.
我以前没有使用过该特定的 GPS 设备,但对于我的设备,我只需打开端口即可立即开始接收 NMEA 数据。
I haven't used that specific GPS device before, but for mine, I just have to open the port and I start receiving the NMEA data immediately.
我有一台 N82,据我所知,它不能直接使用 NMEA。 我使用此页面中的一个脚本 - 特别是标题为“# Turn your S60 Phone with an Internal GPS (例如,您的 N95)连接到蓝牙 GPS” - 获取 NMEA 字符串。
I have an N82, and as far as I know it doesn't speak NMEA directly. I use a script from this page - specifically one the titled "# Turn your S60 phone with an internal GPS (eg your N95) into a Bluetooth GPS" - to get NMEA strings.
啊,好吧,所以我需要运行一些脚本。好吧,我想我应该为其购买一个特定的 GPS 设备。
哪种设备能以最便宜的方式完成我的工作?
Ahh oki so I need to run some script.Oki I think i should buy a specific GPS Device for it.
Which device will do my job in cheapest manner ?
我从未专门使用过 N95,但大多数 GPS 设备一旦通电就会开始输出 NMEA,无论它们是否有锁。 我不知道 N95 是如何设计的,但我敢打赌它的设计可能不是为了让您能够从 GPS 访问原始 NMEA 数据。 你可能需要一些非常奇特的技巧来让它做到这一点。
如果您不需要使用 N95,您可能会发现购买 GPS 模块并使用它会更容易。 我一直都是从 SparkFun 购买的。 他们有一些很好的评估板板和教程帮助您入门。
I've never worked specifically with the N95, but most GPS devices will just start spitting out NMEA as soon as they're powered up, regardless of whether or not they have a lock. I don't know how the N95 is designed, but I'll bet it probably wasn't designed to give you access to the raw NMEA data from the GPS. You'll probably need some pretty fancy trickery to get it to do that.
If you don't need to use the N95, you might find it easier to just get a GPS module and use that instead. I've always purchased mine from SparkFun. They have some good evaluation boards boards and tutorials to help you get started.
在 Java ME 中执行此操作的一个好方法是使用 JSR 179:位置 API。 您的应用程序需要创建 LocationListener 的实现,然后将其设置在默认的 LocationProvider 上。 当您的侦听器的 locationUpdated 方法被调用时,请调用:
这将提供对 NMEA 句子的访问。
您可以使用 Java ME 通信机制通过串行端口发送此信息(使用:
如所述 这里)。
希望这有帮助,
funkybro
A great way of doing this in Java ME is to use JSR 179: the Location API. Your app needs to create an implementation of LocationListener, then set it on the default LocationProvider. When your listener's locationUpdated method gets called, call:
This will provide access to the NMEA sentences.
You can send this over a serial port by using the Java ME commports mechanism (use:
as described here).
Hope this helps,
funkybro