Hi Guillaume,

>>> +suspend:
>>> +    /*
>>> +     * If the suspend timeout still exists,
>>> +     * delete it.
>>> +     */
>>> +    if (hdlc->suspend_timeout>  0)
>>> +        g_source_remove(hdlc->suspend_timeout);
>>> +
>>> +    /*
>>> +     * Restart the counter and reset the ring buffer.
>>> +     */
>>> +    hdlc->cmpt = 0;
>>> +    ring_buffer_reset(rbuf);
>> This sounds like a really bad idea.  What are you trying to accomplish
>> here?
> 
> If I don't reset ring_buffer, I am receiving "+++" on GAtServer when I
> return to command mode and it is blocking following AT commands.
> I can't send next ATH0 or ATO0. Do you have any idea how to prevent
> receiving GAtServer to receive it?

So two issues:

- why are you using ring_buffer_reset instead of ring_buffer_drain(buf, 3)?

- Why are you doing this here instead of waiting for the guard timeout
to expire after +++ has been detected?

> 
>>> +
>>> +    /*
>>> +     * Wait for another pause of GUARD_TIMEOUTS ms before returning
>>> to command mode.
>>> +     */
>>> +    hdlc->paused = FALSE;
>>> +    hdlc->pause_timeout = g_timeout_add (GUARD_TIMEOUTS,
>>> hdlc_suspend, hdlc);
>>>   }
>>>

Regards,
-Denis
_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono

Reply via email to