Ticket #1024: brc_qtopia_quickfix.patch
| File brc_qtopia_quickfix.patch, 2.3 KB (added by mwester@…, 5 years ago) |
|---|
-
src/libraries/qtopiaphonemodem/qmodemnetworkregistration.cpp
old new public: 57 57 58 58 nTotalLosses = 0; 59 59 60 nRecentBounces = 0; 60 61 nTotalBounces = 0; 61 62 tShortestBounceTime = 0; 62 63 tLongestBounceTime = 0; … … public: 79 80 QTimer *cregTimer; 80 81 QTime lastTime; 81 82 83 int nRecentBounces; 82 84 int nTotalLosses; 83 85 int nTotalBounces; 84 86 int tShortestBounceTime; … … void QModemNetworkRegistration::cregNoti 242 244 qLog(Modem) << "LoR -> Timer cancelled. (ms=" << t << ")"; 243 245 244 246 d->nTotalBounces++; 247 d->nRecentBounces++; 245 248 d->tTotalBounceTime = d->tTotalBounceTime + t; 246 249 if (t > d->tLongestBounceTime) 247 250 d->tLongestBounceTime = t; … … void QModemNetworkRegistration::cregNoti 297 300 "ms=(" << d->tShortestBounceTime << "/" << 298 301 (d->nTotalBounces ? (d->tTotalBounceTime / d->nTotalBounces) : 0) << 299 302 "/" << d->tLongestBounceTime << ")"; 303 304 // See if we have begun bouncing; three bounces and we'll disable deep sleep. 305 if (d->nRecentBounces > 2) { 306 d->nRecentBounces = 0; 307 qLog(Modem) << "LoR -> Bouncing detected; limiting sleep."; 308 // Disable deep sleep mode. 309 // TODO: We really should find a good place in the code to attempt 310 // to re-enable deep sleep mode, but since we don't know the root 311 // cause at this time it is difficult to know when to attempt this. 312 d->service->chat("AT%SLEEP=2"); 313 } 300 314 } 301 315 } 302 316 … … void QModemNetworkRegistration::cregTime 308 322 qLog(Modem) << "LoR -> Timer expired (registration lost)."; 309 323 d->nTotalLosses++; 310 324 updateRegistrationState( (QTelephony::RegistrationState)0 ); 325 // If we de-registered for real, we may be in weak signal area, this is a 326 // good reason to restart whatever progress has happened to disabling deep 327 // sleep mode. 328 // TODO: There should be other "disablers" too, but we don't yet 329 // know what the best heuristics for this might actually be... 330 d->nRecentBounces = 0; 311 331 } 312 332 313 333 void QModemNetworkRegistration::cregQuery( bool, const QAtResult& result )
