Module: NFC

Defined in:
lib/ruby-nfc/nfc.rb,
lib/ruby-nfc/reader.rb,
lib/ruby-nfc/tags/tag.rb

Defined Under Namespace

Classes: Error, Reader, Tag

Constant Summary collapse

@@context =
nil
@@logger =

TODO

Logger.new(STDERR)

Class Method Summary collapse

Class Method Details

.contextObject



16
17
18
19
20
21
22
23
# File 'lib/ruby-nfc/nfc.rb', line 16

def self.context
  unless @@context
    ptr = FFI::MemoryPointer.new(:pointer, 1)
    LibNFC.nfc_init(ptr)
    @@context = ptr.read_pointer
  end
  @@context
end

.loggerObject



25
26
27
# File 'lib/ruby-nfc/nfc.rb', line 25

def self.logger
	@@logger
end

.versionObject



12
13
14
# File 'lib/ruby-nfc/nfc.rb', line 12

def self.version
  LibNFC.nfc_version
end