[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r5885 - gnuradio/branches/developers/gnychis/inband/us
From: |
gnychis |
Subject: |
[Commit-gnuradio] r5885 - gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband |
Date: |
Mon, 2 Jul 2007 13:28:33 -0600 (MDT) |
Author: gnychis
Date: 2007-07-02 13:28:33 -0600 (Mon, 02 Jul 2007)
New Revision: 5885
Modified:
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.cc
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_inband_usb_packet.h
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.cc
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_tx_stub.cc
Log:
Adding in functionality for delay control/status command
Modified:
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.cc
===================================================================
---
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.cc
2007-07-02 17:42:40 UTC (rev 5884)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/qa_inband_usrp_server.cc
2007-07-02 19:28:33 UTC (rev 5885)
@@ -1188,6 +1188,12 @@
pmt_list2(s_op_read_reg,
pmt_list2(PMT_NIL,
pmt_from_long(0x6))))));
+
+ d_tx->send(s_cmd_to_control_channel,
+ pmt_list2(pmt_list2(s_response_from_control_channel, PMT_T),
+ pmt_list1(
+ pmt_list2(s_op_delay,
+ pmt_list1(pmt_from_long(0x7))))));
}
void
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-07-02 17:42:40 UTC (rev 5884)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_inband_usb_packet.h
2007-07-02 19:28:33 UTC (rev 5885)
@@ -96,11 +96,14 @@
static const int CS_RID_SHIFT = 10;
static const int CS_PINGVAL_MASK = 0x3ff;
- static const int CS_PINGVAL_SHIFT = 0x0;
+ static const int CS_PINGVAL_SHIFT = 0;
static const int CS_REGNUM_MASK = 0x3ff;
- static const int CS_REGNUM_SHIFT = 0x0;
+ static const int CS_REGNUM_SHIFT = 0;
+ static const int CS_DELAY_MASK = 0xffff;
+ static const int CS_DELAY_SHIFT = 0;
+
public:
void set_timestamp(uint32_t timestamp){
@@ -344,6 +347,28 @@
set_header(h_flags, h_chan, h_tag, h_payload_len);
}
+ void cs_delay(long ticks)
+ {
+ uint32_t delay = (
+ ((OP_DELAY & CS_OPCODE_MASK) << CS_OPCODE_SHIFT)
+ | ((2 & CS_LENGTH_MASK) << CS_LENGTH_SHIFT)
+ | ((ticks & CS_DELAY_MASK) << CS_DELAY_SHIFT)
+
+ );
+
+ int p_len = payload_len();
+ uint32_t *payload = (uint32_t *) d_payload + p_len;
+ *payload = host_to_usrp_u32(delay);
+
+ // Update payload length
+ int h_flags = flags();
+ int h_chan = chan();
+ int h_tag = tag();
+ int h_payload_len = payload_len() + 4; // increased by fixed ping size
+
+ set_header(h_flags, h_chan, h_tag, h_payload_len);
+ }
+
// The following method takes an offset within the packet payload to extract
// a control/status subpacket and construct a pmt response which includes the
// proper signal and arguments specified by usrp-low-level-cs. The USRP
@@ -418,7 +443,11 @@
return PMT_NIL;
case OP_DELAY:
- return PMT_NIL;
+ {
+ pmt_t ticks = pmt_from_long((subpkt >> CS_DELAY_SHIFT) &
CS_DELAY_MASK);
+
+ return pmt_list2(s_op_delay, ticks);
+ }
default:
return PMT_NIL;
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-07-02 17:42:40 UTC (rev 5884)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_server.cc
2007-07-02 19:28:33 UTC (rev 5885)
@@ -753,7 +753,19 @@
std::cout << "[USRP_SERVER] Received read register request"
<< " assigning RID " << rid << std::endl;
}
+
+ //------------ DELAY --------------//
+ if(pmt_eq(subp_cmd, s_op_delay)) {
+ long ticks = pmt_to_long(pmt_nth(0, subp_data));
+
+ pkt->cs_delay(ticks);
+
+ if(verbose)
+ std::cout << "[USRP_SERVER] Received delay request of "
+ << ticks << " ticks\n";
+ }
+
d_cs_usrp->send(s_cmd_usrp_write,
pmt_list3(invocation_handle,
pmt_from_long(channel),
@@ -950,7 +962,6 @@
PMT_T,
pmt_list2(s_op_ping_fixed_reply, // subp
pmt_list2(rid, pingval))));
-
}
//----------------- READ REG RESPONSE ------------------//
@@ -979,7 +990,6 @@
PMT_T,
pmt_list2(s_op_read_reg_reply, // subp
pmt_list3(rid, reg_num,
reg_val))));
-
}
// Each subpacket has an unaccounted for 2 bytes which is the opcode
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-07-02 17:42:40 UTC (rev 5884)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_tx_stub.cc
2007-07-02 19:28:33 UTC (rev 5885)
@@ -198,7 +198,19 @@
<< "\tREG: " << reg_num << std::endl
<< "\tVAL: " << reg_val << std::endl;
}
+
+ //----------------- READ REG ------------------//
+ if(pmt_eq(op_symbol, s_op_delay)) {
+ size_t ignore;
+
+ long ticks = pmt_to_long(pmt_nth(1, sub_packet));
+
+ if(verbose)
+ std::cout << "[USRP_TX_STUB] Received delay of "
+ << ticks << " ticks\n";
+ }
+
// Each subpacket has an unaccounted for 2 bytes which is the opcode
// and the length field
curr_payload += len + 2;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r5885 - gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband,
gnychis <=