GMSEC for Ruby
This is a Ruby library that wraps the GMSEC API in a
Ruby-friendly way. This makes it easy to quickly develop applications that can be deployed
in a ground system environment that leverages the various software libraries in the Ruby
community.
Installation
You will need to compile and install GMSEC 3.6 according to GMSEC documentation. Ensure that
the GMSEC and supporting libraries (Bolt, MBServer, etc) are available in a standard
library location such as /usr/local/lib
. If on Windows, make sure that your PATH
variable
includes the location of where the GMSEC library exists.
After that, simply run: gem install gmsec
to install this gem!
Example Usage
require 'gmsec'
connection = GMSEC::Connection.new(connectiontype: :gmsec_mb)
connection.connect
connection.connected?
connection.subscribe("TEST.*") do |message|
puts message.to_s
end
connection.start_auto_dispatch
message = connection.new_message
message[:foo] = :bar
message << {answer: 42, baz: true}
message << GMSEC::Field.new(:bar, "x", type: :char)
message.subject = "TEST.FOO"
connection.publish(message)
connection.publish({foo: :bar, answer: 42, baz: true}, subject: "TEST.BAZ")