This commit is contained in:
anlicheng 2023-08-10 16:02:36 +08:00
parent 0cc1e3e542
commit 0b43bd8c13

View File

@ -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),