From f55859ae4bfd753f2662be6b7915de259b2788ad Mon Sep 17 00:00:00 2001 From: anlicheng Date: Tue, 20 Jun 2023 10:16:54 +0800 Subject: [PATCH] fix mqtt message --- apps/iot/src/iot_mqtt_publisher.erl | 2 +- apps/iot/src/iot_mqtt_subscriber.erl | 2 +- apps/iot/src/iot_mqtt_sys_subscriber.erl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/iot/src/iot_mqtt_publisher.erl b/apps/iot/src/iot_mqtt_publisher.erl index cacb7ad..b3cb8c8 100644 --- a/apps/iot/src/iot_mqtt_publisher.erl +++ b/apps/iot/src/iot_mqtt_publisher.erl @@ -93,7 +93,7 @@ handle_cast(_Request, State = #state{}) -> {noreply, NewState :: #state{}} | {noreply, NewState :: #state{}, timeout() | hibernate} | {stop, Reason :: term(), NewState :: #state{}}). -handle_info({disconnect, ReasonCode, Properties}, State = #state{}) -> +handle_info({disconnected, ReasonCode, Properties}, State = #state{}) -> lager:debug("[iot_mqtt_publisher] Recv a DISONNECT packet - ReasonCode: ~p, Properties: ~p", [ReasonCode, Properties]), {stop, disconnected, State}; handle_info({publish, Message = #{packet_id := _PacketId, payload := Payload}}, State = #state{conn_pid = _ConnPid}) -> diff --git a/apps/iot/src/iot_mqtt_subscriber.erl b/apps/iot/src/iot_mqtt_subscriber.erl index e2864bd..fe28ee7 100644 --- a/apps/iot/src/iot_mqtt_subscriber.erl +++ b/apps/iot/src/iot_mqtt_subscriber.erl @@ -98,7 +98,7 @@ handle_cast(_Request, State = #state{}) -> {noreply, NewState :: #state{}} | {noreply, NewState :: #state{}, timeout() | hibernate} | {stop, Reason :: term(), NewState :: #state{}}). -handle_info({disconnect, ReasonCode, Properties}, State = #state{}) -> +handle_info({disconnected, ReasonCode, Properties}, State = #state{}) -> lager:debug("[iot_mqtt_host_subscriber] Recv a DISONNECT packet - ReasonCode: ~p, Properties: ~p", [ReasonCode, Properties]), {stop, disconnected, State}; %% 必须要做到消息的快速分发,数据的json反序列需要在host进程进行 diff --git a/apps/iot/src/iot_mqtt_sys_subscriber.erl b/apps/iot/src/iot_mqtt_sys_subscriber.erl index f0e00c5..e0fe0cc 100644 --- a/apps/iot/src/iot_mqtt_sys_subscriber.erl +++ b/apps/iot/src/iot_mqtt_sys_subscriber.erl @@ -101,7 +101,7 @@ handle_cast(_Request, State = #state{}) -> {noreply, NewState :: #state{}} | {noreply, NewState :: #state{}, timeout() | hibernate} | {stop, Reason :: term(), NewState :: #state{}}). -handle_info({disconnect, ReasonCode, Properties}, State = #state{}) -> +handle_info({disconnected, ReasonCode, Properties}, State = #state{}) -> lager:debug("[iot_mqtt_sys_subscriber] Recv a DISONNECT packet - ReasonCode: ~p, Properties: ~p", [ReasonCode, Properties]), {stop, disconnected, State}; %% 必须要做到消息的快速分发,数据的json反序列需要在host进程进行