From 1cac345b5c7b6d576da87dc321af4223d515df51 Mon Sep 17 00:00:00 2001 From: Moritz Fischer Date: Thu, 16 Apr 2015 16:12:40 -0500 Subject: gps: gpsd: Adding gpsd_iface to interface with gpsd. The gpsd_iface class might be useful for more than just e3x0, it therefore belongs into lib/usrp instead of lib/usrp/e300. A new UHD component is being registered, to cope with the additional dependency. If libgps is not found, UHD and E300 will be compiled without GPS support. This has several consequences: - The E310 GPSDO should now work transparently over network - Users can use the GPS through gpsd for other applications *while* running UHD applications - We now have a dependency on libgps We need currently at least version 3.11 (while running 3.14), on the device. Older versions do work if 3.10 runs on both sides e.g Reviewed-by: Martin Braun Reviewed-by: Ashish Chaudhari Signed-off-by: Moritz Fischer --- host/lib/usrp/e300/e300_async_serial.hpp | 113 ------------------------------- 1 file changed, 113 deletions(-) delete mode 100644 host/lib/usrp/e300/e300_async_serial.hpp (limited to 'host/lib/usrp/e300/e300_async_serial.hpp') diff --git a/host/lib/usrp/e300/e300_async_serial.hpp b/host/lib/usrp/e300/e300_async_serial.hpp deleted file mode 100644 index fafc7de3d..000000000 --- a/host/lib/usrp/e300/e300_async_serial.hpp +++ /dev/null @@ -1,113 +0,0 @@ -// -// Copyright 2013-2014 Ettus Research LLC -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// - -#ifndef INCLUDED_ASYNC_SERIAL_HPP -#define INCLUDED_ASYNC_SERIAL_HPP - -#include -#include -#include -#include -#include -#include - -namespace uhd { namespace usrp { namespace gps { - -class async_serial : private boost::noncopyable -{ -public: - async_serial(); - ~async_serial(); - - async_serial(const std::string &node, const size_t baud_rate, - boost::asio::serial_port_base::parity opt_parity= - boost::asio::serial_port_base::parity( - boost::asio::serial_port_base::parity::none), - boost::asio::serial_port_base::character_size opt_csize= - boost::asio::serial_port_base::character_size(8), - boost::asio::serial_port_base::flow_control opt_flow= - boost::asio::serial_port_base::flow_control( - boost::asio::serial_port_base::flow_control::none), - boost::asio::serial_port_base::stop_bits opt_stop= - boost::asio::serial_port_base::stop_bits( - boost::asio::serial_port_base::stop_bits::one)); - - void open(const std::string& node, const size_t baud_rate, - boost::asio::serial_port_base::parity opt_parity= - boost::asio::serial_port_base::parity( - boost::asio::serial_port_base::parity::none), - boost::asio::serial_port_base::character_size opt_csize= - boost::asio::serial_port_base::character_size(8), - boost::asio::serial_port_base::flow_control opt_flow= - boost::asio::serial_port_base::flow_control( - boost::asio::serial_port_base::flow_control::none), - boost::asio::serial_port_base::stop_bits opt_stop= - boost::asio::serial_port_base::stop_bits( - boost::asio::serial_port_base::stop_bits::one)); - - bool is_open(void) const; - - bool error_status(void) const; - - void close(void); - - void write(const char *data, const size_t size); - void write(const std::vector &data); - - void write_string(const std::string &s); - - static const size_t READ_BUFFER_SIZE=512; - - void set_read_callback( - const boost::function& callback); - - void clear_callback(); - -private: // methods - void _do_read(); - - void _read_end( - const boost::system::error_code &error, - size_t bytes_transferred); - - void _do_write(); - - void _write_end(const boost::system::error_code &error); - - void _do_close(); - - void _set_error_status(const bool e); -private: // members - boost::asio::io_service _io; - boost::asio::serial_port _port; - boost::thread _background_thread; - bool _open; - bool _error; - mutable boost::mutex _error_mutex; - - std::vector _write_queue; - boost::shared_array _write_buffer; - size_t _write_buffer_size; - boost::mutex _write_queue_mutex; - char _read_buffer[READ_BUFFER_SIZE]; - - boost::function _callback; -}; - -}}} // namespace - -#endif //INCLUDED_ASYNC_SERIAL_HPP -- cgit v1.2.3