Skip to content

Commit

Permalink
try get away other callback deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollon77 committed May 9, 2024
1 parent 23f8341 commit f4406e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/mbus-master.cc
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ class RecieveWorker : public Nan::AsyncWorker {
// should go on `this`.
void Execute () {
if (!isConnected) {
SetErrorMessage("Not connected to port");
sprintf(error, "Not connected to port");
SetErrorMessage(error);
return;
}

Expand Down Expand Up @@ -528,7 +529,8 @@ class ScanSecondaryWorker : public Nan::AsyncWorker {
// should go on `this`.
void Execute () {
if (!isConnected) {
SetErrorMessage("Not connected to port");
sprintf(error, "Not connected to port");
SetErrorMessage(error);
return;
}

Expand Down Expand Up @@ -636,7 +638,8 @@ class SetPrimaryWorker : public Nan::AsyncWorker {
// should go on `this`.
void Execute () {
if (!isConnected) {
SetErrorMessage("Not connected to port");
sprintf(error, "Not connected to port");
SetErrorMessage(error);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion test/testSerial.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ describe('Native libmbus node-module Serial test ...', function() {
const mbusMaster = new MbusMaster(mbusOptions);

mbusMaster.getData(3, function(err, data) {
expect(err.message).to.be.equal('Not connected to port');
expect(err.message).to.be.equal('Not connected and autoConnect is false');

const connectResult = mbusMaster.connect();
console.log(new Date().toString() + ': mbus-Serial-Master Open:' + connectResult);
Expand Down

0 comments on commit f4406e4

Please sign in to comment.