fix
This commit is contained in:
parent
254e015707
commit
955869d4e8
@ -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) ->
|
Info = #{<<"service_name">> := ServiceName, <<"at">> := Timestamp, <<"fields">> := FieldsList, <<"tags">> := Tags} when is_binary(ServiceName) ->
|
||||||
%% 查找终端设备对应的点位信息
|
%% 查找终端设备对应的点位信息
|
||||||
RouterUUID = router_uuid(Info, UUID),
|
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
|
case mnesia_kv:hget(RouterUUID, <<"location_code">>) of
|
||||||
none ->
|
none ->
|
||||||
lager:debug("[iot_host] the north_data hget location_code uuid: ~p, router_uuid: ~p, not found", [UUID, RouterUUID]);
|
lager:debug("[iot_host] the north_data hget location_code uuid: ~p, router_uuid: ~p, not found", [UUID, RouterUUID]);
|
||||||
|
|||||||
@ -298,7 +298,7 @@ hget(Key, Field) when is_binary(Key), is_binary(Field) ->
|
|||||||
[] ->
|
[] ->
|
||||||
none;
|
none;
|
||||||
[#kv{val = #{Field := Val}, type = hash}] ->
|
[#kv{val = #{Field := Val}, type = hash}] ->
|
||||||
Val;
|
{ok, Val};
|
||||||
_ ->
|
_ ->
|
||||||
{error, ?WRONG_KIND}
|
{error, ?WRONG_KIND}
|
||||||
end.
|
end.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user