stm32w platforms: use 2 cca and default contikimac guard time

This commit is contained in:
simonduq 2012-03-20 11:46:38 +01:00
parent 5da4463236
commit 7784cf7827
3 changed files with 43 additions and 55 deletions

View File

@ -127,11 +127,7 @@ static int is_receiver_awake = 0;
consists of two or more CCA checks. CCA_COUNT_MAX is the number of consists of two or more CCA checks. CCA_COUNT_MAX is the number of
CCAs to be done for each periodic channel check. The default is CCAs to be done for each periodic channel check. The default is
two.*/ two.*/
#ifdef CONTIKIMAC_CONF_CCA_COUNT_MAX
#define CCA_COUNT_MAX CONTIKIMAC_CONF_CCA_COUNT_MAX
#else
#define CCA_COUNT_MAX 2 #define CCA_COUNT_MAX 2
#endif
/* Before starting a transmission, Contikimac checks the availability /* Before starting a transmission, Contikimac checks the availability
of the channel with CCA_COUNT_MAX_TX consecutive CCAs */ of the channel with CCA_COUNT_MAX_TX consecutive CCAs */
@ -180,11 +176,7 @@ static int is_receiver_awake = 0;
/* GUARD_TIME is the time before the expected phase of a neighbor that /* GUARD_TIME is the time before the expected phase of a neighbor that
a transmitted should begin transmitting packets. */ a transmitted should begin transmitting packets. */
#ifdef CONTIKIMAC_CONF_GUARD_TIME
#define GUARD_TIME CONTIKIMAC_CONF_GUARD_TIME * CHECK_TIME + CHECK_TIME_TX
#else
#define GUARD_TIME 10 * CHECK_TIME + CHECK_TIME_TX #define GUARD_TIME 10 * CHECK_TIME + CHECK_TIME_TX
#endif
/* INTER_PACKET_INTERVAL is the interval between two successive packet transmissions */ /* INTER_PACKET_INTERVAL is the interval between two successive packet transmissions */
#define INTER_PACKET_INTERVAL RTIMER_ARCH_SECOND / 5000 #define INTER_PACKET_INTERVAL RTIMER_ARCH_SECOND / 5000
@ -551,7 +543,7 @@ send_packet(mac_callback_t mac_callback, void *mac_callback_ptr, struct rdc_buf_
PRINTF("contikimac: radio is turned off\n"); PRINTF("contikimac: radio is turned off\n");
return MAC_TX_ERR_FATAL; return MAC_TX_ERR_FATAL;
} }
if(packetbuf_totlen() == 0) { if(packetbuf_totlen() == 0) {
PRINTF("contikimac: send_packet data len 0\n"); PRINTF("contikimac: send_packet data len 0\n");
return MAC_TX_ERR_FATAL; return MAC_TX_ERR_FATAL;

View File

@ -37,7 +37,8 @@
* contiki-conf.h for MB851. * contiki-conf.h for MB851.
* \author * \author
* Salvatore Pitrulli <salvopitru@users.sourceforge.net> * Salvatore Pitrulli <salvopitru@users.sourceforge.net>
* Chi-Anh La <la@imag.fr> * Chi-Anh La <la@imag.fr>
* Simon Duquennoy <simonduq@sics.se>
*/ */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
@ -102,15 +103,12 @@ typedef unsigned short uip_stats_t;
/* RDC debug with LED */ /* RDC debug with LED */
#define RDC_CONF_DEBUG_LED 1 #define RDC_CONF_DEBUG_LED 1
/* ContikiMAC config */ /* ContikiMAC config */
#define CONTIKIMAC_CONF_CCA_COUNT_MAX 3 #define SICSLOWPAN_CONF_COMPRESSION_THRESHOLD 63
#define CONTIKIMAC_CONF_WITH_CONTIKIMAC_HEADER 0 #define CONTIKIMAC_CONF_WITH_CONTIKIMAC_HEADER 0
#define WITH_PHASE_OPTIMIZATION 1
#define CONTIKIMAC_CONF_COMPOWER 1 #define CONTIKIMAC_CONF_COMPOWER 1
#define CONTIKIMAC_CONF_BROADCAST_RATE_LIMIT 0 #define CONTIKIMAC_CONF_BROADCAST_RATE_LIMIT 0
#define CONTIKIMAC_CONF_ANNOUNCEMENTS 0 #define CONTIKIMAC_CONF_ANNOUNCEMENTS 0
#define WITH_FAST_SLEEP 0
#define CONTIKIMAC_CONF_GUARD_TIME 4
/* CXMAC config */ /* CXMAC config */
#define CXMAC_CONF_ANNOUNCEMENTS 0 #define CXMAC_CONF_ANNOUNCEMENTS 0

View File

@ -36,7 +36,8 @@
* contiki-conf.h for MBXXX. * contiki-conf.h for MBXXX.
* \author * \author
* Salvatore Pitrulli <salvopitru@users.sourceforge.net> * Salvatore Pitrulli <salvopitru@users.sourceforge.net>
* Chi-Anh La <la@imag.fr> * Chi-Anh La <la@imag.fr>
* Simon Duquennoy <simonduq@sics.se>
*/ */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
@ -83,54 +84,51 @@ typedef unsigned short uip_stats_t;
#define NETSTACK_CONF_RADIO stm32w_radio_driver #define NETSTACK_CONF_RADIO stm32w_radio_driver
#if WITH_UIP6 #if WITH_UIP6
#define NETSTACK_CONF_RDC_ENABLED 0 #define NETSTACK_CONF_RDC_ENABLED 0
#if NETSTACK_CONF_RDC_ENABLED #if NETSTACK_CONF_RDC_ENABLED
/* With radio cycling */ /* With radio cycling */
/* RDC params */ /* RDC params */
/* rtimer_second = 11719 */ /* rtimer_second = 11719 */
#define RT_CONF_RESOLUTION 2 #define RT_CONF_RESOLUTION 2
/* TX routine passes the cca/ack result in the return parameter */ /* TX routine passes the cca/ack result in the return parameter */
#define RDC_CONF_HARDWARE_ACK 1 #define RDC_CONF_HARDWARE_ACK 1
/* TX routine does automatic cca and optional backoff */ /* TX routine does automatic cca and optional backoff */
#define RDC_CONF_HARDWARE_CSMA 0 #define RDC_CONF_HARDWARE_CSMA 0
/* Channel check rate (per second) */ /* Channel check rate (per second) */
#define NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE 8 #define NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE 8
/* Use ACK for optimization (LPP, XMAC) */ /* Use ACK for optimization (LPP, XMAC) */
#define WITH_ACK_OPTIMIZATION 0 #define WITH_ACK_OPTIMIZATION 0
/* RDC debug with LED */ /* RDC debug with LED */
#define RDC_CONF_DEBUG_LED 1 #define RDC_CONF_DEBUG_LED 1
/* ContikiMAC config */ /* ContikiMAC config */
#define CONTIKIMAC_CONF_CCA_COUNT_MAX 3 #define SICSLOWPAN_CONF_COMPRESSION_THRESHOLD 63
#define CONTIKIMAC_CONF_WITH_CONTIKIMAC_HEADER 0 #define CONTIKIMAC_CONF_WITH_CONTIKIMAC_HEADER 0
#define WITH_PHASE_OPTIMIZATION 1 #define CONTIKIMAC_CONF_COMPOWER 1
#define CONTIKIMAC_CONF_COMPOWER 1 #define CONTIKIMAC_CONF_BROADCAST_RATE_LIMIT 0
#define CONTIKIMAC_CONF_BROADCAST_RATE_LIMIT 0 #define CONTIKIMAC_CONF_ANNOUNCEMENTS 0
#define CONTIKIMAC_CONF_ANNOUNCEMENTS 0
#define WITH_FAST_SLEEP 0 /* CXMAC config */
#define CONTIKIMAC_CONF_GUARD_TIME 4 #define CXMAC_CONF_ANNOUNCEMENTS 0
#define CXMAC_CONF_COMPOWER 1
/* CXMAC config */
#define CXMAC_CONF_ANNOUNCEMENTS 0 /* XMAC config */
#define CXMAC_CONF_COMPOWER 1 #define XMAC_CONF_ANNOUNCEMENTS 0
#define XMAC_CONF_COMPOWER 1
/* XMAC config */
#define XMAC_CONF_ANNOUNCEMENTS 0 /* Netstacks */
#define XMAC_CONF_COMPOWER 1
/* Netstacks */
#define NETSTACK_CONF_NETWORK sicslowpan_driver #define NETSTACK_CONF_NETWORK sicslowpan_driver
#define NETSTACK_CONF_MAC csma_driver #define NETSTACK_CONF_MAC csma_driver
#define NETSTACK_CONF_RDC contikimac_driver #define NETSTACK_CONF_RDC contikimac_driver
#define NETSTACK_CONF_FRAMER framer_802154 #define NETSTACK_CONF_FRAMER framer_802154
#else #else
/* No radio cycling */ /* No radio cycling */
#define NETSTACK_CONF_NETWORK sicslowpan_driver #define NETSTACK_CONF_NETWORK sicslowpan_driver
#define NETSTACK_CONF_MAC nullmac_driver #define NETSTACK_CONF_MAC nullmac_driver
#define NETSTACK_CONF_RDC sicslowmac_driver #define NETSTACK_CONF_RDC sicslowmac_driver
#define NETSTACK_CONF_FRAMER framer_802154 #define NETSTACK_CONF_FRAMER framer_802154
#endif #endif
#define RIMEADDR_CONF_SIZE 8 #define RIMEADDR_CONF_SIZE 8