From b95f4d3f26af9ae5dd081c1e709c2350779b0c2a Mon Sep 17 00:00:00 2001 From: HuangXin Date: Wed, 16 Jan 2019 16:45:51 +0800 Subject: [PATCH] When register device server failured, Retry registerd --- src/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index b7297fc..a8b91c5 100644 --- a/src/main.c +++ b/src/main.c @@ -82,10 +82,14 @@ int main(int argc, char* argv[]) //mqtt_init(); enice_config_init(); + + rc = 0; - if(!hal_is_device_registed()) + while(!hal_is_device_registed()) { + LOG_EX(LOG_Debug, "Try Register Device %d times\n", rc++); device_register(); + sleep(5); } mqtt_proxy_setup();