2013-11-28 13:25:33 +01:00
|
|
|
/*
|
2013-08-05 16:10:54 +02:00
|
|
|
* Copyright (C) 2013 INRIA.
|
|
|
|
*
|
2014-08-23 15:43:13 +02:00
|
|
|
* 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.
|
2013-11-28 13:25:33 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2014-04-16 12:09:49 +02:00
|
|
|
* @ingroup net_sixlowpan_lowpan
|
2013-08-05 16:10:54 +02:00
|
|
|
* @{
|
2013-11-28 13:25:33 +01:00
|
|
|
*
|
|
|
|
* @file sixlowpan/mac.h
|
|
|
|
* @brief 6LoWPAN data structs, and prototypes for MAC layer
|
|
|
|
*
|
|
|
|
* @author Stephan Zeisberg <zeisberg@mi.fu-berlin.de>
|
|
|
|
* @author Martin Lenders <mlenders@inf.fu-berlin.de>
|
|
|
|
* @author Eric Engel <eric.engel@fu-berlin.de>
|
|
|
|
* @author Oliver Gesch <oliver.gesch@googlemail.com>
|
2013-08-05 16:10:54 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SIXLOWPAN_MAC_H
|
|
|
|
#define SIXLOWPAN_MAC_H
|
|
|
|
|
2013-08-08 16:22:37 +02:00
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#include "transceiver.h"
|
|
|
|
|
|
|
|
#include "sixlowpan/types.h"
|
|
|
|
|
2013-10-23 18:49:36 +02:00
|
|
|
/**
|
|
|
|
* @brief Maximum length of a IEEE 802.15.4 long address represented as string.
|
|
|
|
*/
|
|
|
|
#define IEEE_802154_MAX_ADDR_STR_LEN (12)
|
|
|
|
|
2013-08-08 16:22:37 +02:00
|
|
|
/**
|
2014-02-13 15:18:16 +01:00
|
|
|
* @brief Send an IEEE 802.15.4 frame to a long address.
|
2013-08-08 16:22:37 +02:00
|
|
|
*
|
2014-02-13 15:18:16 +01:00
|
|
|
* @param[in] if_id The interface to send over (will be ignored if
|
|
|
|
* *mcast* is 1).
|
|
|
|
* @param[in] dest The destination address of the frame (will be
|
|
|
|
* ignored if *mcast* is 1).
|
|
|
|
* @param[in] dest_len The lengts of the destination address in byte.
|
|
|
|
* @param[in] payload The payload of the frame.
|
|
|
|
* @param[in] length The length of the payload.
|
|
|
|
* @param[in] mcast send frame as multicast frame (*addr* and *if_id*
|
|
|
|
* will be ignored).
|
2013-08-08 16:22:37 +02:00
|
|
|
*
|
2014-02-13 15:18:16 +01:00
|
|
|
* @return Length of transmitted data in byte
|
2013-08-08 16:22:37 +02:00
|
|
|
*/
|
2014-02-13 15:18:16 +01:00
|
|
|
int sixlowpan_mac_send_ieee802154_frame(int if_id, const void *dest,
|
|
|
|
uint8_t dest_len, const void *payload, uint8_t length, uint8_t mcast);
|
2013-08-08 16:22:37 +02:00
|
|
|
|
|
|
|
/**
|
2014-02-13 15:18:16 +01:00
|
|
|
* @brief Initialise 6LoWPAN MAC layer and register it to interface layer
|
2013-10-23 18:49:36 +02:00
|
|
|
*
|
2014-02-13 15:18:16 +01:00
|
|
|
* @return PID of the MAC receiver thread.
|
2013-10-23 18:49:36 +02:00
|
|
|
*/
|
2014-07-06 22:57:56 +02:00
|
|
|
kernel_pid_t sixlowpan_mac_init(void);
|
2013-10-23 18:49:36 +02:00
|
|
|
|
2013-11-28 13:25:33 +01:00
|
|
|
/** @} */
|
2013-08-05 16:10:54 +02:00
|
|
|
#endif /* SIXLOWPAN_MAC_H */
|