diff --git a/apps/iot/src/iot_host.erl b/apps/iot/src/iot_host.erl index 4a45341..5176087 100644 --- a/apps/iot/src/iot_host.erl +++ b/apps/iot/src/iot_host.erl @@ -217,13 +217,13 @@ handle_event({call, From}, {attach_channel, ChannelPid}, _, State = #state{uuid %% 授权通过后,才能将主机的状态设置为在线状态 handle_event({call, From}, {create_session, PubKey}, denied, State = #state{uuid = UUID}) -> - lager:debug("[iot_host] host_id uuid: ~p, create_session", [UUID]), + lager:debug("[iot_host] host_id(denied) uuid: ~p, create_session, will not change host status", [UUID]), Reply = #{<<"a">> => false, <<"aes">> => <<"">>}, EncReply = iot_cipher_rsa:encode(Reply, PubKey), {keep_state, State, [{reply, From, {ok, <<10:8, EncReply/binary>>}}]}; -handle_event({call, From}, {create_session, PubKey}, _StateName, State = #state{uuid = UUID, aes = Aes}) -> - lager:debug("[iot_host] host_id uuid: ~p, create_session", [UUID]), +handle_event({call, From}, {create_session, PubKey}, StateName, State = #state{uuid = UUID, aes = Aes}) -> + lager:debug("[iot_host] host_id(~p) uuid: ~p, create_session, will change status", [StateName, UUID]), Reply = #{<<"a">> => true, <<"aes">> => Aes}, EncReply = iot_cipher_rsa:encode(Reply, PubKey), {ok, _} = host_bo:change_status(UUID, ?HOST_STATUS_ONLINE),