diff --git a/src/device.js b/src/device.js index 92c2f01..26215c2 100644 --- a/src/device.js +++ b/src/device.js @@ -117,6 +117,8 @@ initDeviceConnection = function (id) { device.connection.send({ address: address, args: args }); }; device.plugin = plugins[type]; + + } else if (plugins[type].connectionType == 'TCPsocket') { device.connection = new net.Socket(); @@ -144,6 +146,8 @@ initDeviceConnection = function (id) { // log("SOCK OUT", data); device.connection.write(data); }; + + } else if (plugins[type].connectionType == 'UDPsocket') { device.connection = udp.createSocket('udp4'); @@ -162,6 +166,8 @@ initDeviceConnection = function (id) { }); }; } + + }; module.exports.initDeviceConnection = initDeviceConnection;