<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>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.</p>
<p>Code:<br>
</p>
<pre><blockquote type="cite"><pre style="background-color:#141414;color:#f8f8f8;font-family:'JetBrains Mono',monospace;font-size:9.8pt;">band_list, count <span style="color:#cda869;">= </span>status_obj.<span style="color:#dad085;">get_current_bands</span>()
logger.<span style="color:#dad085;">debug</span>(<span style="color:#8f9d6a;">'band_list: {!r}, count: {!r}'</span>.<span style="color:#dad085;">format</span>(band_list, count))
</pre></blockquote></pre>
<p>Output:</p>
<pre><blockquote type="cite"><pre>mmg[937]: MMGCmd status[425] band_list: <enum 469902384 of type ModemManager.ModemBand>, count: 21</pre></blockquote></pre>
<p>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?</p>
<pre class="moz-signature" cols="72">--
Bruce A. Johnson
Chantilly, Virginia
OpenPGP key ID: 296D1CD6F2B84CAB <a class="moz-txt-link-freetext" href="https://keys.openpgp.org/">https://keys.openpgp.org/</a>
</pre>
<p><a moz-do-not-send="true"
href="https://lazka.github.io/pgi-docs/index.html#ModemManager-1.0/classes/SimpleStatus.html#ModemManager.SimpleStatus.get_current_bands">Reference</a><br>
</p>
<p>
<blockquote type="cite">
<dl class="method">
<dt id="ModemManager.SimpleStatus.get_current_bands">
<code class="descname">get_current_bands</code><span
class="sig-paren">(</span><span class="sig-paren">)</span></dt>
<dd>
<table class="docutils field-list" frame="void" rules="none">
<colgroup><col class="field-name">
<col class="field-body">
</colgroup><tbody valign="top">
<tr class="field-odd field">
<th class="field-name">Returns:</th>
<td class="field-body">
<table class="docutils field-list" frame="void"
rules="none">
<colgroup><col class="field-name">
<col class="field-body">
</colgroup><tbody valign="top">
<tr class="field-odd field">
<th class="field-name">bands:</th>
<td class="field-body">location for an array
of <a class="reference internal"
href="https://lazka.github.io/pgi-docs/ModemManager-1.0/enums.html#ModemManager.ModemBand"
title="ModemManager.ModemBand"><code
class="xref py py-obj docutils literal
notranslate"><span class="pre">ModemManager.ModemBand</span></code></a>
values. Do not free the
returned value, it is owned by <cite>self</cite>.</td>
</tr>
<tr class="field-even field">
<th class="field-name">n_bands:</th>
<td class="field-body">number of elements in <cite>bands</cite>.</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr class="field-odd field">
<th class="field-name">Return type:</th>
<td class="field-body">(<strong>bands</strong>: <a
class="reference internal"
href="https://lazka.github.io/pgi-docs/ModemManager-1.0/enums.html#ModemManager.ModemBand"
title="ModemManager.ModemBand"><code class="xref
py py-obj docutils literal notranslate"><span
class="pre">ModemManager.ModemBand</span></code></a>,
<strong>n_bands</strong>: <a class="reference
external"
href="http://docs.python.org/3/library/functions.html#int"
title="(in Python v3.9)" target="_parent"><code
class="xref py py-obj docutils literal
notranslate pgi-docs-external"><span class="pre">int</span></code></a>)</td>
</tr>
</tbody>
</table>
<p>Gets the currently used frequency bands.</p>
</dd>
</dl>
</blockquote>
<br>
</p>
</body>
</html>