summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2023-01-18 23:50:48 +0200
committerSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2023-01-18 23:53:49 +0200
commitf189174533566395b0529af257645e6b3c3040b9 (patch)
treefb8c8642ba8b2d0b842ce2370ff49f36a4832c8d
parent3ebfe17aef57ad6bddb7e7a7d53fc112bfd10b4f (diff)
downloadmts-io-sysfs-f189174533566395b0529af257645e6b3c3040b9.tar.gz
mts-io-sysfs-f189174533566395b0529af257645e6b3c3040b9.tar.bz2
mts-io-sysfs-f189174533566395b0529af257645e6b3c3040b9.zip
[GP-1733] L6G1 Support - Capabilities cellWwan and cellPpp
Define the new "cellPpp" capability for radios that do not support PPP and do not have the "modem_at0" interface. Set the "cellWwan" capability to "true" for radios that do not support PPP, but also do not support QMI WWAN. Assumption: radios without PPP and QMI WWAN support some other protocol, like ECM WWAN. NOTE: L6G1 does not support PPP and uses ECM WWAN instead of QMI WWAN, hence the radio does not have the "/dev/cdc-wdm0" interface and requires special handling to set the "cellWwan" capability.
-rw-r--r--src/Device/Device.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/Device/Device.cpp b/src/Device/Device.cpp
index 6ef807e..5f0e281 100644
--- a/src/Device/Device.cpp
+++ b/src/Device/Device.cpp
@@ -37,6 +37,7 @@ std::map<std::string, bool> Device::capabilityList = {
{"battery", false},
{"bluetooth", false},
{"cell", false},
+ {"cellPpp", false},
{"cellWwan", false},
{"din", false},
{"dout", false},
@@ -316,9 +317,18 @@ void Device::mapFileToCapability() {
S_IFREG) { /* lora-network-server is a regular file */
capabilityList["loraNetworkServer"] = true;
}
- if (fileType("/dev/cdc-wdm0") ==
- S_IFCHR) { /* Cellular modem is wwan/qmi character device */
- capabilityList["cellWwan"] = true;
+ if (capabilityList["cell"]) { /* only on devices with Cellular */
+ if (fileType("/dev/cdc-wdm0") == S_IFCHR) {
+ /* Cellular modem is wwan/qmi/mbim character device */
+ capabilityList["cellWwan"] = true;
+ }
+ if (!fileExists("/dev/modem_at0") && fileType("/dev/modem_at1") == S_IFCHR) {
+ /* Cellular modem without PPP support, probably uses ECM WWAN */
+ capabilityList["cellWwan"] = true;
+ } else {
+ /* all other radios - assume PPP is supported */
+ capabilityList["cellPpp"] = true;
+ }
}
if (fileType("/dev/ext_serial") ==
S_IFCHR) { /* ext_serial is a character device */