1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/projects/test_ping/main.h

91 lines
2.1 KiB
C
Raw Normal View History

2012-12-09 18:02:06 +01:00
#ifndef PING_TEST_H
#define PING_TEST_H
2012-12-11 16:03:00 +01:00
#include <stdint.h>
#include <cc1100-interface.h>
2012-12-11 16:03:00 +01:00
/**
* Maximum and minimum radio address
*/
#define MIN_ADDR MIN_UID
#define MAX_ADDR MAX_UID
/**
* Maximum and minimum channel address
*/
#define MIN_CHAN MIN_CHANNR
#define MAX_CHAN MAX_CHANNR
2013-01-08 15:24:57 +01:00
/**
* Maximum and minimum duration times
* TODO change min duration to 0 once stopping works as intended
*/
#define MIN_DURATION 1
#define MAX_DURATION UINT16_MAX
/**
* Receive- and send-buffer size
*/
2012-12-11 16:03:00 +01:00
#define SND_BUFFER_SIZE (100)
#define RCV_BUFFER_SIZE (64)
2012-12-09 18:02:06 +01:00
/**
* @brief Shows a helping text.
* @param command the command name for which the help should be showed.
*/
void help(char * commandname);
/**
* @brief Initializes a node for radio communication
*
* Initializes this node with a given radio address and on a given channel or
* on a default channel, if no channel is given. A radio address must be given
* in any case.
*
* @param arg
*/
void init(char * arg);
2013-01-08 15:24:57 +01:00
/**
* @brief broadcasts for a specified duration
*
* Broadcasts a pingmessage from this node in a continuous manner until the
* duration (in seconds) is over or the stop command is used.
* If the duration is set to 0, it broadcasts endlessly until the stop command
* is used.
* @param arg
*/
void broadcast(char* arg);
/**
* @brief Returns the radio address of this device.
*
* @return The radio-address of the device. Undefined if radio-address has not
* been set properly before.
*/
uint16_t get_radio_address(void);
2012-12-11 16:03:00 +01:00
/**
* @brief Sets the radio address of this device. It is undefined what happens
* if radio-address is not in valid range.
*
* @param addr The radio-address to set.
*/
2012-12-11 16:03:00 +01:00
void set_radio_address(uint8_t addr);
/**
* @brief Sets the radio channel used for the pinging or broadcasting of nodes.
* It is undefined what happens if radio-address is not in valid range.
*
* @param chan The channel number to set.
*/
2012-12-11 16:03:00 +01:00
void set_radio_channel(uint8_t chan);
/**
* @brief The thread for the processing of received radio-packets.
*/
2012-12-11 16:03:00 +01:00
void radio(void);
2012-12-09 18:02:06 +01:00
#endif /* PING_TEST_H */