commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r6119 - in gnuradio/branches/developers/gnychis/inband


From: gnychis
Subject: [Commit-gnuradio] r6119 - in gnuradio/branches/developers/gnychis/inband/usrp/host: apps lib/inband
Date: Mon, 6 Aug 2007 08:45:02 -0600 (MDT)

Author: gnychis
Date: 2007-08-06 08:45:02 -0600 (Mon, 06 Aug 2007)
New Revision: 6119

Modified:
   gnuradio/branches/developers/gnychis/inband/usrp/host/apps/read_packets.cc
   
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/test_usrp_inband_timestamps.cc
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.cc
Log:
Work in progress on start/end of burst problem

Read packets now displays more information about the packet flags


Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/read_packets.cc
===================================================================
--- gnuradio/branches/developers/gnychis/inband/usrp/host/apps/read_packets.cc  
2007-08-06 06:48:13 UTC (rev 6118)
+++ gnuradio/branches/developers/gnychis/inband/usrp/host/apps/read_packets.cc  
2007-08-06 14:45:02 UTC (rev 6119)
@@ -52,18 +52,27 @@
 
   // Open the file and read the packets, dumping information
   infile.open(argv[1], std::ios::binary|std::ios::in);
-  outfile.open("dump.dat",std::ios::out|std::ios::binary);  
-    
+  if(!infile.is_open())
+    exit(-1);
+
+  //outfile.open("dump.dat",std::ios::out|std::ios::binary);  
+
   // read 1 packet in to the memory
   infile.read(pkt_data, pkt_size);
 
-
   while(!infile.eof()) {
   
     printf("Packet %u\n", pkt_num);
+
+    if(pkt->start_of_burst())
+      printf("\tstart of burst\n");
+      
+    if(pkt->end_of_burst())
+      printf("\tend of burst\n");
+
     printf("\tchannel: \t0x%x\n", pkt->chan());
-    //printf("\ttimestamp: \t0x%x\n", pkt->timestamp());
-    printf("\ttimestamp: \t%u\n", pkt->timestamp());
+    printf("\ttimestamp: \t0x%x\n", pkt->timestamp());
+    //printf("\ttimestamp: \t%u\n", pkt->timestamp());
     printf("\tlength: \t%u\n", pkt->payload_len());
 
     printf("\tpayload: \n");
@@ -71,7 +80,7 @@
     //for(int i=0; i < pkt->max_payload(); i++)
     {
       printf("\t%d\t0x%x\n", i, *(pkt->payload()+i));
-      outfile.write((const char*)(pkt->payload()+i),1);
+      //outfile.write((const char*)(pkt->payload()+i),1);
       //printf("\t\t0x%x\n", pkt->payload()+i);
 
     }
@@ -85,6 +94,6 @@
   }
 
   infile.close();
-  outfile.close();
+  //outfile.close();
 
 }

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/test_usrp_inband_timestamps.cc
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/test_usrp_inband_timestamps.cc
   2007-08-06 06:48:13 UTC (rev 6118)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/test_usrp_inband_timestamps.cc
   2007-08-06 14:45:02 UTC (rev 6119)
@@ -107,8 +107,9 @@
     d_nsamples_xmitted(0),
     d_nframes_xmitted(0),
     //d_samples_per_frame((long)(126)),
+    d_samples_per_frame((long)(126 * 2)),      // non-full packet
     //d_samples_per_frame((long)(126 * 3.5)),  // non-full packet
-    d_samples_per_frame((long)(126 * 4)),      // full packet
+    //d_samples_per_frame((long)(126 * 4)),    // full packet
     d_done_sending(false),
     d_amplitude(16384)
 { 
@@ -143,7 +144,7 @@
   // Specify the RBF to use
   pmt_dict_set(usrp_dict,
                pmt_intern("rbf"),
-               pmt_intern("fixed1.rbf"));
+               pmt_intern("oranges.rbf"));
 
   define_component("server", "usrp_server", usrp_dict);
 
@@ -258,6 +259,10 @@
         goto bail;
       }
     }
+
+    if (pmt_eq(event, s_response_from_control_channel)) {
+      std::cout << "ping response!\n";
+    }
     goto unhandled;
 
   case CLOSING_CHANNEL:
@@ -370,8 +375,8 @@
              pmt_list2(PMT_NIL, pmt_list1(pmt_list2(s_op_ping_fixed,
                                                     pmt_list2(pmt_from_long(0),
                                                               
pmt_from_long(0))))));
-
-  std::cout << "[TEST_USRP_INBAND_TIMESTAMPS] Ping sent" << std::endl;
+  if(verbose && 0)
+    std::cout << "[TEST_USRP_INBAND_TIMESTAMPS] Ping sent" << std::endl;
 }
 
 void
@@ -419,7 +424,8 @@
     }
   }
 
-  pmt_t timestamp = pmt_from_long(0xffffffff); // NOW
+  //pmt_t timestamp = pmt_from_long(0xffffffff);       // NOW
+  pmt_t timestamp = pmt_from_long(0x0);        // NOW
   d_tx->send(s_cmd_xmit_raw_frame,
             pmt_list4(pmt_from_long(d_nframes_xmitted),  // invocation-handle
                       d_tx_chan,                         // channel
@@ -429,7 +435,7 @@
   d_nsamples_xmitted += nsamples_this_frame;
   d_nframes_xmitted++;
 
-  if(verbose)
+  if(verbose && 0)
     std::cout << "[TEST_USRP_INBAND_TIMESTAMPS] Transmitted frame\n";
 }
 
@@ -444,6 +450,7 @@
   }
 
   build_and_send_next_frame();
+  //build_and_send_ping();
 }
 
 void

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.cc
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.cc 
    2007-08-06 06:48:13 UTC (rev 6118)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.cc 
    2007-08-06 14:45:02 UTC (rev 6119)
@@ -38,7 +38,7 @@
 
 typedef usrp_inband_usb_packet transport_pkt;   // makes conversion to gigabit 
easy
 
-const static bool verbose = true;
+const static bool verbose = false;
 
 static std::string
 str(long x)





reply via email to

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