Hi Caiwen, On 05/10/2011 01:38 AM, Caiwen Zhang wrote: > This patch is to fix the issue that can't attach GPRS after detach it. > I'd like to see a complete AT log of this situation if possible. It sounds like there's something else going on here... > Cause: > When start detaching GPRS, driver_attched value is set to FALSE, if > device registered to GPRS network during GPRS detaching, driver_attched is set to TURE. > After that, GPRS attaching will always be ignored because driver_attched is always TURE. > It seems the definition of driver_attched is confused. > > Scenario: > When device is unregistered(+CREG: 2), GPRS is detached. During GPRS detaching, device > registered to network again(+CREG: 1, xxx, xxx). Really sounds like your firmware is too twitchy. Why does it report CREG: 2 and then immediately finds registration? Is this related to cell roaming or technology switch? > > Solution: > variable attached represents the GPRS attach status, it only be TRUE, when CGATT=1 and > CGREG is registered or roaming(roaming allowed). variable driver_attached represents CGATT > status of the driver. its value will only be changed after set_attached successfully or > GPRS detached notified. variable pending_attached represents the pending status of CGATT. > Can you try the attached patch and tell me if this fixes your problem? Regards, -Denis