tests: add test application for SNTP
This commit is contained in:
parent
48fa957ab6
commit
3bcd9bb5c0
23
tests/sntp/Makefile
Normal file
23
tests/sntp/Makefile
Normal file
@ -0,0 +1,23 @@
|
||||
# name of your application
|
||||
APPLICATION = sntp
|
||||
include ../Makefile.tests_common
|
||||
|
||||
BOARD_INSUFFICIENT_MEMORY := chronos msb-430 msb-430h nucleo32-f031 \
|
||||
nucleo32-f042 nucleo32-l031 nucleo-f030 \
|
||||
nucleo-f334 nucleo-l053 stm32f0discovery \
|
||||
telosb weio z1
|
||||
|
||||
USEMODULE += sntp
|
||||
USEMODULE += gnrc_sock_udp
|
||||
USEMODULE += gnrc_ipv6_default
|
||||
USEMODULE += auto_init_gnrc_netif
|
||||
USEMODULE += gnrc_netdev_default
|
||||
USEMODULE += shell
|
||||
USEMODULE += shell_commands
|
||||
|
||||
# Comment this out to disable code in RIOT that does safety checking
|
||||
# which is not needed in a production environment but helps in the
|
||||
# development process:
|
||||
CFLAGS += -DDEVELHELP
|
||||
|
||||
include $(RIOTBASE)/Makefile.include
|
||||
6
tests/sntp/README.md
Normal file
6
tests/sntp/README.md
Normal file
@ -0,0 +1,6 @@
|
||||
About
|
||||
=====
|
||||
This test application allows you to type `ntpdate <server>` and get the current
|
||||
date + the offset in microseconds of the NTP timestamp (seconds from 1900-01-01)
|
||||
from the current `xtimer_now_usec64()` back utilizing SNTP. Make sure that
|
||||
`<server>` is reachable and has an NTP daemon installed.
|
||||
31
tests/sntp/main.c
Normal file
31
tests/sntp/main.c
Normal file
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (C) 2017 Freie Universität Berlin
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU Lesser
|
||||
* General Public License v2.1. See the file LICENSE in the top level
|
||||
* directory for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup tests
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Tests sntp module.
|
||||
*
|
||||
* @author Martine Lenders <m.lenders@fu-berlin.de>
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "shell.h"
|
||||
|
||||
static char line_buf[SHELL_DEFAULT_BUFSIZE];
|
||||
|
||||
int main(void)
|
||||
{
|
||||
shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE);
|
||||
return 0;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user