<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>I "solved" the part with the exception with
      get_profile_index_3gpp():</p>
    <p>When you fill in a index first into the struct, then you are able
      to read it out afterwards.</p>
    <p>Otherwise there is the exception which I think is ok, because the
      field "index" is not (yet) existing.</p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">Am 03.03.2025 um 10:34 schrieb Martin
      Maurer:<br>
    </div>
    <blockquote type="cite"
      cite="mid:c4167582-5e5c-4e81-869d-21d84d45b753@mmeacs.de">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <p>Hello,</p>
      <p>with start_network I am using set_profile_index_3gpp (and just
        currently for testing get_profile_index_3gpp).</p>
      <p>I am using Python code, it could be something Python related:</p>
      <p>For setting some fields, I have e.g. this code:</p>
      <p><span data-teams="true"> </span></p>
      <p>NetworkParameters = Qmi.MessageWdsStartNetworkInput()</p>
      <p>NetworkParameters.set_ip_family_preference(Qmi.WdsIpFamily(IpFamily))</p>
      <p>NetworkParameters.set_apn(APN)<br>
        #  NetworkParameters.set_profile_index_3gpp(0)        // 0 ???
        -> see below<br>
      </p>
      <p>which prepares a struct <span data-teams="true">NetworkParameters
          to be used with start_network.</span></p>
      <p><span data-teams="true">I assumed I just can use:</span></p>
      <p><span data-teams="true"> </span></p>
      <p>mytestindex = NetworkParameters.get_profile_index_3gpp()</p>
      <p>but this gives me the following exception:<br>
      </p>
      <p>Exception in module_change_cb callback: qmi_core_error_quark:
        Field 'Profile Index 3GPP' was not found in the message (5)</p>
      <p><span data-teams="true"><span data-teams="true">Mentioned field
            'Profile Index 3GPP' looks curious, field name with spaces
            inside?<br>
          </span></span></p>
      <p><span data-teams="true"><span data-teams="true">When looking at
            <br>
          </span></span></p>
      <p><span data-teams="true"><span data-teams="true"><a
              class="moz-txt-link-freetext"
href="https://lazka.github.io/pgi-docs/Qmi-1.0/classes/MessageWdsStartNetworkInput.html#Qmi.MessageWdsStartNetworkInput.get_profile_index_3gpp"
              moz-do-not-send="true">https://lazka.github.io/pgi-docs/Qmi-1.0/classes/MessageWdsStartNetworkInput.html#Qmi.MessageWdsStartNetworkInput.get_profile_index_3gpp</a></span></span></p>
      <p><span data-teams="true"><span data-teams="true">it says:</span></span></p>
      <p>value_profile_index_3gpp a placeholder for the output #guint8,
        or <a class="reference external"
          href="https://docs.python.org/3/library/constants.html#None"
          title="(in Python v3.13)" moz-do-not-send="true"><code
            class="xref py py-obj docutils literal notranslate"><span
              class="pre">None</span></code></a> if not required.</p>
      <p>What is this "None" for? When I call it, I want get it,
        otherwise I don't call it? Do I need to give something as input
        parameter?</p>
      <p><a class="moz-txt-link-freetext"
