Question regarding set_profile_index_3gpp/get_profile_index_3gpp
Martin Maurer
martin.maurer at mmeacs.de
Mon Mar 3 13:44:38 UTC 2025
I "solved" the part with the exception with get_profile_index_3gpp():
When you fill in a index first into the struct, then you are able to
read it out afterwards.
Otherwise there is the exception which I think is ok, because the field
"index" is not (yet) existing.
Am 03.03.2025 um 10:34 schrieb Martin Maurer:
>
> Hello,
>
> with start_network I am using set_profile_index_3gpp (and just
> currently for testing get_profile_index_3gpp).
>
> I am using Python code, it could be something Python related:
>
> For setting some fields, I have e.g. this code:
>
> NetworkParameters = Qmi.MessageWdsStartNetworkInput()
>
> NetworkParameters.set_ip_family_preference(Qmi.WdsIpFamily(IpFamily))
>
> NetworkParameters.set_apn(APN)
> # NetworkParameters.set_profile_index_3gpp(0) // 0 ??? -> see
> below
>
> which prepares a struct NetworkParameters to be used with start_network.
>
> I assumed I just can use:
>
> mytestindex = NetworkParameters.get_profile_index_3gpp()
>
> but this gives me the following exception:
>
> Exception in module_change_cb callback: qmi_core_error_quark: Field
> 'Profile Index 3GPP' was not found in the message (5)
>
> Mentioned field 'Profile Index 3GPP' looks curious, field name with
> spaces inside?
>
> When looking at
>
> https://lazka.github.io/pgi-docs/Qmi-1.0/classes/MessageWdsStartNetworkInput.html#Qmi.MessageWdsStartNetworkInput.get_profile_index_3gpp
>
> it says:
>
> value_profile_index_3gpp a placeholder for the output #guint8, or
> |None| <https://docs.python.org/3/library/constants.html#None> if not
> required.
>
> 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?
>
> https://lazka.github.io/pgi-docs/Qmi-1.0/classes/MessageWdsStartNetworkInput.html#Qmi.MessageWdsStartNetworkInput.set_profile_index_3gpp
>
> tells me I can use value_profile_index_3gpp as input parameter.
>
> When e.g. using
>
> # qmicli -p -d /dev/cdc-wdm0 --wds-get-profile-list=3gpp
> Profile list retrieved:
> [1] 3gpp -
> APN: 'internet.telekom'
> APN type: 'default'
> PDP type: 'ipv4-or-ipv6'
> PDP context number: '1'
> Username: ''
> Password: ''
> Auth: 'none'
> No roaming: 'no'
> APN disabled: 'no'
> #
>
> I assume [1] corresponds to the above value_profile_index_3gpp. So
> minimum is 1, because list starts with [1]?
>
> But I tried value 0 is also accepted, no exception. Is value 0
> something special, not documented, perhaps not using something from
> profile list?
>
> And when just using
>
> NetworkParameters = Qmi.MessageWdsStartNetworkInput()
>
> is then the value 0 the default value? Or 1? Or None? Undefined?
>
> My aim would (still) be to give all parameters needed for a connection
> completely in/via NetworkParameters,
>
> so set APN, PDP Type, ... in NetworkParameters and just use them. No
> side effects via profile list, which is perhaps updated by something else.
>
> 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".
>
> But how to select if I want to use cid=1 or e.g. cid=2 or anything else.
>
> And must my used parameters fit to the parameters used to build up
> cid=1? And when conflicting: Call Failed?
>
> ( error: couldn't start network: QMI protocol error (14): 'CallFailed' )
>
> Creating a connection is such a fundamental action. I could not
> understand that it makes so much problem on my side...
>
> I assume I am missing something important or using something which I
> shall not use or in a different way.
>
> Many many thanks for all your help!
>
> Best regards,
>
> Martin
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libqmi-devel/attachments/20250303/c962e1a0/attachment.htm>
More information about the libqmi-devel
mailing list