[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r6144 - in gnuradio/branches/developers/gnychis/inband
From: |
gnychis |
Subject: |
[Commit-gnuradio] r6144 - in gnuradio/branches/developers/gnychis/inband/usrp/host: apps lib/inband |
Date: |
Thu, 16 Aug 2007 13:51:10 -0600 (MDT) |
Author: gnychis
Date: 2007-08-16 13:51:09 -0600 (Thu, 16 Aug 2007)
New Revision: 6144
Modified:
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/read_packets.cc
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/test_usrp_inband_cs.cc
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/test_usrp_inband_registers.cc
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/test_usrp_inband_tx.cc
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_inband_usb_packet.h
Log:
Including some additional register read/write test code for hardware.
Adding in the hacked up carrier sense changes, until we agree on decisions for
changes to the RSSI and flags in the header.
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-16 19:39:17 UTC (rev 6143)
+++ gnuradio/branches/developers/gnychis/inband/usrp/host/apps/read_packets.cc
2007-08-16 19:51:09 UTC (rev 6144)
@@ -69,11 +69,15 @@
if(pkt->end_of_burst())
printf("\tend of burst\n");
+
+ if(pkt->carrier_sense())
+ printf("\tcarrier sense\n");
printf("\tchannel: \t0x%x\n", pkt->chan());
printf("\ttimestamp: \t0x%x\n", pkt->timestamp());
//printf("\ttimestamp: \t%u\n", pkt->timestamp());
printf("\tlength: \t%u\n", pkt->payload_len());
+ printf("\trssi: \t%u\n", pkt->rssi());
printf("\tpayload: \n");
for(int i=0; i < pkt->payload_len(); i++)
Modified:
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/test_usrp_inband_cs.cc
===================================================================
---
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/test_usrp_inband_cs.cc
2007-08-16 19:39:17 UTC (rev 6143)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/test_usrp_inband_cs.cc
2007-08-16 19:51:09 UTC (rev 6144)
@@ -144,7 +144,7 @@
// Specify the RBF to use
pmt_dict_set(usrp_dict,
pmt_intern("rbf"),
- pmt_intern("fixed1.rbf"));
+ pmt_intern("boe.rbf"));
define_component("server", "usrp_server", usrp_dict);
@@ -358,12 +358,11 @@
sleep(1);
- build_and_send_next_frame(); // fire off 4 to start pipeline
- build_and_send_next_frame();
- build_and_send_next_frame();
- build_and_send_next_frame();
+// build_and_send_next_frame(); // fire off 4 to start pipeline
build_and_send_ping();
+ build_and_send_ping();
+ build_and_send_ping();
}
Modified:
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/test_usrp_inband_registers.cc
===================================================================
---
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/test_usrp_inband_registers.cc
2007-08-16 19:39:17 UTC (rev 6143)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/test_usrp_inband_registers.cc
2007-08-16 19:51:09 UTC (rev 6144)
@@ -89,6 +89,7 @@
void closing_channels();
void closing_usrp();
void enter_receiving();
+ void build_and_send_ping();
};
@@ -118,7 +119,7 @@
// Specify the RBF to use
pmt_dict_set(usrp_dict,
pmt_intern("rbf"),
- pmt_intern("terminator4.rbf"));
+ pmt_intern("boe2.rbf"));
// Set TX and RX interpolations
pmt_dict_set(usrp_dict,
@@ -389,6 +390,19 @@
read_register(); // immediately transition to read the register
}
+// Temporary: for testing pings
+void
+test_usrp_inband_registers::build_and_send_ping()
+{
+
+ d_tx->send(s_cmd_to_control_channel,
+ 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_CS] Ping sent" << std::endl;
+}
+
// After writing to the register, we want to read the value back and ensure
that
// it is the same value that we wrote.
void
@@ -396,7 +410,7 @@
{
d_state = READ_REGISTER;
- long reg = 0;
+ long reg = 9;
d_tx->send(s_cmd_to_control_channel, // C/S packet
pmt_list2(PMT_NIL, // invoc handle
Modified:
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/test_usrp_inband_tx.cc
===================================================================
---
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/test_usrp_inband_tx.cc
2007-08-16 19:39:17 UTC (rev 6143)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/test_usrp_inband_tx.cc
2007-08-16 19:51:09 UTC (rev 6144)
@@ -121,7 +121,7 @@
// Specify the RBF to use
pmt_dict_set(usrp_dict,
pmt_intern("rbf"),
- pmt_intern("fixed1.rbf"));
+ pmt_intern("boe3.rbf"));
// Set TX and RX interpolations
pmt_dict_set(usrp_dict,
@@ -296,6 +296,15 @@
{
d_state = TRANSMITTING;
d_nsamples_xmitted = 0;
+
+ // FIXME: carrier sense hack
+ d_tx->send(s_cmd_to_control_channel, // C/S packet
+ pmt_list2(PMT_NIL, // invoc handle
+ pmt_list1(
+ pmt_list2(s_op_write_reg,
+ pmt_list2(
+ pmt_from_long(1),
+ pmt_from_long(0))))));
build_and_send_next_frame(); // fire off 4 to start pipeline
build_and_send_next_frame();
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-08-16 19:39:17 UTC (rev 6143)
+++
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_inband_usb_packet.h
2007-08-16 19:51:09 UTC (rev 6144)
@@ -145,6 +145,7 @@
void set_header(int flags, int chan, int tag, int payload_len){
uint32_t word0 = ((flags & FL_ALL_FLAGS)
| ((chan & CHAN_MASK) << CHAN_SHIFT)
+ | (1 << 15) // CARRIER SENSE HACK
| ((tag & TAG_MASK) << TAG_SHIFT)
| ((payload_len & PAYLOAD_LEN_MASK) <<
PAYLOAD_LEN_SHIFT));
d_word0 = host_to_usrp_u32(word0);
@@ -200,6 +201,10 @@
return (usrp_to_host_u32(d_word0) & FL_DROPPED) >> FL_DROPPED_SHIFT;
}
+ int carrier_sense() const {
+ return (usrp_to_host_u32(d_word0) >> 15) & 1;
+ }
+
unsigned char *payload() {
return d_payload;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r6144 - in gnuradio/branches/developers/gnychis/inband/usrp/host: apps lib/inband,
gnychis <=