diff options
| author | Brent Stapleton <brent.stapleton@ettus.com> | 2017-10-18 11:17:51 -0700 | 
|---|---|---|
| committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:04:03 -0800 | 
| commit | 219687843979666df38c6b4b31b5f544282c6640 (patch) | |
| tree | f68b61a2d83ef4ccfad259bdf48673c40698bb6b /mpm/python | |
| parent | 89420d97b9e4f06f2f0ac88da082b9ea3b2c7400 (diff) | |
| download | uhd-219687843979666df38c6b4b31b5f544282c6640.tar.gz uhd-219687843979666df38c6b4b31b5f544282c6640.tar.bz2 uhd-219687843979666df38c6b4b31b5f544282c6640.zip  | |
mpm: server supports binary strings being sent across rpc
Diffstat (limited to 'mpm/python')
| -rw-r--r-- | mpm/python/usrp_mpm/rpc_server.py | 9 | 
1 files changed, 7 insertions, 2 deletions
diff --git a/mpm/python/usrp_mpm/rpc_server.py b/mpm/python/usrp_mpm/rpc_server.py index d2635c7c2..271f707e3 100644 --- a/mpm/python/usrp_mpm/rpc_server.py +++ b/mpm/python/usrp_mpm/rpc_server.py @@ -66,7 +66,7 @@ class MPMServer(RPCServer):          # add public dboard methods in `db_<slot>_` namespace          for db_slot, dboard in enumerate(mgr.dboards):              self._update_component_commands(dboard, 'db_' + str(db_slot) + '_', '_db_methods') -        super(MPMServer, self).__init__(*args, **kwargs) +        super(MPMServer, self).__init__(*args, pack_params={'use_bin_type': True}, **kwargs)      def _check_token_valid(self, token):          """ @@ -74,9 +74,14 @@ class MPMServer(RPCServer):          - The device is currently claimed          - The claim token matches the one passed in          """ +        try: +            token = bytes(token, 'ascii') +        except TypeError: +            pass +          return self._state.claim_status.value and \                  len(token) == TOKEN_LEN and \ -                self._state.claim_token.value == bytes(token, 'ascii') +                self._state.claim_token.value == token      def _update_component_commands(self, component, namespace, storage):  | 
