Hi Denis,
> @@ -541,6 +542,8 @@ gboolean g_at_ppp_open(GAtPPP *ppp, GAtIO
*io)
> if (ppp->hdlc == NULL)
> return FALSE;
>
> + g_at_hdlc_set_recording(ppp->hdlc, ppp->dumpfile);
> +
I force the start of the recording in the ppp_open.
Without this change, if we call g_at_ppp_set_record before g_at_ppp_open, as it's done
in gsmdial, it's totaly useless. g_at_ppp_set_record will call
g_at_hdlc_set_recording, and g_at_hdlc_set_recording will check ppp->hdlc. But
ppp->hdlc is set in g_at_ppp_open.
> ppp->suspended = FALSE;
> g_at_hdlc_set_receive(ppp->hdlc, ppp_receive, ppp);
> g_at_hdlc_set_suspend_function(ppp->hdlc,
> @@ -593,7 +596,11 @@ void g_at_ppp_set_recording(GAtPPP *ppp, const
char *filename)
> if (ppp == NULL)
> return;
>
> - g_at_hdlc_set_recording(ppp->hdlc, filename);
> + g_free(ppp->dumpfile);
> +
> + ppp->dumpfile = g_strdup(filename);
> +
> + g_at_hdlc_set_recording(ppp->hdlc, ppp->dumpfile);
I'm failing to see the point in making this change. Why do you need to
save the dump filename inside gatppp?
So in the g_at_ppp_set_recording, I store the file. And during the ppp_open, I start the
recording immediately. So with this change, we cannot miss a PPP frame. Because without
the change, if we start the recording after the ppp_open, we might loose some info.
> }
>
> void g_at_ppp_set_connect_function(GAtPPP *ppp, GAtPPPConnectFunc
func,
> @@ -745,6 +752,8 @@ void g_at_ppp_unref(GAtPPP *ppp)
>
> g_at_hdlc_unref(ppp->hdlc);
>
> + g_free(ppp->dumpfile);
> +
> g_free(ppp);
> }
>
Regards,
Bertrand
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.