zephyr/samples/net/syslog_net/src/main.c
Jukka Rissanen a85d1e0e74 samples: net: syslog: Fix to use proper data type for sleep
Needed because of k_timeout_t conversion

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00

38 lines
664 B
C

/*
* Copyright (c) 2018 Intel Corporation.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <logging/log.h>
LOG_MODULE_REGISTER(net_syslog, LOG_LEVEL_DBG);
#include <zephyr.h>
#include <net/net_core.h>
#include <net/net_pkt.h>
#define SLEEP_BETWEEN_PRINTS 3
void main(void)
{
int count = 60 / SLEEP_BETWEEN_PRINTS;
/* Allow some setup time before starting to send data */
k_sleep(K_SECONDS(SLEEP_BETWEEN_PRINTS));
LOG_DBG("Starting");
do {
LOG_ERR("Error message");
LOG_WRN("Warning message");
LOG_INF("Info message");
LOG_DBG("Debug message");
k_sleep(K_SECONDS(SLEEP_BETWEEN_PRINTS));
} while (count--);
LOG_DBG("Stopping");
}