From 5c325f3d8ae5b84e64c4b9e48a9d14e023b1580f Mon Sep 17 00:00:00 2001 From: anlicheng Date: Tue, 20 Jun 2023 21:40:43 +0800 Subject: [PATCH] fix --- apps/iot/src/iot_host.erl | 2 +- apps/iot/src/mocker/host_mocker.erl | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/iot/src/iot_host.erl b/apps/iot/src/iot_host.erl index f2e0d91..69b6b24 100644 --- a/apps/iot/src/iot_host.erl +++ b/apps/iot/src/iot_host.erl @@ -315,7 +315,7 @@ handle_event(cast, {handle, <>}, session, Info = iot_cipher_aes:decrypt(AES, Info0), case catch jiffy:decode(Info, [return_maps]) of Data = #{<<"task_id">> := TaskId, <<"code">> := Code} -> - Result = scene_feedback:insert(#{ + Result = scene_feedback_step:insert(#{ <<"task_id">> => TaskId, <<"code">> => Code, <<"created_at">> => iot_util:current_time() diff --git a/apps/iot/src/mocker/host_mocker.erl b/apps/iot/src/mocker/host_mocker.erl index a70b000..16d9378 100644 --- a/apps/iot/src/mocker/host_mocker.erl +++ b/apps/iot/src/mocker/host_mocker.erl @@ -77,7 +77,7 @@ stop() -> ping() -> Pid = whereis(?MODULE), - erlang:start_timer(0, Pid, ping_ticker). + erlang:start_timer(0, Pid, feedback_step_ticker). %% @doc Spawns the server and registers the local name (unique) -spec(start_link(UUID :: binary()) -> @@ -195,14 +195,14 @@ handle_info({publish, #{payload := Payload, qos := Qos, topic := FromTopic}}, %% t = 8采用明文消息 <<8:8, Command/binary>> -> case jiffy:decode(Command, [return_maps]) of - #{<<"auth">> := true, <<"reply">> := #{<<"topic">> := Topic, <<"assoc">> := Assoc}} -> + #{<<"auth">> := true, <<"reply">> := #{<<"topic">> := ReplyTopic, <<"assoc">> := Assoc}} -> Msg = jiffy:encode(#{ <<"code">> => 1, <<"message">> => "", <<"assoc">> => Assoc }, [force_utf8]), - {ok, Ref} = iot_mqtt_publisher:publish(Topic, Msg, 1), + {ok, Ref} = iot_mqtt_publisher:publish(ReplyTopic, Msg, 1), receive {ok, Ref, PacketId} -> lager:debug("[host_mocker] send reply success, packet_id: ~p", [PacketId]);