Consts802154.h

00001 /* -*- mode:c++ -*- ********************************************************
00002  * file:        ConstsAccNoise3.h
00003  *
00004  * author:      Jerome Rousselot, Amre El-Hoiydi
00005  *
00006  * copyright:   (C) 2007-2008 CSEM SA, Neuchatel, Switzerland
00007  *
00008  *              This program is free software; you can redistribute it
00009  *              and/or modify it under the terms of the GNU General Public
00010  *              License as published by the Free Software Foundation; either
00011  *              version 2 of the License, or (at your option) any later
00012  *              version.
00013  *              For further information see file COPYING
00014  *              in the top level directory
00015  *
00016  * Funding: This work was partially financed by the European Commission under the
00017  * Framework 6 IST Project "Wirelessly Accessible Sensor Populations"
00018  * (WASP) under contract IST-034963.
00019  ***************************************************************************
00020  * part of:    Modifications to the MF-2 framework by CSEM
00021  **************************************************************************/
00022 
00023 #ifndef CONSTANTS_ACCNOISE3
00024 #define CONSTANTS_ACCNOISE3
00025 
00026 //#define DEFAULT_BITRATE_802154 250000
00027 #define DEFAULT_BITRATE_802154 25000
00028 #define DEFAULT_BANDWIDTH_802154 2000000  /* 2 MHz channels at 2.4 GHz */
00029 
00030 #define DEFAULT_SFD_LENGTH 16
00031 #define DEFAULT_BER_LOWER_BOUND 0.000001
00032 
00033 // Radio timers
00034 #define DEFAULT_DELAY_SETUP_RX 3.85E-3
00035 #define DEFAULT_DELAY_SETUP_TX 3.85E-3
00036 #define DEFAULT_DELAY_SWITCH_RX_TX 0.64E-3
00037 #define DEFAULT_DELAY_SWITCH_TX_RX 0.64E-3
00038 // Radio power consumption
00039 #define DEFAULT_RADIO_SLEEP_CONSUMED_POWER      0.0000006
00040 #define DEFAULT_RADIO_SETUP_RX_CONSUMED_POWER   0.0147
00041 #define DEFAULT_RADIO_SETUP_TX_CONSUMED_POWER   0.0147
00042 #define DEFAULT_RADIO_RX_CONSUMED_POWER       0.0597
00043 #define DEFAULT_RADIO_TX_CONSUMED_POWER       0.0753
00044 #define DEFAULT_RADIO_SWITCH_RX_TX_CONSUMED_POWER 0.0597
00045 #define DEFAULT_RADIO_SWITCH_TX_RX_CONSUMED_POWER 0.0597
00046 
00047 #define DEFAULT_THERMAL_NOISE -100
00048 
00049 // Mac parameters
00050 #define DEFAULT_HEADER_LENGTH 88  // 11 bytes
00051 #define DEFAULT_ACK_DURATION  0.000352  // 11 bytes @ 250000 bps
00052 #define DEFAULT_SIFS 1E-3 // minimum time between a data frame and a ack
00053 //const double DEFAULT_DIFS=DEFAULT_SIFS+DEFAULT_ACK_DURATION;
00054 #define DEFAULT_DIFS 0.0014
00055 
00057 //const double BITRATES_802154[] = {
00058 //    1000000,
00059 //    2000000,
00060 //    5500000,
00061 //    11000000
00062 //};
00063 
00064 
00072 const double RED_PHY_HEADER_DURATION = 0.000020;
00073 
00075 //const double PHY_HEADER_LENGTH=48; // 4 bytes for bit sync preamble, 1 byte SFD, 1 byte length
00077 //const double HEADER_WITHOUT_PREAMBLE=48;
00079 //const double BITRATE_HEADER=1E-6;
00081 //const double BANDWIDTH=20E+6;
00082 
00083 const int MAC_GENERATOR = 5;
00084 
00087 const double LENGTH_RTS = 160;  // RTS to be removed from 802154
00088 const double LENGTH_CTS = 112;  // CRS to be removed from 802154
00089 const double LENGTH_ACK = 88; // 11 bytes
00090 
00092 const int MAC802154_MAC_HEADER_LENGTH = 72; // 2 bytes Control, 1 byte Seq, 4 bytes addressing, 2 bytes FCS
00093 const int MAC802154_PHY_HEADER_LENGTH = 48; // 4 bytes preamble, 1 byte SFD, 1 byte length, 2 bytes CRC
00094 
00095 //time slot ST, short interframe space SIFS, distributed interframe
00096 //space DIFS, and extended interframe space EIFS
00100 const double ST = 20E-6;
00101 
00105 const double SIFS = 10E-6;
00106 
00110 const double DIFS = 2 * ST + SIFS;
00111 
00115 const double EIFS =
00116   SIFS + DIFS + (MAC802154_PHY_HEADER_LENGTH + LENGTH_ACK) / 250000;
00117 
00122 const unsigned LONG_RETRY_LIMIT = 4;
00123 
00128 const unsigned SHORT_RETRY_LIMIT = 7;
00129 
00133 const unsigned CW_MIN = 31;
00134 
00136 const unsigned CW_MAX = 1023;
00137 
00138 #endif