href="https://lazka.github.io/pgi-docs/Qmi-1.0/classes/MessageWdsStartNetworkInput.html#Qmi.MessageWdsStartNetworkInput.set_profile_index_3gpp"
          moz-do-not-send="true">https://lazka.github.io/pgi-docs/Qmi-1.0/classes/MessageWdsStartNetworkInput.html#Qmi.MessageWdsStartNetworkInput.set_profile_index_3gpp</a></p>
      <p>tells me I can use value_profile_index_3gpp as input parameter.</p>
      <p>When e.g. using <br>
      </p>
      <p><span data-teams="true"># qmicli -p -d /dev/cdc-wdm0
          --wds-get-profile-list=3gpp<br>
          Profile list retrieved:<br>
          Â Â Â Â Â Â Â  [1] 3gpp -<br>
          Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  APN: 'internet.telekom'<br>
          Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  APN type: 'default'<br>
          Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  PDP type: 'ipv4-or-ipv6'<br>
          Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  PDP context number: '1'<br>
          Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Username: ''<br>
          Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Password: ''<br>
          Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  Auth: 'none'<br>
          Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  No roaming: 'no'<br>
          Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  APN disabled: 'no'<br>
          #<br>
          <br>
          I assume [1] corresponds to the above </span><span
          data-teams="true"><span data-teams="true">value_profile_index_3gpp.
            So minimum is 1, because list starts with [1]?<br>
          </span></span></p>
      <p><span data-teams="true"><span data-teams="true">But I tried
            value 0 is also accepted, no exception. Is value 0 something
            special, not documented, perhaps not using something from
            profile list? <br>
          </span></span></p>
      <p><span data-teams="true"><span data-teams="true">And when just
            using</span></span></p>
      <p><span data-teams="true">NetworkParameters =
          Qmi.MessageWdsStartNetworkInput()</span></p>
      <p><span data-teams="true">is then the value 0 the default value?
          Or 1? Or None? Undefined?</span></p>
      <p><span data-teams="true">My aim would (still) be to give all
          parameters needed for a connection completely in/via </span><span
          data-teams="true"><span data-teams="true"><span
              data-teams="true">NetworkParameters,</span></span></span></p>
      <p><span data-teams="true"><span data-teams="true"><span
              data-teams="true">so set APN, PDP Type, ... in </span></span></span><span
          data-teams="true"><span data-teams="true"><span
              data-teams="true"></span><span data-teams="true"><span
                data-teams="true"><span data-teams="true">NetworkParameters
                  and just use them. No side effects via profile list,
                  which is perhaps updated by something else.<br>
                </span></span></span></span></span></p>
      <p><span data-teams="true"><span data-teams="true"><span
              data-teams="true"><span data-teams="true"><span
                  data-teams="true">But e.g. the PDP context number
                  cannot be set via libqmi? This is "cid"? I was told
                  cid=1 is used for an "initial attach".</span></span></span></span></span></p>
      <p><span data-teams="true"><span data-teams="true"><span
              data-teams="true"><span data-teams="true"><span
                  data-teams="true">But how  to select if I want to use
                  cid=1 or e.g. cid=2 or anything else.</span></span></span></span></span></p>
      <p><span data-teams="true"><span data-teams="true"><span
              data-teams="true"><span data-teams="true"><span
                  data-teams="true">And must my used parameters fit to
                  the parameters used to build up cid=1? And when
                  conflicting: Call Failed?</span></span></span></span></span></p>
      <p><span data-teams="true"><span data-teams="true"><span
              data-teams="true"><span data-teams="true"><span
                  data-teams="true">( </span></span></span></span></span><span
          data-teams="true">error: couldn't start network: QMI protocol
          error (14): 'CallFailed' )<br>
        </span></p>
      <p><span data-teams="true"><span data-teams="true"><span
              data-teams="true"><span data-teams="true"><span
                  data-teams="true">Creating a connection is such a
                  fundamental action. I could not understand that it
                  makes so much problem on my side...</span></span></span></span></span></p>
      <p><span data-teams="true"><span data-teams="true"><span
              data-teams="true"><span data-teams="true"><span
                  data-teams="true">I assume I am missing something
                  important or using something which I shall not use or
                  in a different way.<br>
                </span></span></span></span></span></p>
      <p><span data-teams="true"><span data-teams="true"><span
              data-teams="true"><span data-teams="true"><span
                  data-teams="true">Many many thanks for all your help!</span></span></span></span></span></p>
      <p><span data-teams="true"><span data-teams="true"><span
              data-teams="true"><span data-teams="true"><span
                  data-teams="true">Best regards,</span></span></span></span></span></p>
      <p><span data-teams="true"><span data-teams="true"><span
              data-teams="true"><span data-teams="true"><span
                  data-teams="true">Martin<br>
                </span></span></span></span></span></p>
      <p><span data-teams="true"><span data-teams="true"><br>
          </span></span></p>
      <p><br>
      </p>
      <p><br>
      </p>
    </blockquote>
  </body>
</html>