From 955869d4e8eeec5bd954ecd112e3db1b074fd17a Mon Sep 17 00:00:00 2001 From: anlicheng Date: Wed, 26 Jul 2023 10:29:34 +0800 Subject: [PATCH] fix --- apps/iot/src/iot_host.erl | 2 +- apps/iot/src/mnesia/mnesia_kv.erl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/iot/src/iot_host.erl b/apps/iot/src/iot_host.erl index 204ca3f..53ab857 100644 --- a/apps/iot/src/iot_host.erl +++ b/apps/iot/src/iot_host.erl @@ -246,7 +246,7 @@ handle_event(cast, {handle, {data, Data}}, session, State = #state{uuid = UUID, Info = #{<<"service_name">> := ServiceName, <<"at">> := Timestamp, <<"fields">> := FieldsList, <<"tags">> := Tags} when is_binary(ServiceName) -> %% 查找终端设备对应的点位信息 RouterUUID = router_uuid(Info, UUID), - lager:debug("[iot_host] host: ~p, router_uuid: ~p, get data: ~p", [UUID, RouterUUID, Data]), + lager:debug("[iot_host] host: ~p, router_uuid: ~p, get data: ~p", [UUID, RouterUUID, Info]), case mnesia_kv:hget(RouterUUID, <<"location_code">>) of none -> lager:debug("[iot_host] the north_data hget location_code uuid: ~p, router_uuid: ~p, not found", [UUID, RouterUUID]); diff --git a/apps/iot/src/mnesia/mnesia_kv.erl b/apps/iot/src/mnesia/mnesia_kv.erl index 0a8a819..a30f94a 100644 --- a/apps/iot/src/mnesia/mnesia_kv.erl +++ b/apps/iot/src/mnesia/mnesia_kv.erl @@ -298,7 +298,7 @@ hget(Key, Field) when is_binary(Key), is_binary(Field) -> [] -> none; [#kv{val = #{Field := Val}, type = hash}] -> - Val; + {ok, Val}; _ -> {error, ?WRONG_KIND} end.