lib/device.js
function(err, res) {
				if(err) {
					return onError('Weird Error open', err);
				}
				//Check for no errors
				if(res === 0) {
					//Save the handle & other information to the 
					//	device class
					self.handle = refDeviceHandle.readInt32LE(0);
					self.deviceType = deviceType;
					self.connectionType = connectionType;
					self.identifier = identifier;
					self.isHandleValid = true;
					return onSuccess();
				} else {
					//Make sure that the handle, deviceType 
					//		& connectionType are still null
					self.handle = null;
					self.deviceType = null;
					self.connectionType = null;
					self.identifier = null;
					return onError(res);
				}
			}
function(err, res) {
				if(err) {
					return onError('Weird Error open', err);
				}
				//Check for no errors
				if(res === 0) {
					//Save the handle & other information to the 
					//	device class
					self.handle = refDeviceHandle.readInt32LE(0);
					self.deviceType = deviceType;
					self.connectionType = connectionType;
					self.identifier = identifier;
					self.isHandleValid = true;
					return onSuccess();
				} else {
					//Make sure that the handle, deviceType 
					//		& connectionType are still null
					self.handle = null;
					self.deviceType = null;
					self.connectionType = null;
					self.identifier = null;
					return onError(res);
				}
			}
function ( err , res ) { if ( err ) { return onError ( 'Weird Error open' , err ) ; } //Check for no errors if ( res === 0 ) { //Save the handle & other information to the  //	device class self . handle = refDeviceHandle . readInt32LE ( 0 ) ; self . deviceType = deviceType ; self . connectionType = connectionType ; self . identifier = identifier ; self . isHandleValid = true ; return onSuccess ( ) ; } else { //Make sure that the handle, deviceType  //		& connectionType are still null self . handle = null ; self . deviceType = null ; self . connectionType = null ; self . identifier = null ; return onError ( res ) ; } }
Function for handling the ffi callback
Function for handling the ffi callback