Huawei GETPORTMODE logic hack to workaround NCM interfaces listed before TTYs
On a Huawei device that reports a GETPORTMODE response like this one:
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.
To upload designs, you'll need to enable LFS. More information