Hi Caiwen, > gprs_netreg_update() is the only place to change CGATT automatically. > > Following are the code of gprs_netreg_update(). > > ofono_bool_t attach; > > attach = gprs->netreg_status == NETWORK_REGISTRATION_STATUS_REGISTERED; > > attach = attach || (gprs->roaming_allowed && > gprs->netreg_status == NETWORK_REGISTRATION_STATUS_ROAMING); > > attach = attach && gprs->powered; > > if (gprs->driver_attached == attach) > return; > > As my comment above, because gprs->netreg_status is 1(NETWORK_REGISTRATION_STATUS_REGISTERED) > and gprs->driver_attached is TRUE. So (gprs->driver_attached == attach). This function always > return here, unless, the value of gprs->netreg_status or gprs->driver_attached is changed. > This is by design, I don't see anything inherently wrong here. Remember, gprs_netreg_update is called from many places and this sanity check is needed. > As gprs_netreg_update() always returns here, so gprs->driver_attached won't be changed. > So unless the network registration status changes to unregistered then registered again, > it won't attach GPRS again. > But the CREG status is being toggled like crazy. Once CREG goes to unregistered / searching we detach and set driver_attached to FALSE. It sounds like your explanation isn't correct. Regards, -Denis