Sha256: 317c75d1d8638673f91c6c72a73cac5a243bc8afe2810a87c944c53fb75f692f

Contents?: true

Size: 592 Bytes

Versions: 2

Compression:

Stored size: 592 Bytes

Contents

require 'ffi'
require 'aprs_parser/version'
require 'aprs_parser/type_safety'
require 'aprs_parser/converters'
require 'aprs_parser/enums'
require 'aprs_parser/structs'

module AprsParser
  extend FFI::Library
  ffi_lib 'fap'

  attach_function :fap_init, [], :void
  attach_function :fap_cleanup, [], :void
  attach_function :fap_parse, :fap_parseaprs, [:string, :uint, :bool], AprsParser::Structs::Package.ptr

  def self.parse(message)
    AprsParser.fap_init
    begin
      AprsParser.fap_parse(message, message.bytesize, false)
    ensure
      AprsParser.fap_cleanup
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
aprs_parser-1.0.0 lib/aprs_parser.rb
aprs_parser-1.0.0.pre lib/aprs_parser.rb