net: samples: Fix timeout passed to k_sleep()
Use the appropriate K_SECONDS() macro to pass a timeout to k_sleep(). Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
31ad7b455b
commit
a03a54f00c
3 changed files with 6 additions and 6 deletions
|
@ -201,7 +201,7 @@ static int wait_for_input(int timeout)
|
|||
return res;
|
||||
}
|
||||
|
||||
#define ALIVE_TIME (MSEC_PER_SEC * 60U)
|
||||
#define ALIVE_TIME K_SECONDS(60)
|
||||
|
||||
static struct mqtt_utf8 password = {
|
||||
.utf8 = token
|
||||
|
|
|
@ -342,7 +342,7 @@ static void publish_message(void)
|
|||
|
||||
end:
|
||||
k_delayed_work_submit(&pub_message,
|
||||
MSEC_PER_SEC * timeout_for_publish());
|
||||
K_SECONDS(timeout_for_publish()));
|
||||
k_sem_take(&publish_msg, K_FOREVER);
|
||||
}
|
||||
}
|
||||
|
@ -470,7 +470,7 @@ static void check_network_connection(struct k_work *work)
|
|||
LOG_INF("waiting for DHCP to acquire addr");
|
||||
|
||||
end:
|
||||
k_delayed_work_submit(&check_network_conn, 3 * MSEC_PER_SEC);
|
||||
k_delayed_work_submit(&check_network_conn, K_SECONDS(3));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -493,7 +493,7 @@ static void l4_event_handler(struct net_mgmt_event_callback *cb,
|
|||
|
||||
if (mgmt_event == NET_EVENT_L4_CONNECTED) {
|
||||
/* Wait for DHCP to be back in BOUND state */
|
||||
k_delayed_work_submit(&check_network_conn, 3 * MSEC_PER_SEC);
|
||||
k_delayed_work_submit(&check_network_conn, K_SECONDS(3));
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -995,7 +995,7 @@ static void update_counter(struct k_work *work)
|
|||
coap_resource_notify(resource_to_notify);
|
||||
}
|
||||
|
||||
k_delayed_work_submit(&observer_work, MSEC_PER_SEC * 5U);
|
||||
k_delayed_work_submit(&observer_work, K_SECONDS(5));
|
||||
}
|
||||
|
||||
static int create_pending_request(struct coap_packet *response,
|
||||
|
@ -1099,7 +1099,7 @@ static int send_notification_packet(const struct sockaddr *addr,
|
|||
}
|
||||
}
|
||||
|
||||
k_delayed_work_submit(&observer_work, MSEC_PER_SEC * 5U);
|
||||
k_delayed_work_submit(&observer_work, K_SECONDS(5));
|
||||
|
||||
r = send_coap_reply(&response, addr, addr_len);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue