From 9525bae48387abb9252ece4f4848bc5a7fd42166 Mon Sep 17 00:00:00 2001 From: Rob Giseburt Date: Tue, 2 Sep 2014 14:19:48 -0500 Subject: [PATCH 1/2] Potential fix for windows and Node 0.11.13 (atom-shell) --- src/serialport_win.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/serialport_win.cpp b/src/serialport_win.cpp index 11685b7..3f92524 100644 --- a/src/serialport_win.cpp +++ b/src/serialport_win.cpp @@ -5,6 +5,8 @@ #include "win/stdafx.h" #include "win/enumser.h" +#include + #ifdef WIN32 #define MAX_BUFFER_SIZE 1000 @@ -131,7 +133,7 @@ void EIO_Open(uv_work_t* req) { } // Remove garbage data in RX/TX queues - PurgeComm(file, PURGE_RXCLEAR); + PurgeComm(file, PURGE_RXCLEAR); PurgeComm(file, PURGE_TXCLEAR); data->result = (int)file; @@ -251,7 +253,7 @@ void EIO_AfterWatchPort(uv_work_t* req) { goto cleanup; } else { v8::Handle argv[1]; - argv[0] = v8::Exception::Error(v8::String::New(data->errorString)); + argv[0] = NanError(data->errorString); data->errorCallback->Call(1, argv); Sleep(100); // prevent the errors from occurring too fast } @@ -359,7 +361,7 @@ void EIO_Close(uv_work_t* req) { * * Notable VIDs & PIDs combos: * VID 0403 - FTDI - * + * * VID 0403 / PID 6001 - Arduino Diecimila * */ @@ -372,7 +374,7 @@ void EIO_List(uv_work_t* req) { dhInitialize(TRUE); dhToggleExceptions(FALSE); - + dhGetObject(L"winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\cimv2", NULL, &wmiSvc); dhGetValue(L"%o", &colDevices, wmiSvc, L".ExecQuery(%S)", L"Select * from Win32_PnPEntity"); @@ -385,7 +387,7 @@ void EIO_List(uv_work_t* req) { dhGetValue(L"%s", &name, objDevice, L".Name"); dhGetValue(L"%s", &pnpid, objDevice, L".PnPDeviceID"); - + if( name != NULL && ((match = strstr( name, "(COM" )) != NULL) ) { // look for "(COM23)" // 'Manufacturuer' can be null, so only get it if we need it dhGetValue(L"%s", &manu, objDevice, L".Manufacturer"); @@ -398,14 +400,14 @@ void EIO_List(uv_work_t* req) { data->results.push_back(resultItem); dhFreeString(manu); } - + dhFreeString(name); dhFreeString(pnpid); } NEXT(objDevice); - + SAFE_RELEASE(colDevices); SAFE_RELEASE(wmiSvc); - + dhUninitialize(TRUE); } From 7f2c90fd634fcb2d992e46190acceb6af11b26d9 Mon Sep 17 00:00:00 2001 From: Rob Giseburt Date: Wed, 3 Sep 2014 13:18:52 -0500 Subject: [PATCH 2/2] Attempt to fix a glitch with travisCI and apt-get. --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8ea33ba..f43cfff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,9 @@ before_install: # If version is 0.9 do not publish to avoid duplicated binary error, caused by 0.9 and 0.10 # returning same v number in node.js. - if [[ "$TRAVIS_NODE_VERSION" == '0.9' ]]; then PUBLISH_BINARY=false; fi; +# Fix a problem with apt-get failing later, see http://docs.travis-ci.com/user/installing-dependencies/#Installing-Ubuntu-packages +- sudo apt-get update -qq + install: # ensure source install works