diff options
author | Trung Tran <trung.tran@ettus.com> | 2018-04-30 16:16:32 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-04-30 16:57:45 -0700 |
commit | d5da0f44d42f21b3f7fee4c439cc53319ccf15b7 (patch) | |
tree | eb94550c5c19c93a871efdd9057cf363b349b116 | |
parent | 2eab720f064102a5f7c2ae8903faf8c315a02a51 (diff) | |
download | uhd-d5da0f44d42f21b3f7fee4c439cc53319ccf15b7.tar.gz uhd-d5da0f44d42f21b3f7fee4c439cc53319ccf15b7.tar.bz2 uhd-d5da0f44d42f21b3f7fee4c439cc53319ccf15b7.zip |
mpm: types: Add getters for dst_ep and dts_block to SID
-rw-r--r-- | mpm/python/usrp_mpm/mpmtypes.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/mpm/python/usrp_mpm/mpmtypes.py b/mpm/python/usrp_mpm/mpmtypes.py index 32ee10fbb..87f44f46f 100644 --- a/mpm/python/usrp_mpm/mpmtypes.py +++ b/mpm/python/usrp_mpm/mpmtypes.py @@ -58,21 +58,29 @@ class SID(object): self.dst_ep = sid & 0xFF def set_src_addr(self, new_addr): - " Return source address (e.g. 02:30>00:01 -> 2) " + " Set source address (e.g. 02:30>00:01 -> 2) " self.src_addr = new_addr & 0xFF def set_dst_addr(self, new_addr): - " Return destination address (e.g. 02:30>00:01 -> 0) " + " Set destination address (e.g. 02:30>00:01 -> 0) " self.dst_addr = new_addr & 0xFF def set_src_ep(self, new_addr): - " Return source endpoint (e.g. 02:30>00:01 -> 0x30) " + " Set source endpoint (e.g. 02:30>00:01 -> 0x30) " self.src_ep = new_addr & 0xFF def set_dst_ep(self, new_addr): - " Return destination endpoint (e.g. 02:30>00:01 -> 0) " + " Set destination endpoint (e.g. 02:30>00:01 -> 0) " self.dst_ep = new_addr & 0xFF + def get_dst_block(self): + " Get destination block 2:30 or 2:31 --> 23 " + return (self.dst_addr<<4)&((self.dst_ep & 0xF0)>>4); + + def get_dst_ep_port(self): + " Get destination endpoint " + return (self.dst_ep & 0x0F); + def reversed(self): """ Return a reversed SID. |