This commit is contained in:
anlicheng 2023-08-17 16:29:00 +08:00
parent 85214a89c9
commit 8deb048b67

View File

@ -386,8 +386,9 @@ handle_event(cast, {handle, {feedback_result, Info0}}, ?STATE_SESSION, State = #
end,
{keep_state, State};
handle_event(cast, {handle, {event, Event0}}, ?STATE_SESSION, State = #state{aes = AES}) ->
handle_event(cast, {handle, {event, Event0}}, ?STATE_SESSION, State = #state{uuid = UUID, aes = AES}) ->
EventText = iot_cipher_aes:decrypt(AES, Event0),
lager:debug("[iot_host] uuid: ~p, get event: ~p", [UUID, EventText]),
case catch jiffy:decode(EventText, [return_maps]) of
#{<<"event_type">> := ?EVENT_DEVICE, <<"params">> := #{<<"device_uuid">> := DeviceUUID, <<"status">> := Status}} ->
DevicePid = iot_device:get_pid(DeviceUUID),