Dual SIM mangament in QMI or AT commands

If I’m not mistaken, the effect of running AT!UIMS=0|1 command to switch between slot 0 or 1 is equivalent to running qmicli --uim-switch-slot=1|2; i.e. changing which is the current active slot.

Slot status operations will be available since libqmi 1.26. There’s already a 1.26-rc1 available here: https://lists.freedesktop.org/archives/libqmi-devel/2020-May/003322.html

E.g. see how the “slot status” field changes in the QMI slot status query after running the AT command.

$ sudo minicom -D /dev/ttyUSB2
AT!UIMS=1
OK

$ qmicli -d /dev/cdc-wdm2 -p --uim-get-slot-status
[/dev/cdc-wdm2] Successfully got slots status
[/dev/cdc-wdm2] 2 physical slots found:
  Physical slot 1:
     Card status: present
     Slot status: inactive
           ICCID: 8988211000000268949
        Protocol: uicc
        Num apps: 0
        Is eUICC: no
  Physical slot 2:
     Card status: present
     Slot status: active
    Logical slot: 1
           ICCID: unknown
        Protocol: unknown
        Num apps: 0
        Is eUICC: no

$ sudo minicom -D /dev/ttyUSB2
AT!UIMS?                                                                                                                         
!UIMS: 1                                                                                                                         
                                                                                                                                 
OK                                                                                                                               
AT!UIMS=0                                                                                                                        
OK   

$ qmicli -d /dev/cdc-wdm2 -p --uim-get-slot-status
[/dev/cdc-wdm2] Successfully got slots status
[/dev/cdc-wdm2] 2 physical slots found:
  Physical slot 1:
     Card status: present
     Slot status: active
    Logical slot: 1
           ICCID: 8988211000000268949
        Protocol: uicc
        Num apps: 0
        Is eUICC: no
  Physical slot 2:
     Card status: present
     Slot status: inactive
           ICCID: unknown
        Protocol: unknown
        Num apps: 0
        Is eUICC: no

Or, testing the other way:

$ sudo minicom -D /dev/ttyUSB2
AT!UIMS?                                                                                                                         
!UIMS: 0                                                                                                                                                                                                                                                   
OK

$ qmicli -d /dev/cdc-wdm2 -p --uim-switch-slot=2
[/dev/cdc-wdm2] Successfully switched slots

$ sudo minicom -D /dev/ttyUSB2
AT!UIMS?                                                                                                                         
!UIMS: 1                                                                                                                                                                                                                                                   
OK