From 219687843979666df38c6b4b31b5f544282c6640 Mon Sep 17 00:00:00 2001 From: Brent Stapleton Date: Wed, 18 Oct 2017 11:17:51 -0700 Subject: mpm: server supports binary strings being sent across rpc --- mpm/python/usrp_mpm/rpc_server.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'mpm/python') 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__` 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): -- cgit v1.2.3