Do not restart the modem if already started
This commit is contained in:
parent
8af66dbf2d
commit
d298bfd4cc
@ -609,15 +609,28 @@ static int _hayes_request(Hayes * hayes, ModemRequest * request)
|
|||||||
|
|
||||||
|
|
||||||
/* hayes_start */
|
/* hayes_start */
|
||||||
|
static int _start_is_started(Hayes * hayes);
|
||||||
|
|
||||||
static int _hayes_start(Hayes * hayes, unsigned int retry)
|
static int _hayes_start(Hayes * hayes, unsigned int retry)
|
||||||
{
|
{
|
||||||
hayes->retry = retry;
|
hayes->retry = retry;
|
||||||
|
if(_start_is_started(hayes))
|
||||||
|
return 0;
|
||||||
if(hayes->source != 0)
|
if(hayes->source != 0)
|
||||||
g_source_remove(hayes->source);
|
g_source_remove(hayes->source);
|
||||||
hayes->source = g_idle_add(_on_reset, &hayes->channel);
|
hayes->source = g_idle_add(_on_reset, &hayes->channel);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int _start_is_started(Hayes * hayes)
|
||||||
|
{
|
||||||
|
if(hayes->source != 0)
|
||||||
|
return 1;
|
||||||
|
if(hayes->channel.channel != NULL)
|
||||||
|
return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* hayes_stop */
|
/* hayes_stop */
|
||||||
static void _stop_channel(Hayes * hayes, HayesChannel * channel);
|
static void _stop_channel(Hayes * hayes, HayesChannel * channel);
|
||||||
|
Loading…
Reference in New Issue
Block a user