Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
})
}
var defaultAckTimeout = 30.0
if (program.ackTimeout) {
defaultAckTimeout = program.ackTimeout
}
var coapTiming = {
ackTimeout: defaultAckTimeout,
ackRandomFactor: 1.0,
maxRetransmit: 5,
maxLatency: 2,
piggybackReplyMs: 10
}
coap.updateTiming(coapTiming)
req.on('response', function (res) {
var endTime = new Date()
if (program.showTiming) {
console.log('Request took ' + (endTime.getTime() - startTime.getTime()) + ' ms')
}
// print only status code on empty response
if (!res.payload.length && !program.quiet) {
process.stderr.write('\x1b[1m(' + res.code + ')\x1b[0m\n')
}
res.pipe(through(function addNewLine (chunk, enc, callback) {
if (!program.quiet) {
process.stderr.write('\x1b[1m(' + res.code + ')\x1b[0m\t')
}
port: this._config.port,
mac: '',
routerIp: ''
};
this._agent = coap.globalAgent;
this._registry = {};
this._server = null;
this._enabled = false;
this._joinable = false;
this._hbChecker = null;
this._permitJoinTime = 0;
this._permitJoinTimer = null;
coap.updateTiming({
maxLatency: (this._config.reqTimeout - 47) / 2
});
this._acceptDevIncoming = function (devInfo, callback) { // Override at will.
setImmediate(function () {
var accepted = true;
callback(null, accepted);
});
};
}