Confusion in SimpleStatus.get_current_bands return
Bruce A. Johnson
bjohnson at blueridgenetworks.com
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.
Code:
> band_list, count= status_obj.get_current_bands()
> logger.debug('band_list: {!r}, count: {!r}'.format(band_list, count))
Output:
> 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 https://keys.openpgp.org/
Reference
<https://lazka.github.io/pgi-docs/index.html#ModemManager-1.0/classes/SimpleStatus.html#ModemManager.SimpleStatus.get_current_bands>
> |get_current_bands|()
> Returns:
> bands: location for an array of |ModemManager.ModemBand|
> <https://lazka.github.io/pgi-docs/ModemManager-1.0/enums.html#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|
> <https://lazka.github.io/pgi-docs/ModemManager-1.0/enums.html#ModemManager.ModemBand>,
> *n_bands*: |int|
> <http://docs.python.org/3/library/functions.html#int>)
>
> Gets the currently used frequency bands.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/modemmanager-devel/attachments/20211214/7cf8d06c/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/modemmanager-devel/attachments/20211214/7cf8d06c/attachment.sig>
More information about the ModemManager-devel
mailing list