[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r5830 - gnuradio/branches/developers/gnychis/inband/us
From: |
gnychis |
Subject: |
[Commit-gnuradio] r5830 - gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband |
Date: |
Mon, 25 Jun 2007 14:02:30 -0600 (MDT) |
Author: gnychis
Date: 2007-06-25 14:02:29 -0600 (Mon, 25 Jun 2007)
New Revision: 5830
Modified:
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.cc
Log:
CS code work-in-progress
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-06-25 18:58:43 UTC (rev 5829)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.cc
2007-06-25 20:02:29 UTC (rev 5830)
@@ -682,6 +682,39 @@
void usrp_server::handle_cmd_to_control_channel(mb_port_sptr port,
std::vector<struct channel_info> &chan_info, pmt_t data)
{
+ pmt_t invocation_handle = pmt_nth(0, data);
+ pmt_t subpackets = pmt_nth(1, data);
+
+ long n_subpackets = pmt_length(subpackets);
+
+ size_t psize;
+ long payload = 0;
+
+ pmt_t v_packets;
+ transport_pkt *pkt;
+
+ // The design of the following code is optimized for simplicity, not
+ // performance. To performance optimize this code, the total size in bytes
+ // needed for all of the CS packets is needed to allocate contiguous memory
+ // which contains the USB packets for bursting over the bus. However to do
+ // this the packets subpackets would need to be parsed twice and their sizes
+ // would need to be determined.
+ //
+ // The approach taken is to keep parsing the subpackets and putting them in
to
+ // USB packets. Once the USB packet is full, a write is sent for it and
+ // another packet is created.
+
+ for(int i=0; i < n_subpackets; i++) {
+
+ // We create a new packet when the payload is set to 0
+ if(payload == 0) {
+ v_packets = pmt_make_u8vector(sizeof(transport_pkt), 0);
+
+ pkt = (transport_pkt *) pmt_u8vector_writeable_elements(v_packets,
psize);
+ }
+
+ }
+
return;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r5830 - gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband,
gnychis <=