|
|
@ -135,10 +135,10 @@ exports.mqttAsync = function (hostname, topic, okMessage, options = {}) {
|
|
|
|
if (messageTopic == topic) {
|
|
|
|
if (messageTopic == topic) {
|
|
|
|
client.end();
|
|
|
|
client.end();
|
|
|
|
clearTimeout(timeoutID);
|
|
|
|
clearTimeout(timeoutID);
|
|
|
|
if (message.toString() === okMessage) {
|
|
|
|
if (okMessage != null && okMessage !== "" && message.toString() !== okMessage) {
|
|
|
|
resolve(`Topic: ${messageTopic}; Message: ${message.toString()}`);
|
|
|
|
reject(new Error(`Message Mismatch - Topic: ${messageTopic}; Message: ${message.toString()}`));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
reject(new Error(`Error; Topic: ${messageTopic}; Message: ${message.toString()}`));
|
|
|
|
resolve(`Topic: ${messageTopic}; Message: ${message.toString()}`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|