PX4 Firmware
PX4 Autopilot Software http://px4.io
reflect.c File Reference

simple data reflector for load testing terminals (especially USB) More...

#include <px4_platform_common/px4_config.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <assert.h>
#include <systemlib/err.h>
Include dependency graph for reflect.c:

Go to the source code of this file.

Classes

struct  block
 

Macros

#define MAX_BLOCKS   1000
 
#define VALUE(i)   ((i*7) ^ 0xDEADBEEF)
 

Functions

__EXPORT int reflect_main (int argc, char *argv[])
 
static void allocate_blocks (void)
 
static void check_blocks (void)
 

Variables

static uint32_t nblocks
 
static struct blockblocks [MAX_BLOCKS]
 

Detailed Description

simple data reflector for load testing terminals (especially USB)

Author
Andrew Tridgell

Definition in file reflect.c.

Macro Definition Documentation

◆ MAX_BLOCKS

#define MAX_BLOCKS   1000

Definition at line 54 of file reflect.c.

Referenced by allocate_blocks().

◆ VALUE

#define VALUE (   i)    ((i*7) ^ 0xDEADBEEF)

Definition at line 61 of file reflect.c.

Function Documentation

◆ allocate_blocks()

static void allocate_blocks ( void  )
static

Definition at line 63 of file reflect.c.

References MAX_BLOCKS, nblocks, block::v, and VALUE.

Referenced by reflect_main().

Here is the caller graph for this function:

◆ check_blocks()

static void check_blocks ( void  )
static

Definition at line 82 of file reflect.c.

References nblocks, block::v, and VALUE.

Referenced by reflect_main().

Here is the caller graph for this function:

◆ reflect_main()

int reflect_main ( int  argc,
char *  argv[] 
)

Definition at line 92 of file reflect.c.

References allocate_blocks(), check_blocks(), OK, read(), and write().

Here is the call graph for this function:

Variable Documentation

◆ blocks

struct block* blocks[MAX_BLOCKS]
static

Definition at line 59 of file reflect.c.

◆ nblocks

uint32_t nblocks
static