Huawei GETPORTMODE logic hack to workaround NCM interfaces listed before TTYs
On a Huawei device that reports a GETPORTMODE response like this one:
^getportmode:type:WCDMA:Qualcomm,NDIS:0,DIAG:1,PCUI:2,MDM:3,SD:4<CR><LF><CR><LF>OK<CR><LF>
The actual USB interface number for TTYs is off by one, because the NDIS interface occupies 2 USB interfaces (0 and 1), so DIAG is really 2 and not 1, and so on.
Edited by Aleksander Morgado