commit-gnuradio
[Top][All Lists]
Advanced

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

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


From: gnychis
Subject: [Commit-gnuradio] r6697 - gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband
Date: Thu, 25 Oct 2007 21:25:57 -0600 (MDT)

Author: gnychis
Date: 2007-10-25 21:25:57 -0600 (Thu, 25 Oct 2007)
New Revision: 6697

Modified:
   gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/fake_usrp.cc
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/gen_test_packets.py
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usb_packet.py
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_inband_usb_packet.h
   gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_rx.cc
   gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_tx.cc
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_tx_stub.cc
Log:
Additional changes for the new CONTROL_CHAN constant.


Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/fake_usrp.cc
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/fake_usrp.cc   
    2007-10-26 03:18:49 UTC (rev 6696)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/fake_usrp.cc   
    2007-10-26 03:25:57 UTC (rev 6697)
@@ -44,7 +44,7 @@
 
   // I'm assuming that a control packet cannot exist in a burst of data 
packets,
   // therefore i read only the first packet's channel in the current burst
-  if(pkts[0].chan() == 0x1f) {
+  if(pkts[0].chan() == CONTROL_CHAN) {
     return control_block(pkts, n_bytes);
   } else {
     return data_block(pkts, n_bytes);

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/gen_test_packets.py
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/gen_test_packets.py
        2007-10-26 03:18:49 UTC (rev 6696)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/gen_test_packets.py
        2007-10-26 03:25:57 UTC (rev 6697)
@@ -70,7 +70,7 @@
     lengths = gen_shuffled_lengths()
     npkts = len(lengths)                # number of packets we'll generator on 
each stream
     pkt_gen_0 = packet_sequence_generator(0, lengths)
-    pkt_gen_1 = packet_sequence_generator(0x1f, gen_shuffled_lengths())
+    pkt_gen_1 = packet_sequence_generator(CONTROL_CHAN, gen_shuffled_lengths())
     pkt_gen = (pkt_gen_0, pkt_gen_1)
     
     which_gen = (npkts * [0]) + (npkts * [1])

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usb_packet.py
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usb_packet.py  
    2007-10-26 03:18:49 UTC (rev 6696)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usb_packet.py  
    2007-10-26 03:25:57 UTC (rev 6697)
@@ -38,13 +38,13 @@
 RSSI_MASK = 0x3f
 RSSI_SHIFT = 21
 
-CHAN_MASK = 0x1f
+CHAN_MASK = CONTROL_CHAN
 CHAN_SHIFT = 16
 
 TAG_MASK = 0xf
 TAG_SHIFT = 9
 
-PAYLOAD_LEN_MASK = 0x1ff
+PAYLOAD_LEN_MASK = CONTROL_CHANf
 PAYLOAD_LEN_SHIFT = 0
 
 def make_header(flags, chan, payload_len, timestamp, rssi=0, tag=0):

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_inband_usb_packet.h
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_inband_usb_packet.h
   2007-10-26 03:18:49 UTC (rev 6696)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_inband_usb_packet.h
   2007-10-26 03:25:57 UTC (rev 6697)
@@ -31,7 +31,7 @@
 
 static const int USB_PKT_SIZE = 512;   // bytes
 static const int MAX_PAYLOAD = USB_PKT_SIZE-2*sizeof(uint32_t);
-static const int CONTROL_CHAN = 0x1f;
+static const int CONTROL_CHAN = CONTROL_CHAN;
 
 class usrp_inband_usb_packet {
   //
@@ -79,13 +79,13 @@
   static const int RSSI_MASK = 0x3f;
   static const int RSSI_SHIFT = 21;
 
-  static const int CHAN_MASK = 0x1f;
+  static const int CHAN_MASK = CONTROL_CHAN;
   static const int CHAN_SHIFT = 16;
 
   static const int TAG_MASK = 0xf;
   static const int TAG_SHIFT = 9;
 
-  static const int PAYLOAD_LEN_MASK = 0x1ff;
+  static const int PAYLOAD_LEN_MASK = CONTROL_CHANf;
   static const int PAYLOAD_LEN_SHIFT = 0;
 
   // Fixed size for opcode and length fields

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_rx.cc
===================================================================
--- gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_rx.cc 
2007-10-26 03:18:49 UTC (rev 6696)
+++ gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_rx.cc 
2007-10-26 03:25:57 UTC (rev 6697)
@@ -132,7 +132,7 @@
       std::cout << "[usrp_rx] Read 1 packet\n";
     
     if(d_disk_write) {
-      if(pkt->chan() == 0x1f)
+      if(pkt->chan() == CONTROL_CHAN)
         d_cs_ofile.write((const char *)pkt, transport_pkt::max_pkt_size());
       else
         d_ofile.write((const char *)pkt, transport_pkt::max_pkt_size());

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_tx.cc
===================================================================
--- gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_tx.cc 
2007-10-26 03:18:49 UTC (rev 6696)
+++ gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_tx.cc 
2007-10-26 03:25:57 UTC (rev 6697)
@@ -121,7 +121,7 @@
   for(int i=0; i < n_packets; i++) {
     
     if(d_disk_write) {
-      if(pkts[i].chan() == 0x1f)
+      if(pkts[i].chan() == CONTROL_CHAN)
         d_cs_ofile.write((const char *)&pkts[i], 
transport_pkt::max_pkt_size());
       else
         d_ofile.write((const char *)&pkts[i], transport_pkt::max_pkt_size());

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_tx_stub.cc
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_tx_stub.cc
    2007-10-26 03:18:49 UTC (rev 6696)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_tx_stub.cc
    2007-10-26 03:25:57 UTC (rev 6697)
@@ -103,7 +103,7 @@
   for(long i=0; i<n_packets; i++) {
 
     if(d_disk_write) {
-      if(pkts[i].chan() == 0x1f)
+      if(pkts[i].chan() == CONTROL_CHAN)
         d_cs_ofile.write((const char *)&pkts[i], 
transport_pkt::max_pkt_size());
       else
         d_ofile.write((const char *)&pkts[i], transport_pkt::max_pkt_size());
@@ -112,7 +112,7 @@
       d_ofile.flush();
     }
 
-    if(pkts[i].chan() == 0x1f)
+    if(pkts[i].chan() == CONTROL_CHAN)
       parse_cs(invocation_handle, pkts[i]);
   }
 
@@ -140,7 +140,7 @@
   transport_pkt *q_pkt =
     (transport_pkt *) pmt_u8vector_writeable_elements(v_pkt, ignore);
       
-  q_pkt->set_header(0, 0x1f, 0, 0);
+  q_pkt->set_header(0, CONTROL_CHAN, 0, 0);
   q_pkt->set_timestamp(0xffffffff);
 
   // We dispatch based on the control packet type, however we can extract the





reply via email to

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