fix: modbus_rtu format_value

This commit is contained in:
AvantLiu 2022-02-17 16:32:54 +08:00
parent 38e189d9f9
commit 3b063d34c8
2 changed files with 3 additions and 1 deletions

View File

@ -553,7 +553,7 @@ format_value(Buff, #{<<"dataForm">> := #{
}}) ->
IntLen = dgiot_utils:to_int(Len),
Size = max(2, IntLen) * 8,
<<Value:Size, Rest/binary>> = Buff,
<<Value:Size/binary, Rest/binary>> = Buff,
{Value, Rest};
format_value(Buff, #{<<"dataForm">> := #{

View File

@ -128,6 +128,7 @@ stop(#{
dgiot_cron:save(default_task, #{
<<"id">> => <<"task/", Channel/binary, "/", DtuId/binary>>,
<<"count">> => 0}),
del_pnque(DtuId),
dgiot_task_worker:stop(#{<<"channel">> => Channel, <<"dtuid">> => DtuId})
end, Page)
end,
@ -153,6 +154,7 @@ stop(#{
dgiot_cron:save(default_task, #{
<<"id">> => <<"task/", Channel/binary, "/", DtuId/binary>>,
<<"count">> => 0}),
del_pnque(DtuId),
dgiot_task_worker:stop(#{<<"channel">> => Channel, <<"dtuid">> => DtuId})
end, Page)
end,