From 98501ad6c5a478df0b33b54160e25f1ab155acd4 Mon Sep 17 00:00:00 2001 From: anlicheng Date: Thu, 15 Jun 2023 17:54:00 +0800 Subject: [PATCH] fix --- apps/iot/src/mocker/host_mocker.erl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/iot/src/mocker/host_mocker.erl b/apps/iot/src/mocker/host_mocker.erl index b09f42a..2e6ab90 100644 --- a/apps/iot/src/mocker/host_mocker.erl +++ b/apps/iot/src/mocker/host_mocker.erl @@ -13,7 +13,7 @@ %% API -export([start_link/1, stop/0]). --export([test/0]). +-export([test/0, ping/0]). %% gen_server callbacks -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). @@ -74,6 +74,10 @@ test() -> stop() -> gen_server:stop(?MODULE). +ping() -> + Pid = whereis(?MODULE), + erlang:start_timer(0, Pid, ping_ticker). + %% @doc Spawns the server and registers the local name (unique) -spec(start_link(UUID :: binary()) -> {ok, Pid :: pid()} | ignore | {error, Reason :: term()}).