ZWaveDeviceConnection.js
function(thisObject, commandClass, command, data) {
    if (typeof data === "undefined") {
        // default
        data = Buffer.alloc(0);
    }

    // convert data into a buffer
    data = new Buffer(data);

    let offset = 0;

    // create z/ip packet
    let packet = Buffer.alloc(2 + data.length);
    packet[offset] = commandClass;
    offset += 1;
    packet[offset] = command;
    offset += 1;
    data.copy(packet, offset, 0, data.length);
    offset += data.length;

    // send our message
    thisObject.dtlsSocket.send(packet, 0, packet.length, 41230, thisObject.ipAddress, thisObject.pskIdentity, thisObject.pskPassword);
}
function(thisObject, commandClass, command, data) {
    if (typeof data === "undefined") {
        // default
        data = Buffer.alloc(0);
    }

    // convert data into a buffer
    data = new Buffer(data);

    let offset = 0;

    // create z/ip packet
    let packet = Buffer.alloc(2 + data.length);
    packet[offset] = commandClass;
    offset += 1;
    packet[offset] = command;
    offset += 1;
    data.copy(packet, offset, 0, data.length);
    offset += data.length;

    // send our message
    thisObject.dtlsSocket.send(packet, 0, packet.length, 41230, thisObject.ipAddress, thisObject.pskIdentity, thisObject.pskPassword);
}
function ( thisObject , commandClass , command , data ) { if ( typeof data === "undefined" ) { // default data = Buffer . alloc ( 0 ) ; } // convert data into a buffer data = new Buffer ( data ) ; let offset = 0 ; // create z/ip packet let packet = Buffer . alloc ( 2 + data . length ) ; packet [ offset ] = commandClass ; offset += 1 ; packet [ offset ] = command ; offset += 1 ; data . copy ( packet , offset , 0 , data . length ) ; offset += data . length ; // send our message thisObject . dtlsSocket . send ( packet , 0 , packet . length , 41230 , thisObject . ipAddress , thisObject . pskIdentity , thisObject . pskPassword ) ; }
NOTE: this function sends a raw Z-Wave command without wrapping it inside a Z/IP frame and without waiting for an acknowledgment
NOTE : this function sends a raw Z - Wave command without wrapping it inside a Z / IP frame and without waiting for an acknowledgment