Repository navigation
feat(cellular): expose signal strength and conn type - #3533
Conversation
|
/claude review |
|
|
||
| b.updateAllCellularDevices() | ||
| if b.onStateChange != nil { | ||
| b.onStateChange() |
There was a problem hiding this comment.
Signal-quality updates never reach the shell. onStateChange funnels into Manager.onBackendStateChange → notifySubscribers, and the broadcast loop drops the state unless stateChangedMeaningfully returns true (manager.go:534). That function's cellular-device loop (manager.go:430-445) only compares Name, Connected, State and IP — SignalQuality and AccessTech aren't compared, so a modem-only change is filtered out and subscribers keep the stale values until something unrelated changes.
SignalQuality/AccessTech need to be added to that loop. When you do, gate the signal on a threshold the way WiFi does (signalChangeSignificant, used at manager.go:298) — otherwise every 1% jitter from ModemManager re-broadcasts the whole state to every client, which is exactly the churn the WiFi path avoids.
Claude reviewTwo issues: the new signal data never actually reaches the shell, and the ModemManager probe can auto-start the daemon.
Checked: MM bit masks and port type against the MMModemAccessTechnology/MMModemPortType enums, modemMutex lock ordering and the refreshModem/updateAllCellularDevices path, signal match add/remove symmetry in start/stopSignalPump, and the QML null-safety of |
f1c16c8 to
5a68635
Compare
|
/claude review |
|
/claude review |
Claude reviewBoth earlier findings are fixed. One new issue: with more than one modem, modems are matched to NM devices by the wrong port.
Checked: the new |
5a68635 to
014dd95
Compare
|
/claude review |
| dbusMMModemInterface = "org.freedesktop.ModemManager1.Modem" | ||
| dbusObjectManagerInterface = "org.freedesktop.DBus.ObjectManager" | ||
|
|
||
| mmPortTypePrimary = 1 |
There was a problem hiding this comment.
MMModemPortType has no "primary" value. 1 is MM_MODEM_PORT_TYPE_UNKNOWN (NET=2, AT=3, QMI=6, MBIM=7). A real modem's primary port is QMI, MBIM or AT, so this check almost never matches and primaryPort stays empty. Matching still only works through the lone-modem fallback, which means the multi-modem problem from the last review is still there. The test passes only because it tags cdc-wdm0 with this same constant.
Fix: read the modem's PrimaryPort string property (props["PrimaryPort"]) instead of scanning Ports by type.
Claude reviewThe port-matching fix is still not right: modems still match only through the lone-modem fallback.
Checked: MMModemPortType and MMModemAccessTechnology enum values, ObjectManager/PropertiesChanged routing in |
014dd95 to
32f88cf
Compare
|
/claude review |
|
/claude review |
|
ok, I've tested against a real device now, and this is still not right. :-/ update coming in a moment. |
| } | ||
|
|
||
| if sig.Name == dbusObjectManagerInterface+".InterfacesAdded" || | ||
| sig.Name == dbusObjectManagerInterface+".InterfacesRemoved" { |
There was a problem hiding this comment.
This branch reacts to every ObjectManager signal on the system bus, not only ModemManager's. dbus.SystemBus() is a shared connection, and godbus sends every matched signal to every registered channel. The bluez manager adds bus-wide InterfacesAdded/InterfacesRemoved rules (bluez/manager.go:26-27) with no path or sender filter. So during a Bluetooth scan, each discovered device sends a synchronous GetManagedObjects to MM, re-reads every cellular device's NM properties, and calls onStateChange. UDisks, NM and iwd ObjectManager signals do the same.
Fix: filter on the MM path.
| sig.Name == dbusObjectManagerInterface+".InterfacesRemoved" { | |
| if sig.Path == dbus.ObjectPath(dbusMMPath) && | |
| (sig.Name == dbusObjectManagerInterface+".InterfacesAdded" || | |
| sig.Name == dbusObjectManagerInterface+".InterfacesRemoved") { |
Claude reviewOne new issue: the ModemManager objects handler reacts to ObjectManager signals from every service on the bus, not just ModemManager. The earlier multi-modem comment still applies:
Checked: signal routing in |
network manager doesn't expose this so talk to modem manager over dbus
32f88cf to
b72d1d2
Compare
|
re the last bug, I believe existing code for bluez also suffers from that and should be filtered, but I think that should be a separate PR from this. Happy to open a separate PR for that? |
Yea we should do that (I'll make an issue so I dont forget) |
|
/claude review |
Claude reviewNo issues found. The earlier findings are fixed: matching now uses Checked: PrimaryPort matching and the lone-modem fallback, add/remove symmetry for the ModemManager match rules, the ordering of the initial refresh in |
network manager doesn't expose this so talk to modem manager over dbus
Description
Type of change
Related issues
Screenshots / video
Checklist
I18n.tr()with translator context, reusing existing terms where possiblemake fmt, added/updated tests,make testpasses, andgo mod tidyis cleanmake lint-qmlwith no new warnings