summaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorNick Foster <nick@nerdnetworks.org>2010-08-13 13:07:56 -0700
committerNick Foster <nick@nerdnetworks.org>2010-08-13 13:07:56 -0700
commit5ab3f053529bb8d85a7f1ba9e1dd113c1f6eb813 (patch)
tree71f0ebf7479de5bbdcf5f6ea3c9e39c0190a5269 /host
parentd96e9f907e17900a59247ba6d28d33c26a1c4468 (diff)
downloaduhd-5ab3f053529bb8d85a7f1ba9e1dd113c1f6eb813.tar.gz
uhd-5ab3f053529bb8d85a7f1ba9e1dd113c1f6eb813.tar.bz2
uhd-5ab3f053529bb8d85a7f1ba9e1dd113c1f6eb813.zip
GPS interface works for Jackson Labs devices.
Diffstat (limited to 'host')
-rw-r--r--host/lib/usrp/usrp2/gps_ctrl.cpp4
-rw-r--r--host/lib/usrp/usrp2/usrp2_iface.cpp3
2 files changed, 4 insertions, 3 deletions
diff --git a/host/lib/usrp/usrp2/gps_ctrl.cpp b/host/lib/usrp/usrp2/gps_ctrl.cpp
index 5c015be14..7152800aa 100644
--- a/host/lib/usrp/usrp2/gps_ctrl.cpp
+++ b/host/lib/usrp/usrp2/gps_ctrl.cpp
@@ -42,9 +42,10 @@ public:
//TODO: try multiple baud rates (many GPS's are set up for 4800bps, you're fixed at 115200bps 8N1 right now)
//you have to poke registers in order to set baud rate, there's no dude/bro interface for it
- _iface->write_uart(GPS_UART, "HAAAY GUYYYYS\n");
+ _iface->write_uart(GPS_UART, "HAAAY GUYYYYS\n");
try {
reply = _iface->read_uart(GPS_UART, 20);
+ //std::cerr << "Got reply from GPS: " << reply.c_str() << " with length = " << reply.length() << std::endl;
} catch (std::runtime_error err) {
if(err.what() != std::string("usrp2 no control response")) throw; //sorry can't cope with that
else { //we don't actually have a GPS installed
@@ -57,6 +58,7 @@ public:
switch(gps_type) {
case GPS_TYPE_JACKSON_LABS:
+ std::cerr << "Found a Jackson Labs GPS" << std::endl;
//issue some setup stuff so it quits spewing data out when not asked to
//none of these should issue replies so we don't bother looking for it
_iface->write_uart(GPS_UART, "SYST:COMM:SER:");
diff --git a/host/lib/usrp/usrp2/usrp2_iface.cpp b/host/lib/usrp/usrp2/usrp2_iface.cpp
index 04b3b1e74..f4d354204 100644
--- a/host/lib/usrp/usrp2/usrp2_iface.cpp
+++ b/host/lib/usrp/usrp2/usrp2_iface.cpp
@@ -208,8 +208,7 @@ public:
UHD_ASSERT_THROW(ntohl(in_data.id) == USRP2_CTRL_ID_I_HELLA_READ_THAT_UART_DUDE);
//copy out the data
- std::string result;
- std::copy(in_data.data.uart_args.data, in_data.data.uart_args.data + num_bytes, result.begin());
+ std::string result((const char *)in_data.data.uart_args.data, (size_t)in_data.data.uart_args.bytes);
return result;
}