Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: add test application for SNTP
- Loading branch information
Showing
3 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |