mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-27 07:21:18 +01:00
Merge pull request #13691 from benpicco/tests/driver_netdev_common
tests/driver_netdev_common: add compile-test for network drivers
This commit is contained in:
commit
e7c1605119
@ -36,7 +36,7 @@ static dose_signal_t state_transit_blocked(dose_t *ctx, dose_signal_t signal);
|
||||
static dose_signal_t state_transit_idle(dose_t *ctx, dose_signal_t signal);
|
||||
static dose_signal_t state_transit_recv(dose_t *ctx, dose_signal_t signal);
|
||||
static dose_signal_t state_transit_send(dose_t *ctx, dose_signal_t signal);
|
||||
static void state(dose_t *ctx, uint8_t src);
|
||||
static void state(dose_t *ctx, dose_signal_t src);
|
||||
static void _isr_uart(void *arg, uint8_t c);
|
||||
static void _isr_gpio(void *arg);
|
||||
static void _isr_xtimer(void *arg);
|
||||
|
||||
@ -1,27 +1,6 @@
|
||||
BOARD ?= openmote-b
|
||||
include ../Makefile.tests_common
|
||||
|
||||
# Modules to include:
|
||||
USEMODULE += shell
|
||||
USEMODULE += shell_commands
|
||||
USEMODULE += ps
|
||||
|
||||
# the radio driver to test
|
||||
USEMODULE += at86rf215
|
||||
|
||||
# gnrc is a meta module including all required, basic gnrc networking modules
|
||||
USEMODULE += gnrc
|
||||
|
||||
# automatically initialize the network interface
|
||||
USEMODULE += auto_init_gnrc_netif
|
||||
|
||||
# shell command to send L2 packets with a simple string
|
||||
USEMODULE += gnrc_txtsnd
|
||||
|
||||
# the application dumps received packets to stdout
|
||||
USEMODULE += gnrc_pktdump
|
||||
|
||||
include $(RIOTBASE)/Makefile.include
|
||||
|
||||
# Set a custom channel if needed
|
||||
include $(RIOTMAKE)/default-radio-settings.inc.mk
|
||||
include ../driver_netdev_common/Makefile
|
||||
|
||||
@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 ML!PA Consulting GmbH
|
||||
*
|
||||
* 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 Test application for network device drivers
|
||||
*
|
||||
* @author Benjamin Valentin <benjamin.valentin@ml-pa.com>
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include "thread.h"
|
||||
#include "shell.h"
|
||||
#include "shell_commands.h"
|
||||
|
||||
#include "net/gnrc/pktdump.h"
|
||||
#include "net/gnrc.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
/* enable pktdump output */
|
||||
gnrc_netreg_entry_t dump = GNRC_NETREG_ENTRY_INIT_PID(GNRC_NETREG_DEMUX_CTX_ALL,
|
||||
gnrc_pktdump_pid);
|
||||
gnrc_netreg_register(GNRC_NETTYPE_UNDEF, &dump);
|
||||
|
||||
/* start the shell */
|
||||
char line_buf[SHELL_DEFAULT_BUFSIZE];
|
||||
shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
1
tests/driver_at86rf215/main.c
Symbolic link
1
tests/driver_at86rf215/main.c
Symbolic link
@ -0,0 +1 @@
|
||||
../driver_netdev_common/main.c
|
||||
4
tests/driver_dose/Makefile
Normal file
4
tests/driver_dose/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
# the driver to test
|
||||
USEMODULE = dose
|
||||
|
||||
include ../driver_netdev_common/Makefile
|
||||
21
tests/driver_dose/Makefile.ci
Normal file
21
tests/driver_dose/Makefile.ci
Normal file
@ -0,0 +1,21 @@
|
||||
BOARD_INSUFFICIENT_MEMORY := \
|
||||
arduino-duemilanove \
|
||||
arduino-leonardo \
|
||||
arduino-mega2560 \
|
||||
arduino-uno \
|
||||
atmega328p \
|
||||
i-nucleo-lrwan1 \
|
||||
msb-430 \
|
||||
msb-430h \
|
||||
nucleo-f030r8 \
|
||||
nucleo-f031k6 \
|
||||
nucleo-f042k6 \
|
||||
nucleo-f303k8 \
|
||||
nucleo-f334r8 \
|
||||
nucleo-l031k6 \
|
||||
nucleo-l053r8 \
|
||||
stm32f030f4-demo \
|
||||
stm32f0discovery \
|
||||
stm32l0538-disco \
|
||||
waspmote-pro \
|
||||
#
|
||||
1
tests/driver_dose/main.c
Symbolic link
1
tests/driver_dose/main.c
Symbolic link
@ -0,0 +1 @@
|
||||
../driver_netdev_common/main.c
|
||||
4
tests/driver_mrf24j40/Makefile
Normal file
4
tests/driver_mrf24j40/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
# the radio driver to test
|
||||
USEMODULE = mrf24j40md
|
||||
|
||||
include ../driver_netdev_common/Makefile
|
||||
16
tests/driver_mrf24j40/Makefile.ci
Normal file
16
tests/driver_mrf24j40/Makefile.ci
Normal file
@ -0,0 +1,16 @@
|
||||
BOARD_INSUFFICIENT_MEMORY := \
|
||||
arduino-duemilanove \
|
||||
arduino-leonardo \
|
||||
arduino-mega2560 \
|
||||
arduino-uno \
|
||||
atmega328p \
|
||||
i-nucleo-lrwan1 \
|
||||
nucleo-f031k6 \
|
||||
nucleo-f042k6 \
|
||||
nucleo-l031k6 \
|
||||
nucleo-l053r8 \
|
||||
stm32f030f4-demo \
|
||||
stm32f0discovery \
|
||||
stm32l0538-disco \
|
||||
waspmote-pro \
|
||||
#
|
||||
1
tests/driver_mrf24j40/main.c
Symbolic link
1
tests/driver_mrf24j40/main.c
Symbolic link
@ -0,0 +1 @@
|
||||
../driver_netdev_common/main.c
|
||||
28
tests/driver_netdev_common/Makefile
Normal file
28
tests/driver_netdev_common/Makefile
Normal file
@ -0,0 +1,28 @@
|
||||
include ../Makefile.tests_common
|
||||
|
||||
# Modules to include:
|
||||
USEMODULE += shell
|
||||
USEMODULE += shell_commands
|
||||
USEMODULE += ps
|
||||
|
||||
# allow to use a smaller packet buffer in low-PDU drivers
|
||||
ifdef GNRC_PKTBUF_SIZE
|
||||
CFLAGS += -DGNRC_PKTBUF_SIZE=$(GNRC_PKTBUF_SIZE)
|
||||
endif
|
||||
|
||||
# gnrc is a meta module including all required, basic gnrc networking modules
|
||||
USEMODULE += gnrc
|
||||
|
||||
# automatically initialize the network interface
|
||||
USEMODULE += auto_init_gnrc_netif
|
||||
|
||||
# shell command to send L2 packets with a simple string
|
||||
USEMODULE += gnrc_txtsnd
|
||||
|
||||
# the application dumps received packets to stdout
|
||||
USEMODULE += gnrc_pktdump
|
||||
|
||||
include $(RIOTBASE)/Makefile.include
|
||||
|
||||
# Set a custom channel if needed
|
||||
include $(RIOTMAKE)/default-radio-settings.inc.mk
|
||||
17
tests/driver_netdev_common/Makefile.ci
Normal file
17
tests/driver_netdev_common/Makefile.ci
Normal file
@ -0,0 +1,17 @@
|
||||
BOARD_INSUFFICIENT_MEMORY := \
|
||||
arduino-duemilanove \
|
||||
arduino-leonardo \
|
||||
arduino-mega2560 \
|
||||
arduino-uno \
|
||||
atmega328p \
|
||||
i-nucleo-lrwan1 \
|
||||
nucleo-f030r8 \
|
||||
nucleo-f031k6 \
|
||||
nucleo-f042k6 \
|
||||
nucleo-l031k6 \
|
||||
nucleo-l053r8 \
|
||||
stm32f030f4-demo \
|
||||
stm32f0discovery \
|
||||
stm32l0538-disco \
|
||||
waspmote-pro \
|
||||
#
|
||||
39
tests/driver_netdev_common/main.c
Normal file
39
tests/driver_netdev_common/main.c
Normal file
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (C) 2020 ML!PA Consulting GmbH
|
||||
*
|
||||
* 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 Test application for network device drivers
|
||||
*
|
||||
* @author Benjamin Valentin <benjamin.valentin@ml-pa.com>
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include "thread.h"
|
||||
#include "shell.h"
|
||||
#include "shell_commands.h"
|
||||
|
||||
#include "net/gnrc/pktdump.h"
|
||||
#include "net/gnrc.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
/* enable pktdump output */
|
||||
gnrc_netreg_entry_t dump = GNRC_NETREG_ENTRY_INIT_PID(GNRC_NETREG_DEMUX_CTX_ALL,
|
||||
gnrc_pktdump_pid);
|
||||
gnrc_netreg_register(GNRC_NETTYPE_UNDEF, &dump);
|
||||
|
||||
/* start the shell */
|
||||
char line_buf[SHELL_DEFAULT_BUFSIZE];
|
||||
shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
4
tests/driver_w5100/Makefile
Normal file
4
tests/driver_w5100/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
# the driver to test
|
||||
USEMODULE = w5100
|
||||
|
||||
include ../driver_netdev_common/Makefile
|
||||
21
tests/driver_w5100/Makefile.ci
Normal file
21
tests/driver_w5100/Makefile.ci
Normal file
@ -0,0 +1,21 @@
|
||||
BOARD_INSUFFICIENT_MEMORY := \
|
||||
arduino-duemilanove \
|
||||
arduino-leonardo \
|
||||
arduino-mega2560 \
|
||||
arduino-uno \
|
||||
atmega328p \
|
||||
i-nucleo-lrwan1 \
|
||||
msb-430 \
|
||||
msb-430h \
|
||||
nucleo-f030r8 \
|
||||
nucleo-f031k6 \
|
||||
nucleo-f042k6 \
|
||||
nucleo-f303k8 \
|
||||
nucleo-f334r8 \
|
||||
nucleo-l031k6 \
|
||||
nucleo-l053r8 \
|
||||
stm32f030f4-demo \
|
||||
stm32f0discovery \
|
||||
stm32l0538-disco \
|
||||
waspmote-pro \
|
||||
#
|
||||
1
tests/driver_w5100/main.c
Symbolic link
1
tests/driver_w5100/main.c
Symbolic link
@ -0,0 +1 @@
|
||||
../driver_netdev_common/main.c
|
||||
@ -1,18 +1,6 @@
|
||||
include ../Makefile.tests_common
|
||||
|
||||
USEMODULE += xbee
|
||||
USEMODULE += gnrc_txtsnd
|
||||
USEMODULE += auto_init_gnrc_netif
|
||||
USEMODULE += gnrc_pktdump
|
||||
USEMODULE += shell
|
||||
USEMODULE += shell_commands
|
||||
|
||||
# No need of big buffer for this test
|
||||
CFLAGS += -DGNRC_PKTBUF_SIZE=512
|
||||
GNRC_PKTBUF_SIZE=512
|
||||
|
||||
# add current directory to the include path. Putting it in CFLAGS will make
|
||||
# it go to the beginning, before the standard includes.
|
||||
# That way xbee_params.h get's included and auto configuration can pick it up.
|
||||
CFLAGS += -I$(CURDIR)
|
||||
|
||||
include $(RIOTBASE)/Makefile.include
|
||||
include ../driver_netdev_common/Makefile
|
||||
|
||||
@ -1,52 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2015 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 Test application for Xbee S1 network device driver
|
||||
*
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "shell.h"
|
||||
#include "shell_commands.h"
|
||||
#include "net/gnrc.h"
|
||||
#include "net/gnrc/pktdump.h"
|
||||
|
||||
/**
|
||||
* @brief Maybe you are a golfer?!
|
||||
*/
|
||||
int main(void)
|
||||
{
|
||||
gnrc_netreg_entry_t dump = GNRC_NETREG_ENTRY_INIT_PID(GNRC_NETREG_DEMUX_CTX_ALL,
|
||||
gnrc_pktdump_pid);
|
||||
|
||||
puts("Xbee S1 device driver test");
|
||||
|
||||
/* initialize and register pktdump */
|
||||
if (gnrc_pktdump_pid <= KERNEL_PID_UNDEF) {
|
||||
puts("Error starting pktdump thread");
|
||||
return -1;
|
||||
}
|
||||
gnrc_netreg_register(GNRC_NETTYPE_UNDEF, &dump);
|
||||
|
||||
/* start the shell */
|
||||
puts("Initialization OK, starting shell now");
|
||||
|
||||
char line_buf[SHELL_DEFAULT_BUFSIZE];
|
||||
shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
1
tests/driver_xbee/main.c
Symbolic link
1
tests/driver_xbee/main.c
Symbolic link
@ -0,0 +1 @@
|
||||
../driver_netdev_common/main.c
|
||||
Loading…
x
Reference in New Issue
Block a user