commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r6403 - gnuradio/branches/developers/gnychis/inband/us


From: gnychis
Subject: [Commit-gnuradio] r6403 - gnuradio/branches/developers/gnychis/inband/usrp/host/apps-inband
Date: Tue, 11 Sep 2007 12:31:37 -0600 (MDT)

Author: gnychis
Date: 2007-09-11 12:31:37 -0600 (Tue, 11 Sep 2007)
New Revision: 6403

Modified:
   gnuradio/branches/developers/gnychis/inband/usrp/host/apps-inband/gmac.cc
   gnuradio/branches/developers/gnychis/inband/usrp/host/apps-inband/gmac.h
   gnuradio/branches/developers/gnychis/inband/usrp/host/apps-inband/gmac.mbh
   
gnuradio/branches/developers/gnychis/inband/usrp/host/apps-inband/gmac_symbols.h
Log:
Adding in the capability of a carrier sense deadline.  This deadline is treated
after the timestamp deadline as the maximum amount of time to wait until
throwing away the frame.

i.e. if the timestamp is set to 10, and the deadline is set to 5 ... if the
carrier sense is still blocking at time 15, the frame will be thrown discarded.


Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/apps-inband/gmac.cc
===================================================================
--- gnuradio/branches/developers/gnychis/inband/usrp/host/apps-inband/gmac.cc   
2007-09-11 18:24:42 UTC (rev 6402)
+++ gnuradio/branches/developers/gnychis/inband/usrp/host/apps-inband/gmac.cc   
2007-09-11 18:31:37 UTC (rev 6403)
@@ -235,6 +235,12 @@
           return;
         }
 
+        //------- CARRIER SENSE DEADLINE ------------------------------------//
+        if(pmt_eq(event, s_cmd_carrier_sense_deadline)) {
+          handle_cmd_carrier_sense_deadline(data);
+          return;
+        }
+
         //------- DISABLE CARRIER SENSE -------------------------------------//
         if(pmt_eq(event, s_cmd_carrier_sense_disable)) {
           handle_cmd_carrier_sense_disable(data);
@@ -666,4 +672,21 @@
   set_carrier_sense(d_carrier_sense, l_threshold, d_cs_deadline, 
invocation_handle);
 }
 
+// Ability to change the deadline using a C/S packet.  The state of all other
+// carrier sense parameters should not change.
+void gmac::handle_cmd_carrier_sense_deadline(pmt_t data)
+{
+  pmt_t invocation_handle = pmt_nth(0, data);
+  pmt_t deadline = pmt_nth(1, data);
+  long l_deadline;
+
+  // If the deadline passed is NIL, do *not* change the value.
+  if(pmt_eqv(deadline, PMT_NIL))
+    l_deadline = d_cs_deadline;
+  else
+    l_deadline = pmt_to_long(deadline);
+  
+  set_carrier_sense(d_carrier_sense, d_cs_thresh, l_deadline, 
invocation_handle);
+}
+
 REGISTER_MBLOCK_CLASS(gmac);

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/apps-inband/gmac.h
===================================================================
--- gnuradio/branches/developers/gnychis/inband/usrp/host/apps-inband/gmac.h    
2007-09-11 18:24:42 UTC (rev 6402)
+++ gnuradio/branches/developers/gnychis/inband/usrp/host/apps-inband/gmac.h    
2007-09-11 18:31:37 UTC (rev 6403)
@@ -84,6 +84,7 @@
   void handle_cmd_carrier_sense_enable(pmt_t data);
   void handle_cmd_carrier_sense_threshold(pmt_t data);
   void handle_cmd_carrier_sense_disable(pmt_t data);
+  void handle_cmd_carrier_sense_deadline(pmt_t data);
  
 };
 

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/apps-inband/gmac.mbh
===================================================================
--- gnuradio/branches/developers/gnychis/inband/usrp/host/apps-inband/gmac.mbh  
2007-09-11 18:24:42 UTC (rev 6402)
+++ gnuradio/branches/developers/gnychis/inband/usrp/host/apps-inband/gmac.mbh  
2007-09-11 18:31:37 UTC (rev 6403)
@@ -137,6 +137,7 @@
 
     (response-carrier-sense-enable invocation-handle status)
     (response-carrier-sense-threshold invocation-handle status)
+    (response-carrier-sense-deadline invocation-handle status)
     (response-carrier-sense-disable invocation-handle status)
 
     (response-set-tx-retries invocation-handle status)

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/apps-inband/gmac_symbols.h
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/apps-inband/gmac_symbols.h
    2007-09-11 18:24:42 UTC (rev 6402)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/apps-inband/gmac_symbols.h
    2007-09-11 18:31:37 UTC (rev 6403)
@@ -34,11 +34,13 @@
 // CS
 static pmt_t s_cmd_carrier_sense_enable = 
pmt_intern("cmd-carrier-sense-enable");
 static pmt_t s_cmd_carrier_sense_threshold = 
pmt_intern("cmd-carrier-sense-threshold");
+static pmt_t s_cmd_carrier_sense_deadline = 
pmt_intern("cmd-carrier-sense-deadline");
 static pmt_t s_cmd_carrier_sense_disable = 
pmt_intern("cmd-carrier-sense-disable");
 static pmt_t s_cmd_set_tx_retries = pmt_intern("cmd-set-tx-retries");
 static pmt_t s_response_gmac_initialized = 
pmt_intern("response-gmac-initialized");
 static pmt_t s_response_carrier_sense_enable = 
pmt_intern("response-carrier-sense-enable");
 static pmt_t s_response_carrier_sense_treshold = 
pmt_intern("response-carrier-sense-threshold");
+static pmt_t s_response_carrier_sense_deadline = 
pmt_intern("response-carrier-sense-deadline");
 static pmt_t s_response_carrier_sense_disable = 
pmt_intern("response-carrier-sense-disable");
 static pmt_t s_response_set_tx_retries = pmt_intern("response-set-tx-retries");
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]