fix host
This commit is contained in:
parent
373c0748cf
commit
760287e78a
@ -178,6 +178,12 @@ handle_event({call, From}, has_session, StateName, State) ->
|
|||||||
HasSession = (StateName =:= session) orelse false,
|
HasSession = (StateName =:= session) orelse false,
|
||||||
{keep_state, State, [{reply, From, HasSession}]};
|
{keep_state, State, [{reply, From, HasSession}]};
|
||||||
|
|
||||||
|
handle_event({call, From}, {make_assoc, ReceiverPid}, _, State = #state{uuid = UUID, increment_id = IncrementId, assoc_map = AssocMap}) ->
|
||||||
|
BinIncrementId = erlang:integer_to_binary(IncrementId),
|
||||||
|
Assoc = <<UUID/binary, ":assoc:", BinIncrementId/binary>>,
|
||||||
|
|
||||||
|
{keep_state, State#state{assoc_map = maps:put(Assoc, ReceiverPid, AssocMap), increment_id = IncrementId + 1}, [{reply, From, {ok, Assoc}}]};
|
||||||
|
|
||||||
%% 基于rsa加密
|
%% 基于rsa加密
|
||||||
handle_event({call, From}, {rsa_encode, CommandType, PlainText}, session, State = #state{pub_key = PubKey}) ->
|
handle_event({call, From}, {rsa_encode, CommandType, PlainText}, session, State = #state{pub_key = PubKey}) ->
|
||||||
Reply = iot_cipher_rsa:encode(PlainText, PubKey),
|
Reply = iot_cipher_rsa:encode(PlainText, PubKey),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user