Skip to content

Commit

Permalink
fix: keep mitmc
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio1988 committed Dec 5, 2023
1 parent 81c8f9c commit 31128d2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/connections/src/lib/deviceControlConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class DeviceControlConnection extends EventEmitter {
}

received(message: string) {
this.log.debug(`${this.deviceId}: <DEVICEC ${message}`);
this.log.debug(`${this.deviceId}: <MITMC ${message}`);

this.dateLastMessageReceived = Date.now();
this.dateLastMessageSent = Date.now();
Expand Down Expand Up @@ -104,15 +104,15 @@ export class DeviceControlConnection extends EventEmitter {
if (promise) {
delete this.responses[response.id];
if (response.status == 200) {
this.log.debug(`${this.deviceId}: <DEVICEC Received job response message ${message.toString()}`);
this.log.debug(`${this.deviceId}: <MITMC Received job response message ${message.toString()}`);

promise.resolve(response.body);
} else {
this.log.warn(`${this.deviceId}: <DEVICEC Received rejection message ${message.toString()}`);
this.log.warn(`${this.deviceId}: <MITMC Received rejection message ${message.toString()}`);
promise.reject(`Status ${response.status} ${response.body?.errorReason ?? ''}`);
}
} else {
this.log.warn(`${this.deviceId}: <DEVICEC Unrecognised response ${message.toString()}`);
this.log.warn(`${this.deviceId}: <MITMC Unrecognized response ${message.toString()}`);
}
}
}
Expand Down Expand Up @@ -201,7 +201,7 @@ export class DeviceControlConnection extends EventEmitter {

setTimeout(() => {
if (this.responses[id]) {
this.log.warn(`${this.deviceId}: <DEVICEC Timeout to request ${JSON.stringify(command)}`);
this.log.warn(`${this.deviceId}: <MITMC Timeout to request ${JSON.stringify(command)}`);
this.responses[id].reject('Timeout');
}
}, timeout);
Expand Down

0 comments on commit 31128d2

Please sign in to comment.