From 3d58e7b37f2e7f5f36516d6845c83170a899df23 Mon Sep 17 00:00:00 2001 From: Owen Brotherwood Date: Tue, 21 Feb 2017 17:39:19 +0100 Subject: [PATCH 01/10] with ignore for hello.js --- .gitignore | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3009cc6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +logs +*.logs +npm-debug.log* +node_modules/ +build/ +cache/ + +hello.js \ No newline at end of file From 08a83e3ea8a533b77f7b48a645357019238f2083 Mon Sep 17 00:00:00 2001 From: Owen Brotherwood Date: Tue, 21 Feb 2017 17:45:31 +0100 Subject: [PATCH 02/10] NTDDI_WIN8 and no undef --- cpp/winnus.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/winnus.cpp b/cpp/winnus.cpp index 894d755..de08875 100644 --- a/cpp/winnus.cpp +++ b/cpp/winnus.cpp @@ -3,7 +3,7 @@ #pragma warning (disable: 4068) // Massive hack - not sure how to fix this with node-gyp? -#undef NTDDI_VERSION +// #undef NTDDI_VERSION #define NTDDI_VERSION NTDDI_WIN8 From e17065c4bebc4f9f4d51eb824b47a1ea07ed1a84 Mon Sep 17 00:00:00 2001 From: Owen Brotherwood Date: Tue, 21 Feb 2017 17:51:06 +0100 Subject: [PATCH 03/10] NTDDI_WINBLUE --- cpp/winnus.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/winnus.cpp b/cpp/winnus.cpp index de08875..6adef43 100644 --- a/cpp/winnus.cpp +++ b/cpp/winnus.cpp @@ -4,7 +4,7 @@ // Massive hack - not sure how to fix this with node-gyp? // #undef NTDDI_VERSION -#define NTDDI_VERSION NTDDI_WIN8 +#define NTDDI_VERSION NTDDI_WINBLUE #include From 01bd331814a6445c203da013579dd80a2ec593fb Mon Sep 17 00:00:00 2001 From: Owen Brotherwood Date: Tue, 21 Feb 2017 21:45:19 +0100 Subject: [PATCH 04/10] throw DevicePaths error --- winnus.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/winnus.js b/winnus.js index 2d59cfb..aa62776 100644 --- a/winnus.js +++ b/winnus.js @@ -7,6 +7,9 @@ exports.getDevices = function() { var names = winnus.getDeviceNames(); var paths = winnus.getDevicePaths(); var devices = []; + if (typeof paths[0] === 'undefined') { + throw new Error("DevicePaths"); + } paths.forEach(function(path) { var found; names.forEach(function(name) { From 78d5597a5c28839470c8c9d5a3100e4017192eaa Mon Sep 17 00:00:00 2001 From: Owen Brotherwood Date: Tue, 21 Feb 2017 21:58:43 +0100 Subject: [PATCH 05/10] (paths.length === 'undefined' --- winnus.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winnus.js b/winnus.js index aa62776..891d92c 100644 --- a/winnus.js +++ b/winnus.js @@ -7,7 +7,7 @@ exports.getDevices = function() { var names = winnus.getDeviceNames(); var paths = winnus.getDevicePaths(); var devices = []; - if (typeof paths[0] === 'undefined') { + if (paths.length === 'undefined') { throw new Error("DevicePaths"); } paths.forEach(function(path) { From 60b2728dea4d16117bfce6a32c9c1c0be52e4f48 Mon Sep 17 00:00:00 2001 From: Owen Brotherwood Date: Tue, 21 Feb 2017 23:12:57 +0100 Subject: [PATCH 06/10] refert WINBLU and .gitignore tests --- .gitignore | 4 +--- cpp/winnus.cpp | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 3009cc6..b6b318a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,4 @@ logs npm-debug.log* node_modules/ build/ -cache/ - -hello.js \ No newline at end of file +cache/ \ No newline at end of file diff --git a/cpp/winnus.cpp b/cpp/winnus.cpp index 6adef43..894d755 100644 --- a/cpp/winnus.cpp +++ b/cpp/winnus.cpp @@ -3,8 +3,8 @@ #pragma warning (disable: 4068) // Massive hack - not sure how to fix this with node-gyp? -// #undef NTDDI_VERSION -#define NTDDI_VERSION NTDDI_WINBLUE +#undef NTDDI_VERSION +#define NTDDI_VERSION NTDDI_WIN8 #include From d57ec269d5a50600be0b35ca89d644a3c0e39f74 Mon Sep 17 00:00:00 2001 From: Owen Brotherwood Date: Wed, 22 Feb 2017 07:39:14 +0100 Subject: [PATCH 07/10] check paths.length for undefined ensure that winnus has hardware that can be used signoff owen@brotherwood.biz --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b6b318a..25b30c3 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ logs npm-debug.log* node_modules/ build/ -cache/ \ No newline at end of file +cache/ From 0fc672518c13c74dc54ce0015d41cb5171f97696 Mon Sep 17 00:00:00 2001 From: Owen Brotherwood Date: Wed, 22 Feb 2017 10:02:57 +0100 Subject: [PATCH 08/10] Version bump to 0.0.3 Sign off Owen Brotherwood --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c10a9eb..d424dd0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "winnus", - "version": "0.0.2", + "version": "0.0.3", "description": "Windows 8.1 and above BLE NUS support", "main": "winnus.js", "scripts": { From 3edaf222d09aeb94d4be8e582bde8dd9e6f2441f Mon Sep 17 00:00:00 2001 From: Owen Brotherwood Date: Wed, 22 Feb 2017 19:49:13 +0100 Subject: [PATCH 09/10] typeof paths[0] === 'undefined'] --- winnus.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/winnus.js b/winnus.js index 891d92c..f520c94 100644 --- a/winnus.js +++ b/winnus.js @@ -7,9 +7,9 @@ exports.getDevices = function() { var names = winnus.getDeviceNames(); var paths = winnus.getDevicePaths(); var devices = []; - if (paths.length === 'undefined') { + if (typeof paths[0] === 'undefined') { throw new Error("DevicePaths"); - } + } paths.forEach(function(path) { var found; names.forEach(function(name) { From ae66273234b0e597f111ca5a4bec743b47083836 Mon Sep 17 00:00:00 2001 From: Owen Brotherwood Date: Wed, 22 Feb 2017 19:55:13 +0100 Subject: [PATCH 10/10] 0.0.3 --- examples/hellowinnusnode/package.json | 2 +- examples/hellowinnusnwjs/nwapp/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/hellowinnusnode/package.json b/examples/hellowinnusnode/package.json index 9d17e91..ee71d67 100644 --- a/examples/hellowinnusnode/package.json +++ b/examples/hellowinnusnode/package.json @@ -14,7 +14,7 @@ "author": "Gordon Williams (http://espruino.com)", "license": "Apache-2.0", "dependencies": { - "winnus": "latest" + "winnus": "0.0.3" }, "bugs": { "url": "https://github.com/Espruino/winnus/issues" diff --git a/examples/hellowinnusnwjs/nwapp/package.json b/examples/hellowinnusnwjs/nwapp/package.json index d7bca84..57b65dc 100644 --- a/examples/hellowinnusnwjs/nwapp/package.json +++ b/examples/hellowinnusnwjs/nwapp/package.json @@ -20,6 +20,6 @@ "plugin": true }, "dependencies": { - "winnus":"latest" + "winnus":"0.0.3" } } \ No newline at end of file