Forum: GNU Radio How to display mux value?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Pawel Koszut (Guest)
on 2007-04-28 17:59
(Received via mailing list)
Hi all !

Who knows how to display mux value ?

print "mux =",

displays negative values, for example -0xf0f0f0e
How to interpret negative value ?
and how to interpret 7 digit hex number istead of 8 digit.

Steven C. (Guest)
on 2007-05-08 18:48
(Received via mailing list)
(Sorry for sending this twice, Pawel, I forgot to send to list. Also I
corrected a minor error I made)

Hi Pawel-

You've probably figured this out by now, but I ran into the same thing
yesterday. Here's what I did.

in_mux_value = usrp.determine_rx_mux_value(self.usrp_in,
print "RX mux value: 0x%08x" % (0xFFFFFFFFL & long(in_mux_value))

The determine_*x_mux_value() method returns a (32 bit) int, but if the
is set, for example 0xF0F0F0F2, python thinks it's a negative number,
screws up the printing. Cast it to a long and mask off the bottom 32

Hope that helps.

Pawel Koszut (Guest)
on 2007-05-22 19:42
(Received via mailing list)
Hi Steven,

It works fine !
Together with Charles S.'s suggestions, you helped me with three
approaches :
m = usrp.determine_rx_mux_value(self.u, options.rx_subdev_spec)
print "mux1 = %x" %(0x100000000 + m)
print "mux2 = ",hex(0x100000000 + m)
print "mux3 = 0x%08x" % (0xFFFFFFFFL & long(m))

Thanks for both of you,

This topic is locked and can not be replied to.