ok thank you for the explanation.
How atoms force to go back into AT commands mode ? Where is it done in the code ?
Each atom behaves differently. Refer to the atom's remove() function
for details. E.g. the 'atmodem' gprs_context atom uses g_at_ppp_unref()
and g_at_chat_resume() to force the chat out of PPP mode. This is why
you see "garbage" on the AT trace. In reality it is just a final HDLC