The friendly Operating System for the Internet of Things

Definitions for the GNRC communication interface test framework. More...

Detailed Description

#include <stdint.h>
#include <stdlib.h>
#include "kernel_types.h"
#include "net/gnrc/netapi.h"
#include "net/netopt.h"
#include "net/gnrc/nettype.h"
#include "net/gnrc/pkt.h"
#include "thread.h"
+ Include dependency graph for nettest.h:

Go to the source code of this file.

Data Structures

struct  gnrc_nettest_opt_cbs_t
 Option callback list element. More...
 

Macros

#define GNRC_NETTEST_TIMEOUT   (1000)
 Timeout for tests in microseconds.
 
#define GNRC_NETTEST_STACK_SIZE   (THREAD_STACKSIZE_DEFAULT)
 Default stack size to use for the nettest thread.
 
#define GNRC_NETTEST_PRIO   (THREAD_PRIORITY_MAIN)
 Default priority for the nettest thread.
 
#define GNRC_NETTEST_MSG_QUEUE_SIZE   (8U)
 Default message queue size to use for the nettest thread.
 

Typedefs

typedef int(* gnrc_nettest_opt_cb_t) (uint16_t context, void *data, uint16_t data_len)
 Type for get/set callbacks. More...
 

Enumerations

enum  gnrc_nettest_res_t {
  GNRC_NETTEST_SUCCESS = 0, GNRC_NETTEST_FAIL, GNRC_NETTEST_TIMED_OUT, GNRC_NETTEST_WRONG_MSG,
  GNRC_NETTEST_WRONG_SENDER
}
 Result type for tests. More...
 

Functions

void gnrc_nettest_register_get (netopt_t opt, gnrc_nettest_opt_cb_t cb)
 Registers a getter for an option. More...
 
void gnrc_nettest_register_set (netopt_t opt, gnrc_nettest_opt_cb_t cb)
 Registers a setter for an option. More...
 
gnrc_nettest_res_t gnrc_nettest_send (kernel_pid_t pid, gnrc_pktsnip_t *in, unsigned int exp_pkts, const kernel_pid_t *exp_senders, const gnrc_pktsnip_t **exp_out, gnrc_nettype_t exp_type, uint32_t exp_demux_ctx)
 Test GNRC_NETAPI_MSG_TYPE_SND command to pid. More...
 
gnrc_nettest_res_t gnrc_nettest_send_iface (kernel_pid_t pid, gnrc_pktsnip_t *in, unsigned int exp_pkts, const kernel_pid_t *exp_senders, const gnrc_pktsnip_t **exp_out)
 Test GNRC_NETAPI_MSG_TYPE_SND command to pid with the receiving thread being an interface. More...
 
gnrc_nettest_res_t gnrc_nettest_receive (kernel_pid_t pid, gnrc_pktsnip_t *in, unsigned int exp_pkts, const kernel_pid_t *exp_senders, const gnrc_pktsnip_t **exp_out, gnrc_nettype_t exp_type, uint32_t exp_demux_ctx)
 Test GNRC_NETAPI_MSG_TYPE_RCV command to pid. More...
 
gnrc_nettest_res_t gnrc_nettest_get (kernel_pid_t pid, netopt_t opt, uint16_t context, void *data, size_t data_len, void *exp_data, int exp_res)
 Test GNRC_NETAPI_MSG_TYPE_GET command to pid. More...
 
gnrc_nettest_res_t gnrc_nettest_set (kernel_pid_t pid, netopt_t opt, uint16_t context, void *data, size_t data_len, int exp_res)
 Test GNRC_NETAPI_MSG_TYPE_SET command to pid. More...
 
int gnrc_nettest_init (void)
 Initializes the NETAPI test framework module. More...
 
void gnrc_nettest_reset (void)
 Resets gnrc_nettest_opt_cbs_t list.