From fd7b70578d634c7226520924739a13427477dc5e Mon Sep 17 00:00:00 2001 From: Hans Huebner Date: Sun, 6 May 2012 11:50:25 +0200 Subject: [PATCH 1/2] osx fixes --- binding.gyp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/binding.gyp b/binding.gyp index be6735d..972f085 100644 --- a/binding.gyp +++ b/binding.gyp @@ -69,7 +69,10 @@ 'IOKit', '-framework', 'CoreFoundation' - ] + ], + 'xcode_settings': { + 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES' + } }], [ 'OS=="linux"', { 'conditions': [ @@ -96,11 +99,10 @@ } }] ], - 'cflags': ['-g'], - 'cflags!': [ - '-ansi' - ], - 'cflags_cc!': [ '-fno-exceptions' ] + 'cflags!': ['-ansi', '-fno-exceptions' ], + 'cflags_cc!': [ '-fno-exceptions' ], + 'cflags': ['-g', '-exceptions'], + 'cflags_cc': ['-g', '-exceptions'] } ] } \ No newline at end of file From dc45b8ba2769caa4a7150f562fa8775984817ec1 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 7 May 2012 17:48:54 -0300 Subject: [PATCH 2/2] Instructions for compiling/running on Windows. --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/README.md b/README.md index 80a5fe4..2e12ec6 100644 --- a/README.md +++ b/README.md @@ -41,3 +41,40 @@ devices: [ { vendorId: 1452, ``` If you need help, send me an email (hans.huebner@gmail.com) + +# Windows Setup # +This source works on Win7 as of (5/7/12). Here are the steps to build on Windows. +Use node-gyp... the instruction in the README worked for me https://github.com/TooTallNate/node-gyp/blob/master/README.md + +After you have node-gyp installed on your windows node.js install. + +``` +...> cd _path\to\nodejs\modules\node-hid_ +...> node-gyp configure +...> node-gyp build +``` +you should now have a HID.node file in the node-hid\build\(Release or Debug) folder. +Copy HID.node to your nodejs\node_modules folder and run node.. +``` +> var HID = require('HID.node'); +undefined +> HID.devices() +[ { vendorId: 1133, + productId: 50479, + path: '\\\\?\\hid#vid_046d&pid_c52f&mi_00#8&7764ed8&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}', + serialNumber: '\t', + manufacturer: 'Logitech', + product: 'USB Receiver', + release: 5632, + interface: 0 }, + { vendorId: 1226, + productId: 34, + path: '\\\\?\\hid#vid_04ca&pid_0022#7&3974be35&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}', + serialNumber: '\t', + manufacturer: 'LITEON Technology', + product: 'USB Keyboard', + release: 265, + interface: -1 } ] +> +``` +You should be good to go...