contrib/modemu: respond to AT+COPS?

This queries the operator code. If NetworkManager got one, it can
connect the modem device automatically without setting the APN.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1086
This commit is contained in:
Lubomir Rintel 2022-02-03 13:30:07 +01:00
parent a16b380d32
commit ea37c42b16

View file

@ -190,6 +190,14 @@ while (<$pty>) {
print $pty "\r\n";
print $pty "OK\r\n";
} elsif (/^AT\+COPS\?$/) {
# Current operators
# Not strictly required, but allows NetworkManager to just connect
# the modem device without explicitly setting an APN
print $pty "\r\n";
print $pty "+COPS: 0,2,\"65302\",7\r\n"; # MCCMNC
print $pty "OK\r\n";
} elsif (/^ATD/) {
print $pty "\r\n";
print $pty "CONNECT 28800000\r\n";