uqmi: fix acquiring PIN status
authorDaniel Golle <daniel@makrotopia.org>
Thu, 24 Mar 2022 18:40:14 +0000 (18:40 +0000)
committerDaniel Golle <daniel@makrotopia.org>
Thu, 24 Mar 2022 18:45:19 +0000 (18:45 +0000)
commitee7cb5e885118b78fb5f692d8ed6c93bb7e35853
treea691c0c7104511b70881654aecef56c01dcc5518
parentdc23df8a8ca728871d84f0a140f4b52c36b03f1d
uqmi: fix acquiring PIN status

Evaluating the return value of 'json_load' didn't work in the
intended way resulting in PIN status no longer being read on modems
where --get-pin-status doesn't fail.
Fix this by trying --get-pin-status first and checking if pin1_status
field exists in JSON, and if it doesn't try again with
--uim-get-sim-state.

Fixes: #9501
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh