-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17838 from MrKevinWeiss/pr/tests/154_drivers_rework
tests: rework ieee802154 drivers
- Loading branch information
Showing
65 changed files
with
1,655 additions
and
842 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
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
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 |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
#define CC2420_PARAMS_H | ||
|
||
#include "board.h" | ||
#include "cc2420.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
|
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
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
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
SUBMODULES := 1 | ||
|
||
SRC := kw2xrf.c kw2xrf_getset.c kw2xrf_intern.c kw2xrf_netdev.c kw2xrf_spi.c | ||
|
||
include $(RIOTBASE)/Makefile.base |
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 |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
#define KW2XRF_PARAMS_H | ||
|
||
#include "board.h" | ||
#include "kw2xrf.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
|
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
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
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
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
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
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 |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
#define MRF24J40_PARAMS_H | ||
|
||
#include "board.h" | ||
#include "mrf24j40.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
|
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
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
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,116 @@ | ||
/* | ||
* Copyright (C) 2022 HAW Hamburg | ||
* | ||
* 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. | ||
*/ | ||
|
||
/** | ||
* @defgroup test_utils_netdev_ieee802154_minimal Minimal netdev IEEE 802.15.4 device processing | ||
* @ingroup sys | ||
* | ||
* @{ | ||
* @file | ||
* @brief Provides basic functionalities to interact with an | ||
* IEEE 802.15.4 networking device which implements the | ||
* @ref drivers_netdev_api. | ||
* | ||
* To use the functionalities, include the module | ||
* `USEMODULE += test_utils_netdev_ieee802154_minimal`. | ||
* The test application should provide: | ||
* - device initialization, via the implementation of @ref netdev_ieee802154_minimal_init_devs | ||
* - number of devices to test, via the definition of @ref NETDEV_IEEE802154_MINIMAL_NUMOF | ||
* in `init_dev.h` | ||
* | ||
* @author Kevin Weiss <kevin.weiss@haw-hamburg.de> | ||
*/ | ||
|
||
#ifndef TEST_UTILS_NETDEV_IEEE802154_MINIMAL_H | ||
#define TEST_UTILS_NETDEV_IEEE802154_MINIMAL_H | ||
|
||
#include "net/netdev.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#ifdef DOXYGEN | ||
/** | ||
* @brief Maximum number of devices to handle. | ||
* @note Should be provided by the application via `init_dev.h`. | ||
*/ | ||
#define NETDEV_IEEE802154_MINIMAL_NUMOF | ||
#endif | ||
|
||
/** | ||
* @brief Device-under-test initialization function. | ||
* @note Should be implemented by the test application | ||
* | ||
* @param[in] cb Callback to be set to @ref netdev::event_callback | ||
* | ||
* @retval 0 on success | ||
* @retval != 0 on error | ||
*/ | ||
int netdev_ieee802154_minimal_init_devs(netdev_event_cb_t cb); | ||
|
||
/** | ||
* @brief Initialize the module. | ||
* | ||
* @retval 0 on success | ||
* @retval != 0 on error | ||
*/ | ||
int netdev_ieee802154_minimal_init(void); | ||
|
||
/** | ||
* @brief Send a IEEE 802.15.4 frame | ||
* This is wrapper for the internal netdev send function, that ensures | ||
* all netdev functions are called from the same thread. It is safe | ||
* to call this function from anywhere. | ||
* | ||
* @param[in] dev Pointer to the netdev descriptor. | ||
* @param[in] pkt Packet to be sent. | ||
* | ||
* @retval 0 on success | ||
* @retval != 0 on error | ||
*/ | ||
int netdev_ieee802154_minimal_send(struct netdev *dev, iolist_t *pkt); | ||
|
||
/** | ||
* @brief Get an option from netdev minimal. | ||
* This is wrapper for the internal netdev get function, that ensures | ||
* all netdev functions are called from the same thread. It is safe | ||
* to call this function from anywhere. | ||
* | ||
* @param[in] dev Pointer to the netdev descriptor. | ||
* @param[in] opt The netopt option | ||
* @param[out] data Buffer to store the option | ||
* @param[in] max_len Maximum length of the buffer | ||
* | ||
* @retval 0 on success | ||
* @retval != 0 on error | ||
*/ | ||
int netdev_ieee802154_minimal_get(struct netdev *dev, netopt_t opt, void *data, size_t max_len); | ||
|
||
/** | ||
* @brief Set an option to netdev minimal. | ||
* This is wrapper for the internal netdev set function, that ensures | ||
* all netdev functions are called from the same thread. It is safe | ||
* to call this function from anywhere. | ||
* | ||
* @param[in] dev Pointer to the netdev descriptor. | ||
* @param[in] opt The netopt option | ||
* @param[in] data Pointer to the data to be set | ||
* @param[in] len Length of the data | ||
* | ||
* @retval 0 on success | ||
* @retval != 0 on error | ||
*/ | ||
int netdev_ieee802154_minimal_set(struct netdev *dev, netopt_t opt, void *data, size_t len); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* TEST_UTILS_NETDEV_IEEE802154_MINIMAL_H */ | ||
/** @} */ |
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
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
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,3 @@ | ||
MODULE = test_utils_netdev_ieee802154_minimal | ||
|
||
include $(RIOTBASE)/Makefile.base |
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,7 @@ | ||
USEMODULE += event | ||
USEMODULE += event_thread | ||
USEMODULE += l2util | ||
USEMODULE += od | ||
USEMODULE += od_string | ||
USEMODULE += shell | ||
USEMODULE += netdev |
Oops, something went wrong.