summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Hatch <jhatch@multitech.com>2023-02-13 08:53:00 -0600
committerJeff Hatch <jhatch@multitech.com>2023-02-13 08:53:00 -0600
commit24df995dd3860fea4b5a77fe492de50550164fa2 (patch)
treefb8c8642ba8b2d0b842ce2370ff49f36a4832c8d
parent37d7886022d0c90c1102f37ee5dd0704b2276730 (diff)
parentf3cb015894fceb37c4fad6e0a6fa69cbd7b2c93d (diff)
downloadmts-io-sysfs-24df995dd3860fea4b5a77fe492de50550164fa2.tar.gz
mts-io-sysfs-24df995dd3860fea4b5a77fe492de50550164fa2.tar.bz2
mts-io-sysfs-24df995dd3860fea4b5a77fe492de50550164fa2.zip
Merge branch 'mpower-dev-l6g1' into 'master' 0.2.8
[GP-1733] L6G1 Support - Capabilities cellWwan and cellPpp See merge request !12
-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 */