Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Rename complete. #11

Merged
merged 1 commit into from

2 participants

@mspisars
  • to match HIDAPI hid_set_nonblocking() method.

    • test:

      msr.setNonBlocking(1)
      msr.read(onRead)

      Error reading card, swipe again!

@mspisars mspisars * rename setNoBlock() to setNonBlocking()
 * to match HIDAPI hid_set_nonblocking() method.
   * test:
   > msr.setNonBlocking(1)
   > msr.read(onRead)

     Error reading card, swipe again!
54dcd65
@mspisars

I tested this with my implementation. Works the same.

@hanshuebner hanshuebner merged commit 04ee6fd into node-hid:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 18, 2012
  1. @mspisars

    * rename setNoBlock() to setNonBlocking()

    mspisars authored
     * to match HIDAPI hid_set_nonblocking() method.
       * test:
       > msr.setNonBlocking(1)
       > msr.read(onRead)
    
         Error reading card, swipe again!
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 8 deletions.
  1. +8 −8 src/HID.cc
View
16 src/HID.cc
@@ -63,7 +63,7 @@ class HID
void write(const databuf_t& message)
throw(JSException);
void close();
- void setNoBlock(int message)
+ void setNonBlocking(int message)
throw(JSException);
private:
@@ -75,7 +75,7 @@ class HID
static Handle<Value> read(const Arguments& args);
static Handle<Value> write(const Arguments& args);
static Handle<Value> close(const Arguments& args);
- static Handle<Value> setNoBlock(const Arguments& args);
+ static Handle<Value> setNonBlocking(const Arguments& args);
static Handle<Value> getFeatureReport(const Arguments& args);
static Handle<Value> sendFeatureReport(const Arguments& args);
@@ -143,7 +143,7 @@ HID::close()
}
void
-HID::setNoBlock(int message)
+HID::setNonBlocking(int message)
throw(JSException)
{
int res;
@@ -374,16 +374,16 @@ HID::close(const Arguments& args)
}
Handle<Value>
-HID::setNoBlock(const Arguments& args)
+HID::setNonBlocking(const Arguments& args)
{
if (args.Length() != 1) {
return ThrowException(String::New("Expecting a 1 to enable, 0 to disable as the first argument."));
}
- int setBlocking = 0;
- setBlocking = args[0]->Int32Value();
+ int blockStatus = 0;
+ blockStatus = args[0]->Int32Value();
try {
HID* hid = ObjectWrap::Unwrap<HID>(args.This());
- hid->setNoBlock(setBlocking);
+ hid->setNonBlocking(blockStatus);
return Undefined();
}
catch (const JSException& e) {
@@ -492,7 +492,7 @@ HID::Initialize(Handle<Object> target)
NODE_SET_PROTOTYPE_METHOD(hidTemplate, "write", write);
NODE_SET_PROTOTYPE_METHOD(hidTemplate, "getFeatureReport", getFeatureReport);
NODE_SET_PROTOTYPE_METHOD(hidTemplate, "sendFeatureReport", sendFeatureReport);
- NODE_SET_PROTOTYPE_METHOD(hidTemplate, "setNoBlock", setNoBlock);
+ NODE_SET_PROTOTYPE_METHOD(hidTemplate, "setNonBlocking", setNonBlocking);
target->Set(String::NewSymbol("HID"), hidTemplate->GetFunction());
Something went wrong with that request. Please try again.