summaryrefslogtreecommitdiff
path: root/gr-uhd/swig
diff options
context:
space:
mode:
Diffstat (limited to 'gr-uhd/swig')
-rw-r--r--gr-uhd/swig/__init__.py6
-rw-r--r--gr-uhd/swig/uhd_swig.i10
2 files changed, 14 insertions, 2 deletions
diff --git a/gr-uhd/swig/__init__.py b/gr-uhd/swig/__init__.py
index d098a7b8a..b4045e77f 100644
--- a/gr-uhd/swig/__init__.py
+++ b/gr-uhd/swig/__init__.py
@@ -1,5 +1,5 @@
#
-# Copyright 2010-2011 Free Software Foundation, Inc.
+# Copyright 2010-2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -55,6 +55,10 @@ def _prepare_uhd_swig():
def __new__(self, *args): return str.__new__(self)
def __getitem__(self, key): return self.get(key)
def __setitem__(self, key, val): self.set(key, val)
+ def __init__(self, *args, **kwargs):
+ super(device_addr_t, self).__init__(*args)
+ if args and isinstance(args[0], device_addr_t):
+ for key in args[0].keys(): self[key] = args[0][key]
setattr(uhd_swig, 'device_addr_t', device_addr_t)
#make the streamer args take **kwargs on init
diff --git a/gr-uhd/swig/uhd_swig.i b/gr-uhd/swig/uhd_swig.i
index 0b2f9febc..729719dcb 100644
--- a/gr-uhd/swig/uhd_swig.i
+++ b/gr-uhd/swig/uhd_swig.i
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2010-2011 Free Software Foundation, Inc.
+ * Copyright 2010-2012 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -125,6 +125,14 @@ static const size_t ALL_MBOARDS = uhd::usrp::multi_usrp::ALL_MBOARDS;
%}
static const size_t ALL_MBOARDS;
+%{
+#include <uhd/version.hpp>
+std::string get_version_string(void){
+ return uhd::get_version_string();
+}
+%}
+std::string get_version_string(void);
+
#if SWIGGUILE
%scheme %{
(load-extension-global "libguile-gnuradio-uhd_swig" "scm_init_gnuradio_uhd_swig_module")