diff --git a/apps/iot/src/iot_host.erl b/apps/iot/src/iot_host.erl index a519935..5cb0581 100644 --- a/apps/iot/src/iot_host.erl +++ b/apps/iot/src/iot_host.erl @@ -135,6 +135,8 @@ start_link(Name, UUID) when is_atom(Name), is_binary(UUID) -> %% gen_statem:start_link/[3,4], this function is called by the new %% process to initialize. init([UUID]) -> + erlang:process_flag(trap_exit, true), + %% 重启时,认为主机是离线状态; 等待主机主动建立连接 {ok, _} = host_bo:change_status(UUID, ?HOST_OFFLINE),