Skip to content

Commit

Permalink
tests: add test application for SNTP
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed Mar 28, 2017
1 parent 48fa957 commit 3bcd9bb
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/sntp/Makefile
@@ -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 changes: 6 additions & 0 deletions tests/sntp/README.md
@@ -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 changes: 31 additions & 0 deletions tests/sntp/main.c
@@ -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;
}

0 comments on commit 3bcd9bb

Please sign in to comment.