diff --git a/apps/dgiot_bamis/src/dgiot_bamis.erl b/apps/dgiot_bamis/src/dgiot_bamis.erl index f1b0d5de..e8ee4a96 100644 --- a/apps/dgiot_bamis/src/dgiot_bamis.erl +++ b/apps/dgiot_bamis/src/dgiot_bamis.erl @@ -229,15 +229,13 @@ format_multilayer(Object) -> NewV = format_value(V), Acc#{K => NewV} end; - (K, V, Acc) when is_binary(V) -> - case size(V) of + (K, V, Acc) -> + case size(dgiot_utils:to_binary(V)) of 0 -> Acc; _ -> Acc#{K => V} - end; - (_, _, Acc) -> - Acc + end end, #{}, MapWhere). diff --git a/apps/dgiot_factory/src/dgiot_factory_channel.erl b/apps/dgiot_factory/src/dgiot_factory_channel.erl index f3eebd9f..b357dcaf 100644 --- a/apps/dgiot_factory/src/dgiot_factory_channel.erl +++ b/apps/dgiot_factory/src/dgiot_factory_channel.erl @@ -31,6 +31,7 @@ %% Channel callback -export([init/3, handle_init/1, handle_event/3, handle_message/2, stop/3]). -export([get_id/2, after_handle/4, handle_data/7, get_card_data/2]). +-export([get_sub_product/1]). %% 注册通道类型 -channel_type(#{