Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

raising an exception if the device cannot be found

  • Loading branch information...
commit e85e0ca104965d2cfb2caa0675d60efb0030b7e6 1 parent 902517f
Aaron Patterson authored
Showing with 5 additions and 0 deletions.
  1. +2 −0  Rakefile
  2. +3 −0  ext/nfc/nfc_device.c
2  Rakefile
View
@@ -5,6 +5,8 @@ require 'hoe'
gem 'rake-compiler', '>= 0.4.1'
require "rake/extensiontask"
+Hoe.plugin :debugging
+
HOE = Hoe.spec('nfc') do
developer('Aaron Patterson', 'aaronp@rubyforge.org')
self.readme_file = 'README.rdoc'
3  ext/nfc/nfc_device.c
View
@@ -9,6 +9,9 @@
static VALUE connect(VALUE klass)
{
dev_info * dev = nfc_connect();
+ if(!dev)
+ rb_raise(rb_eRuntimeError, "could not find NFC device");
+
if(!nfc_initiator_init(dev))
rb_raise(rb_eRuntimeError, "oh snap, could not init");
Please sign in to comment.
Something went wrong with that request. Please try again.