Confusion in SimpleStatus.get_current_bands return

Bruce A. Johnson bjohnson at
Tue Dec 14 16:46:03 UTC 2021

I'm trying to obtain modem status information using the Python API, and 
I'm confused about the return values for the get_current_bands() method 
in the SimpleStatus object. My reading of the document leads me to 
expect a tuple containing an array and a count of the items in it, but 
I'm seeing a tuple containing a single enum value and a count greater 
than 1.


> band_list, count= status_obj.get_current_bands()
> logger.debug('band_list: {!r}, count: {!r}'.format(band_list, count))


> mmg[937]: MMGCmd status[425] band_list: <enum 469902384 of type ModemManager.ModemBand>, count: 21

My C skills aren't that great, but it looks to me like 
mm_simple_status_get_current_bands is returning the Right Stuff. I'm 
building ModemManager 1.18.4 in OpenEmbedded off of the Yocto dunfell 
branch. Does anyone have suggestions of what else I need to look at?

Bruce A. Johnson
Chantilly, Virginia
OpenPGP key ID: 296D1CD6F2B84CAB


> |get_current_bands|()
>     Returns: 	
>     bands: 	location for an array of |ModemManager.ModemBand|
>     <>
>     values. Do not free the returned value, it is owned by self.
>     n_bands: 	number of elements in bands.
>     Return type: 	(*bands*: |ModemManager.ModemBand|
>     <>,
>     *n_bands*: |int|
>     <>)
>     Gets the currently used frequency bands.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the ModemManager-devel mailing list