mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #2831 from OlegHahm/transceiver_broadcast
Use transceiver specific broadcast
This commit is contained in:
commit
09c07e918d
@ -19,6 +19,11 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Broadcast address
|
||||
*/
|
||||
#define MC1322X_BROADCAST_ADDRESS (0xFFFF)
|
||||
|
||||
/*********************************************************/
|
||||
/* function definitions */
|
||||
/*********************************************************/
|
||||
|
@ -44,6 +44,11 @@
|
||||
*/
|
||||
#define NATIVENET_DEV_CB_MAX (128)
|
||||
|
||||
/**
|
||||
* @brief Broadcast address
|
||||
*/
|
||||
#define NATIVE_BROADCAST_ADDRESS (0)
|
||||
|
||||
#ifndef NATIVE_MAX_DATA_LENGTH
|
||||
#include "tap.h"
|
||||
|
||||
|
@ -201,7 +201,7 @@ void _nativenet_handle_packet(radio_packet_t *packet)
|
||||
if (dst_addr == _nativenet_default_dev_more._radio_addr) {
|
||||
DEBUG("_nativenet_handle_packet: accept packet, addressed to us\n");
|
||||
}
|
||||
else if (dst_addr == 0) {
|
||||
else if (dst_addr == NATIVE_BROADCAST_ADDRESS) {
|
||||
DEBUG("_nativenet_handle_packet: accept packet, broadcast\n");
|
||||
}
|
||||
else {
|
||||
|
@ -109,36 +109,42 @@ extern "C" {
|
||||
#if (CC1100_MAX_DATA_LENGTH > PAYLOAD_SIZE)
|
||||
#undef PAYLOAD_SIZE
|
||||
#define PAYLOAD_SIZE (CC1100_MAX_DATA_LENGTH)
|
||||
#define TRANSCEIVER_BROADCAST CC1100_BROADCAST_ADDRESS
|
||||
#endif
|
||||
#endif
|
||||
#if (defined(MODULE_CC110X) || defined(MODULE_CC110X_LEGACY))
|
||||
#if (CC1100_MAX_DATA_LENGTH > PAYLOAD_SIZE)
|
||||
#undef PAYLOAD_SIZE
|
||||
#define PAYLOAD_SIZE (CC1100_MAX_DATA_LENGTH)
|
||||
#define TRANSCEIVER_BROADCAST CC1100_BROADCAST_ADDRESS
|
||||
#endif
|
||||
#endif
|
||||
#ifdef MODULE_CC2420
|
||||
#if (CC2420_MAX_DATA_LENGTH > PAYLOAD_SIZE)
|
||||
#undef PAYLOAD_SIZE
|
||||
#define PAYLOAD_SIZE (CC2420_MAX_DATA_LENGTH)
|
||||
#define TRANSCEIVER_BROADCAST CC2420_BROADCAST_ADDRESS
|
||||
#endif
|
||||
#endif
|
||||
#ifdef MODULE_AT86RF231
|
||||
#if (AT86RF231_MAX_DATA_LENGTH > PAYLOAD_SIZE)
|
||||
#undef PAYLOAD_SIZE
|
||||
#define PAYLOAD_SIZE (AT86RF231_MAX_DATA_LENGTH)
|
||||
#define TRANSCEIVER_BROADCAST AT86RF231_BROADCAST_ADDRESS
|
||||
#endif
|
||||
#endif
|
||||
#ifdef MODULE_MC1322X
|
||||
#if (MACA_MAX_PAYLOAD_SIZE > PAYLOAD_SIZE)
|
||||
#undef PAYLOAD_SIZE
|
||||
#define PAYLOAD_SIZE (MACA_MAX_PAYLOAD_SIZE)
|
||||
#define TRANSCEIVER_BROADCAST MC1322X_BROADCAST_ADDRESS
|
||||
#endif
|
||||
#endif
|
||||
#ifdef MODULE_NATIVENET
|
||||
#if (NATIVE_MAX_DATA_LENGTH > PAYLOAD_SIZE)
|
||||
#undef PAYLOAD_SIZE
|
||||
#define PAYLOAD_SIZE (NATIVE_MAX_DATA_LENGTH)
|
||||
#define TRANSCEIVER_BROADCAST NATIVE_BROADCAST_ADDRESS
|
||||
#endif
|
||||
#endif
|
||||
/**
|
||||
|
@ -24,7 +24,7 @@ extern "C" {
|
||||
|
||||
#define RIOT_CCN_EVENT_NUMBER_OFFSET (1 << 8)
|
||||
|
||||
#define RIOT_BROADCAST (UINT16_MAX)
|
||||
#define RIOT_BROADCAST TRANSCEIVER_BROADCAST
|
||||
|
||||
typedef struct riot_ccnl_msg {
|
||||
void *payload;
|
||||
|
@ -99,7 +99,7 @@ int ipv6_send_packet(ipv6_hdr_t *packet, ipv6_addr_t *next_hop)
|
||||
/* see if dest should be routed to a different next hop */
|
||||
if (ipv6_addr_is_multicast(&packet->destaddr)) {
|
||||
/* if_id will be ignored */
|
||||
uint16_t addr = 0xffff;
|
||||
uint16_t addr = TRANSCEIVER_BROADCAST;
|
||||
return sixlowpan_lowpan_sendto(0, &addr, 2, (uint8_t *) packet,
|
||||
length);
|
||||
}
|
||||
@ -124,7 +124,7 @@ int ipv6_send_packet(ipv6_hdr_t *packet, ipv6_addr_t *next_hop)
|
||||
nce->lladdr_len, (uint8_t *) packet, length) < 0) {
|
||||
/* XXX: this is wrong, but until ND does work correctly,
|
||||
* this is the only way (aka the old way)*/
|
||||
uint16_t raddr = 0xffff; /* Broadcast message */
|
||||
uint16_t raddr = TRANSCEIVER_BROADCAST; /* Broadcast message */
|
||||
sixlowpan_lowpan_sendto(0, &raddr, 2, (uint8_t *) packet,
|
||||
length);
|
||||
/* return -1; */
|
||||
|
@ -339,6 +339,9 @@ void rpl_send_DAO(rpl_dodag_t *my_dodag, ipv6_addr_t *destination, uint8_t lifet
|
||||
if (destination) {
|
||||
DEBUGF("Send DAO to %s\n", ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN, destination));
|
||||
}
|
||||
else {
|
||||
DEBUGF("Send DAO to default destination\n");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user