summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/python/gnuradio/ctrlport/IceRadioClient.py
diff options
context:
space:
mode:
authorTom Rondeau <tom@trondeau.com>2014-08-08 11:28:05 -0400
committerTom Rondeau <tom@trondeau.com>2014-08-08 16:37:43 -0400
commit3d5df0ddd3aa8d5a94285b95f487747f25d4ee06 (patch)
tree715007cafdc7ac2b6eb954562be0b3a4a4612e2e /gnuradio-runtime/python/gnuradio/ctrlport/IceRadioClient.py
parent3d18f70c66c974a82c5096acc4cbd37a47b6b55c (diff)
controlport: removing use of ice for a controlport rpc.
This effectively disables the use of ControlPort for now until we build in a new middleware layer. The ControlPort API and interfaces exist but will function as nops for now.
Diffstat (limited to 'gnuradio-runtime/python/gnuradio/ctrlport/IceRadioClient.py')
-rw-r--r--gnuradio-runtime/python/gnuradio/ctrlport/IceRadioClient.py104
1 files changed, 0 insertions, 104 deletions
diff --git a/gnuradio-runtime/python/gnuradio/ctrlport/IceRadioClient.py b/gnuradio-runtime/python/gnuradio/ctrlport/IceRadioClient.py
deleted file mode 100644
index 87998f7911..0000000000
--- a/gnuradio-runtime/python/gnuradio/ctrlport/IceRadioClient.py
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2012 Free Software Foundation, Inc.
-#
-# This file is part of GNU Radio
-#
-# GNU Radio 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, or (at your option)
-# any later version.
-#
-# GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street,
-# Boston, MA 02110-1301, USA.
-#
-
-import Ice, Glacier2
-from PyQt4 import QtGui, QtCore
-import sys, time, Ice
-from gnuradio import gr
-from gnuradio.ctrlport import GNURadio
-
-class IceRadioClient(Ice.Application):
- def __init__(self, parentClass):
- self.parentClass = parentClass
-
- def getRadio(self, host, port):
- radiostr = "gnuradio -t:tcp -h " + host + " -p " + port + " -t 3000"
- base = self.communicator().stringToProxy(radiostr).ice_twoway()
- radio = GNURadio.ControlPortPrx.checkedCast(base)
-
- if not radio:
- sys.stderr.write("{0} : invalid proxy.\n".format(args[0]))
- return None
-
- return radio
-
- def run(self,args):
- if len(args) < 2:
- print "useage: [glacierinstance glacierhost glacierport] host port"
- return
- if len(args) == 8:
- self.useglacier = True
- guser = args[1]
- gpass = args[2]
- ginst = args[3]
- ghost = args[4]
- gport = args[5]
- host = args[6]
- port = args[7]
- else:
- self.useglacier = False
- host = args[1]
- port = args[2]
- if(port == "-p"):
- port = args[3]
-
- if self.useglacier:
- gstring = ginst + "/router -t:tcp -h " + ghost + " -p " + gport
- print "GLACIER: {0}".format(gstring)
-
- setrouter = Glacier2.RouterPrx.checkedCast(self.communicator().stringToProxy(gstring))
- self.communicator().setDefaultRouter(setrouter)
- defaultRouter = self.communicator().getDefaultRouter()
- #defaultRouter = self.communicator().stringToProxy(gstring)
- if not defaultRouter:
- print self.appName() + ": no default router set"
- return 1
- else:
- print str(defaultRouter)
- router = Glacier2.RouterPrx.checkedCast(defaultRouter)
- if not router:
- print self.appName() + ": configured router is not a Glacier2 router"
- return 1
-
- while True:
- print "This demo accepts any user-id / password combination."
- if not guser == '' and not gpass == '':
- id = guser
- pw = gpass
- else:
- id = raw_input("user id: ")
- pw = raw_input("password: ")
-
- try:
- router.createSession(id, pw)
- break
- except Glacier2.PermissionDeniedException, ex:
- print "permission denied:\n" + ex.reason
-
- radio = self.getRadio(host, port)
- if(radio is None):
- return 1
-
- app = QtGui.QApplication(sys.argv)
- ex = self.parentClass(radio, port, self)
- ex.show();
- app.exec_()