Project

mm_gps

0.0
No commit activity in last 3 years
No release in over 3 years
MarvelMind Indoor GPS driver.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.12
~> 10.0

Runtime

~> 1.3.1
 Project Readme

MmGPS

Gem Version

Ruby interface to MarvelMind Indoor GPS System.

Installation

Add this line to your application's Gemfile:

gem 'mm_gps'

And then execute:

$ bundle

Or install it yourself as:

$ gem install mm_gps

Usage

Simple usage example:

require 'mm_gps'

PORT = "/dev/cu.usbmodem1411"
BAUD = 115200 # SerialPort class does not support non-standard 500 kbps

beacon = MmGPS::Beacon.new(PORT, baud: BAUD)
beacon.trap # installs signal handler for CTRL-C

 # Standard each loop. Type CTRL-C for interrupting it
File.open("dump.hex", 'w') do |f|
  beacon.each do |packet, raw|
    p packet
    puts MmGPS::hexify(raw)
    f.print(raw)
  end
end

 # Use the enumerator:
beacon.reopen      # Needed, since CTRL-C in previous example also closes the Serialport connection
enum = beacon.each # gets the Enumerator
p enum.take 10     # Next 10 packets from enum

puts "Exiting"

Contributing

Bug reports and pull requests are welcome on GitHub .

License

The gem is available as open source under the terms of the MIT License.