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

documentation for nativenet interface

This commit is contained in:
Ludwig Ortmann 2013-08-29 14:41:55 +02:00
parent 37c3059e1c
commit 74b1a74525
5 changed files with 149 additions and 0 deletions

View File

@ -1,3 +1,26 @@
/**
* nativenet transceiver interface
*
* A configurable transceiver for the native port.
*
* At the moment only the tap interface is supported, but more network
* layers are intended. So the "configurable" part is a lie for now ;-)
* The effect of calls like nativenet_set_channel depend on the
* network layer.
*
* Copyright (C) 2013 Ludwig Ortmann
*
* This file subject to the terms and conditions of the GNU Lesser General
* Public License. See the file LICENSE in the top level directory for more
* details.
*/
/**
* @defgroup native_net
* @{
* @author Ludwig Ortmann <ludwig.ortmann@fu-berlin.de>
*/
#ifndef NATIVENET_H
#define NATIVENET_H
@ -13,21 +36,81 @@
#warning be careful not to exceed (ETHER_MAX_LEN) with NATIVE_MAX_DATA_LENGTH
#endif /* NATIVE_MAX_DATA_LENGTH */
/**
* Initialize transceiver
*
* @param transceiver_pid the pid of the transceiver thread
*/
void nativenet_init(int transceiver_pid);
/**
* Shutdown transceiver
*/
void nativenet_powerdown();
/**
* Enable/disable monitor mode
*
* @param mode 0 off, 1 on
*/
void nativenet_set_monitor(uint8_t mode);
/**
* Send a packet
*
* @param packet a radio packet
* @return 1 on success, 0 otherwise
*/
uint8_t nativenet_send(radio_packet_t *packet);
/**
* Set transceiver address
*
* @param address the address
* @return the address
*/
radio_address_t nativenet_set_address(radio_address_t address);
/**
* Get transceiver address
*
* @return the address
*/
radio_address_t nativenet_get_address();
/**
* Set transceiver channel
*
* @param channel the channel
* @return the channel
*/
int16_t nativenet_set_channel(uint8_t channel);
/**
* Get transceiver channel
*
* @return the channel
*/
int16_t nativenet_get_channel();
/**
* Set transceiver pan
*
* @param channel the pan
* @return the pan
*/
uint16_t nativenet_set_pan(uint16_t pan);
/**
* Get transceiver pan
*
* @return the pan
*/
uint16_t nativenet_get_pan();
/**
* Enable transceiver rx mode
*/
void nativenet_switch_to_rx();
/** @} */
#endif /* NATIVENET_H */

View File

@ -1,3 +1,19 @@
/**
* internal nativenet transceiver interface
*
* Copyright (C) 2013 Ludwig Ortmann
*
* This file subject to the terms and conditions of the GNU Lesser General
* Public License. See the file LICENSE in the top level directory for more
* details.
*/
/**
* @{
* @author Ludwig Ortmann <ludwig.ortmann@fu-berlin.de>
* @}
*/
#ifndef NATIVENET_INTERNAL_H
#define NATIVENET_INTERNAL_H

View File

@ -1,3 +1,18 @@
/**
* internal nativenet tap network layer interface
*
* Copyright (C) 2013 Ludwig Ortmann
*
* This file subject to the terms and conditions of the GNU Lesser General
* Public License. See the file LICENSE in the top level directory for more
* details.
*/
/**
* @{
* @author Ludwig Ortmann <ludwig.ortmann@fu-berlin.de>
* @}
*/
#ifndef _TAP_H
#define _TAP_H
@ -11,6 +26,8 @@
* if "name" is an empty string, the kernel chooses a name
* if "name" is an existing device, that device is used
* otherwise a device named "name" is created
*
* On OSX a name has to be provided.
*/
int tap_init(char *name);
int send_buf(radio_packet_t *packet);

View File

@ -1,3 +1,19 @@
/**
* nativenet.h implementation
*
* Copyright (C) 2013 Ludwig Ortmann
*
* This file subject to the terms and conditions of the GNU Lesser General
* Public License. See the file LICENSE in the top level directory for more
* details.
*
* @ingroup native_cpu
* @ingroup net
* @{
* @file
* @author Ludwig Ortmann <ludwig.ortmann@fu-berlin.de>
*/
#include <stdio.h>
#include <err.h>
#include <stdint.h>
@ -186,3 +202,4 @@ void _nativenet_handle_packet(radio_packet_t *packet)
rx_buffer_next = 0;
}
}
/** @} */

View File

@ -1,3 +1,18 @@
/**
* tap.h implementation
*
* Copyright (C) 2013 Ludwig Ortmann
*
* This file subject to the terms and conditions of the GNU Lesser General
* Public License. See the file LICENSE in the top level directory for more
* details.
*
* @ingroup native_cpu
* @{
* @file
* @author Ludwig Ortmann <ludwig.ortmann@fu-berlin.de>
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -203,3 +218,4 @@ int tap_init(char *name)
puts("RIOT native tap initialized.");
return _native_tap_fd;
}
/** @} */