The return value of mbim-network status is unexpected
Run "mbim-network status" to get the current state:
$ mbim-network /dev/cdc-wdm0 status
Loading profile at /etc/mbim-network.conf...
APN: 3gnet
APN auth protocol: unset
APN user: unset
APN password: unset
mbim-proxy: yes
Getting status with 'mbimcli -d /dev/cdc-wdm0 --query-connection-state --device-open-proxy'...
Status: activated
The status is activated, but the return value of the command is not 0:
$ echo $?
64
Here is the code snippet in mbim-network:
CONN=echo "$STATUS_OUT" | sed -n "s/.*Activation state:.*'\(.*\)'.*/\1/p"
if [ -z "$CONN" ]; then
echo "error: couldn't get connection status" 1>&2
exit 2
else
echo "Status: $CONN"
if [ "$CONN" != "connected" ]; then
exit 64
fi
fi
But seems there is no "connected" status in MbimActivationState defined in src/libmbim-glib/mbim-enums.h:
typedef enum { /< since=1.0 >/
MBIM_ACTIVATION_STATE_UNKNOWN = 0,
MBIM_ACTIVATION_STATE_ACTIVATED = 1,
MBIM_ACTIVATION_STATE_ACTIVATING = 2,
MBIM_ACTIVATION_STATE_DEACTIVATED = 3,
MBIM_ACTIVATION_STATE_DEACTIVATING = 4
} MbimActivationState;