[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 17/21: controlport: android: cleaning up; b
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 17/21: controlport: android: cleaning up; better logs; help to support android. |
Date: |
Sat, 9 May 2015 14:05:37 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
trondeau pushed a commit to branch android
in repository gnuradio.
commit e40a5e24b8c0e483e76083e379cd43a7bdb8a1cd
Author: Tom Rondeau <address@hidden>
Date: Tue May 5 10:10:19 2015 -0400
controlport: android: cleaning up; better logs; help to support android.
---
.../include/gnuradio/thrift_application_base.h | 6 +-
.../include/gnuradio/thrift_server_template.h | 64 ++++++++++++----------
.../controlport/thrift/rpcpmtconverters_thrift.cc | 2 +-
.../controlport/thrift/rpcserver_booter_thrift.cc | 2 +-
4 files changed, 39 insertions(+), 35 deletions(-)
diff --git a/gnuradio-runtime/include/gnuradio/thrift_application_base.h
b/gnuradio-runtime/include/gnuradio/thrift_application_base.h
index 4af5e88..967c609 100644
--- a/gnuradio-runtime/include/gnuradio/thrift_application_base.h
+++ b/gnuradio-runtime/include/gnuradio/thrift_application_base.h
@@ -197,14 +197,11 @@ thrift_application_base<TserverBase,
TserverClass>::thrift_application_base(Tser
{
gr::configure_default_loggers(d_logger, d_debug_logger, "controlport");
d_application = _app;
- //GR_LOG_DEBUG(d_debug_logger, "thrift_application_base: ctor");
}
template<typename TserverBase, typename TserverClass>
void thrift_application_base<TserverBase, TserverClass>::start_application()
{
- //std::cerr << "thrift_application_base: start_application" << std::endl;
-
unsigned int max_init_attempts = \
static_cast<unsigned int>(gr::prefs::singleton()->get_long("thrift",
"init_attempts",
d_default_max_init_attempts));
@@ -220,7 +217,8 @@ void thrift_application_base<TserverBase,
TserverClass>::start_application()
}
if(!app_started) {
- std::cerr << "thrift_application_base::start_application(), timeout
waiting to port number might have failed?" << std::endl;
+ GR_LOG_WARN("thrift", "thrift_application_base::start_application(), "
+ "timeout waiting to port number might have failed?");
}
p_impl->d_application_initilized = true;
diff --git a/gnuradio-runtime/include/gnuradio/thrift_server_template.h
b/gnuradio-runtime/include/gnuradio/thrift_server_template.h
index b8f5448..e2d6f63 100644
--- a/gnuradio-runtime/include/gnuradio/thrift_server_template.h
+++ b/gnuradio-runtime/include/gnuradio/thrift_server_template.h
@@ -80,13 +80,13 @@ private:
};
template<typename TserverBase, typename TserverClass, typename TImplClass>
-thrift_server_template<TserverBase, TserverClass,
TImplClass>::thrift_server_template
-(TImplClass* _this) : thrift_application_base<TserverBase, TImplClass>(_this),
-d_handler(new TserverClass()),
-d_processor(new GNURadio::ControlPortProcessor(d_handler)),
-d_serverTransport(),
-d_transportFactory(),
-d_protocolFactory(new thrift::protocol::TBinaryProtocolFactory())
+thrift_server_template<TserverBase, TserverClass,
TImplClass>::thrift_server_template(TImplClass* _this)
+ : thrift_application_base<TserverBase, TImplClass>(_this),
+ d_handler(new TserverClass()),
+ d_processor(new GNURadio::ControlPortProcessor(d_handler)),
+ d_serverTransport(),
+ d_transportFactory(),
+ d_protocolFactory(new thrift::protocol::TBinaryProtocolFactory())
{
gr::logger_ptr logger, debug_logger;
gr::configure_default_loggers(logger, debug_logger, "controlport");
@@ -101,39 +101,45 @@ d_protocolFactory(new
thrift::protocol::TBinaryProtocolFactory())
// Collect configuration options from the Thrift config file;
// defaults if the config file doesn't exist or list the specific
// options.
- port = static_cast<unsigned int>(gr::prefs::singleton()->get_long("thrift",
"port",
-
thrift_application_base<TserverBase, TImplClass>::d_default_thrift_port));
- nthreads = static_cast<unsigned
int>(gr::prefs::singleton()->get_long("thrift", "nthreads",
-
thrift_application_base<TserverBase,
TImplClass>::d_default_num_thrift_threads));
- buffersize = static_cast<unsigned
int>(gr::prefs::singleton()->get_long("thrift", "buffersize",
-
thrift_application_base<TserverBase,
TImplClass>::d_default_thrift_buffer_size));
+ port = static_cast<unsigned int>
+ (gr::prefs::singleton()->get_long("thrift", "port",
+ thrift_application_base<TserverBase,
+ TImplClass>::d_default_thrift_port));
+ nthreads = static_cast<unsigned int>
+ (gr::prefs::singleton()->get_long("thrift", "nthreads",
+ thrift_application_base<TserverBase,
+
TImplClass>::d_default_num_thrift_threads));
+ buffersize = static_cast<unsigned int>
+ (gr::prefs::singleton()->get_long("thrift", "buffersize",
+ thrift_application_base<TserverBase,
+
TImplClass>::d_default_thrift_buffer_size));
d_serverTransport.reset(new thrift::transport::TServerSocket(port));
d_transportFactory.reset(new
thrift_server_template::TBufferedTransportFactory(buffersize));
-
if(nthreads <= 1) {
- // "Thrift: Single-threaded server"
- //std::cout << "Thrift Single-threaded server" << std::endl;
- thrift_application_base<TserverBase, TImplClass>::d_thriftserver.reset(
- new thrift::server::TSimpleServer(d_processor, d_serverTransport,
d_transportFactory, d_protocolFactory));
+ // "Thrift: Single-threaded server"
+ //std::cout << "Thrift Single-threaded server" << std::endl;
+ thrift_application_base<TserverBase, TImplClass>::d_thriftserver.reset
+ (new thrift::server::TSimpleServer(d_processor, d_serverTransport,
+ d_transportFactory,
d_protocolFactory));
}
else {
- //std::cout << "Thrift Multi-threaded server : " << d_nthreads <<
std::endl;
- boost::shared_ptr<thrift::concurrency::ThreadManager> threadManager(
-
thrift::concurrency::ThreadManager::newSimpleThreadManager(nthreads));
+ //std::cout << "Thrift Multi-threaded server : " << d_nthreads <<
std::endl;
+ boost::shared_ptr<thrift::concurrency::ThreadManager> threadManager
+ (thrift::concurrency::ThreadManager::newSimpleThreadManager(nthreads));
- threadManager->threadFactory(
- boost::shared_ptr<thrift::concurrency::PlatformThreadFactory>(
- new thrift::concurrency::PlatformThreadFactory()));
+ threadManager->threadFactory
+ (boost::shared_ptr<thrift::concurrency::PlatformThreadFactory>
+ (new thrift::concurrency::PlatformThreadFactory()));
- threadManager->start();
+ threadManager->start();
- thrift_application_base<TserverBase, TImplClass>::d_thriftserver.reset(
- new thrift::server::TThreadPoolServer(d_processor, d_serverTransport,
- d_transportFactory,
d_protocolFactory,
- threadManager));
+ thrift_application_base<TserverBase, TImplClass>::d_thriftserver.reset
+ (new thrift::server::TThreadPoolServer(d_processor, d_serverTransport,
+ d_transportFactory,
d_protocolFactory,
+ threadManager));
}
}
diff --git a/gnuradio-runtime/lib/controlport/thrift/rpcpmtconverters_thrift.cc
b/gnuradio-runtime/lib/controlport/thrift/rpcpmtconverters_thrift.cc
index 19da05f..cc8804f 100644
--- a/gnuradio-runtime/lib/controlport/thrift/rpcpmtconverters_thrift.cc
+++ b/gnuradio-runtime/lib/controlport/thrift/rpcpmtconverters_thrift.cc
@@ -162,7 +162,7 @@ rpcpmtconverter::to_pmt_int_f::operator()(const
GNURadio::Knob& knob)
pmt::pmt_t
rpcpmtconverter::to_pmt_long_f::operator()(const GNURadio::Knob& knob)
{
- return pmt::mp(knob.value.a_long);
+ return pmt::from_long(knob.value.a_long);
}
pmt::pmt_t
diff --git a/gnuradio-runtime/lib/controlport/thrift/rpcserver_booter_thrift.cc
b/gnuradio-runtime/lib/controlport/thrift/rpcserver_booter_thrift.cc
index 1d6cafe..3284fa0 100644
--- a/gnuradio-runtime/lib/controlport/thrift/rpcserver_booter_thrift.cc
+++ b/gnuradio-runtime/lib/controlport/thrift/rpcserver_booter_thrift.cc
@@ -124,7 +124,7 @@ bool thrift_application_base<rpcserver_base,
rpcserver_booter_thrift>::applicati
set_endpoint(endpoint);
- GR_LOG_INFO(d_logger, "Apache Thrift: " + endpoint);
+ GR_INFO("thrift_application_base", "Apache Thrift: " + endpoint);
d_thirft_is_running = true;
result = true;
}
- [Commit-gnuradio] [gnuradio] 01/21: cmake: android: adding exceptions and atomic to Boost deps; ordering in this patch is important., (continued)
- [Commit-gnuradio] [gnuradio] 01/21: cmake: android: adding exceptions and atomic to Boost deps; ordering in this patch is important., git, 2015/05/09
- [Commit-gnuradio] [gnuradio] 10/21: runtime: android: need to use a usable, writable location for android apps, so use the tmp path that we set up to point to the app's home directory., git, 2015/05/09
- [Commit-gnuradio] [gnuradio] 02/21: logger: android: adding Android log functions for different logging levels., git, 2015/05/09
- [Commit-gnuradio] [gnuradio] 07/21: runtime: trying to use ANDROID to define certain behavior, git, 2015/05/09
- [Commit-gnuradio] [gnuradio] 16/21: build: fixing complaints for static builds against libuhd.a., git, 2015/05/09
- [Commit-gnuradio] [gnuradio] 06/21: volk: using hypot instead of cabsf., git, 2015/05/09
- [Commit-gnuradio] [gnuradio] 04/21: runtime: android: issues related to vmcircbuf; only mmap_tmpfile version working currently., git, 2015/05/09
- [Commit-gnuradio] [gnuradio] 09/21: fft: defined a setting for the FFTW plan options if android or not., git, 2015/05/09
- [Commit-gnuradio] [gnuradio] 05/21: fft: android: problems with wisdom files and MEASURE version of FFTW. Defaulting to suboptimal ESTIMATE until we figure it out., git, 2015/05/09
- [Commit-gnuradio] [gnuradio] 13/21: runtime: moved global block registry to a static get function., git, 2015/05/09
- [Commit-gnuradio] [gnuradio] 17/21: controlport: android: cleaning up; better logs; help to support android.,
git <=
- [Commit-gnuradio] [gnuradio] 15/21: controlport: fixing complaints about no non-virtual dtor., git, 2015/05/09
- [Commit-gnuradio] [gnuradio] 03/21: runtime: android: Android does not support pthread_setaffinity_np; turned this into a nop call., git, 2015/05/09
- [Commit-gnuradio] [gnuradio] 18/21: controlport: better handling of Thrift checks for cross-compiling., git, 2015/05/09
- [Commit-gnuradio] [gnuradio] 14/21: controlport: build: allowing ControlPort and probes in static builds., git, 2015/05/09
- [Commit-gnuradio] [gnuradio] 08/21: cmake: changed to using C checks for headers instead of C++., git, 2015/05/09
- [Commit-gnuradio] [gnuradio] 11/21: runtime: android: more conversion of statics vars to static functions., git, 2015/05/09
- [Commit-gnuradio] [gnuradio] 20/21: runtime: android: setting better path for prefs files on Android., git, 2015/05/09
- [Commit-gnuradio] [gnuradio] 21/21: runtime: android: tweaking vmcircbuf setup for Android., git, 2015/05/09
- [Commit-gnuradio] [gnuradio] 19/21: android: cmake: prioritize ANDROID_STANDALONE_TOOLCHAIN over ANDROID_NDK., git, 2015/05/09
- [Commit-gnuradio] [gnuradio] 12/21: cmake: android: adding toolchain file for building., git, 2015/05/09