Browse Source

feat(mqttServiceForDevice): modify message receiving topic and trigger ACQUISITION_STARTED when context.message is 1

sw 7 hours ago
parent
commit
e918c64f66
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/domain/mqttServiceForDevice.ts

+ 3 - 2
src/domain/mqttServiceForDevice.ts

@@ -32,7 +32,8 @@ interface MqttMessage {
   PUBLISH: string;
 }
 
-const MQTT_TOPIC = 'CCOS/DEVICE/Generator/Notify/GENERATORSYNCSTATE';
+// const MQTT_TOPIC = 'CCOS/DEVICE/Generator/Notify/GENERATORSYNCSTATE';
+const MQTT_TOPIC = 'CCOS/DEVICE/Detector/Notify/XrayON';
 
 const options = {
   clean: true,
@@ -45,7 +46,7 @@ let mqttClient;
 
 const handleMqttMessage = (message: MqttMessage) => {
   console.log(`[mqttServiceForDevice] 收到message.CONTEXT ${message.CONTEXT}`);
-  if (message.CONTEXT === '3') {
+  if (message.CONTEXT === '1') {
     emitter.emit('ACQUISITION_STARTED');
   }
 };