Ejemplo n.º 1
0
        /// <summary>
        /// Get the MAC
        /// </summary>
        /// <returns></returns>
        public static MACBase GetMAC()
        {
#if SI4468
            Debug.Print("Configuring SI4468 radio with power " + RadioProperties.Power + ", channel " +
                        RadioProperties.RadioChannel);
            var radioConfig = new SI4468RadioConfiguration(RadioProperties.Power, RadioProperties.RadioChannel);
#elif RF231
            Debug.Print("Configuring RF231 radio with power " + RadioProperties.Power + ", channel " +
                        RadioProperties.RadioChannel);
            var radioConfig = new RF231RadioConfiguration(RadioProperties.Power, RadioProperties.RadioChannel);
#endif

#if CSMA
            Debug.Print("Configuring CSMA");
            var mac = new CSMA(radioConfig)
            {
                NeighborLivenessDelay = 10 * 60 + 20
            };
            Debug.Print("NeighborLivenessDelay = " + mac.NeighborLivenessDelay);
#elif OMAC
            Debug.Print("Configuring OMAC");
            var mac = new OMAC(radioConfig);
            mac.NeighborLivenessDelay = 10 * 60 + 20;
            Debug.Print("NeighborLivenessDelay = " + mac.NeighborLivenessDelay);
#endif
            Debug.Print("Radio Power: " + mac.MACRadioObj.TxPower);
            return(mac);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Get the MAC
        /// </summary>
        /// <returns></returns>
        public static MACBase GetMAC()
        {
#if SI4468
#if !DBG_LOGIC
            Debug.Print("Configuring SI4468 radio with power " + RadioProperties.Power + ", channel " +
                        RadioProperties.RadioChannel);
#endif
            var radioConfig = new SI4468RadioConfiguration(RadioProperties.Power, RadioProperties.RadioChannel);
#elif RF231
            var radioConfig = new RF231RadioConfiguration(RadioProperties.Power, RadioProperties.RadioChannel);
#endif

#if CSMA
            var mac = new CSMA(radioConfig);
#endif
#if OMAC
#if !DBG_LOGIC
            Debug.Print("Configuring OMAC");
#endif
            var mac = new OMAC(radioConfig);
            //mac.NeighborLivenessDelay = 320;
            mac.NeighborLivenessDelay = 10 * 60 + 20;
#if !DBG_LOGIC
            Debug.Print("NeighborLivenessDelay = " + mac.NeighborLivenessDelay);
#endif
#endif
#if !DBG_LOGIC
            Debug.Print("Radio Power: " + mac.MACRadioObj.TxPower);
#endif
            return(mac);
        }