mirror of
https://gitlab.com/mobian1/eg25-manager.git
synced 2025-08-29 15:22:20 +02:00
at: ensure we don't skip steps
After the modem send "RDY", other messages are received. With the current implementation, this causes eg25-manager to mark the modem as configured before it is even picked up by ModemManager. Adding an additional status check helps preventing this issue.
This commit is contained in:
12
src/at.c
12
src/at.c
@@ -129,12 +129,14 @@ gboolean at_send_command(struct EG25Manager *manager)
|
|||||||
if (manager->modem_state < EG25_STATE_CONFIGURED) {
|
if (manager->modem_state < EG25_STATE_CONFIGURED) {
|
||||||
if (manager->modem_iface == MODEM_IFACE_MODEMMANAGER) {
|
if (manager->modem_iface == MODEM_IFACE_MODEMMANAGER) {
|
||||||
#ifdef HAVE_MMGLIB
|
#ifdef HAVE_MMGLIB
|
||||||
MMModemState modem_state = mm_modem_get_state(manager->mm_modem);
|
if (manager->modem_state == EG25_STATE_ACQUIRED) {
|
||||||
|
MMModemState modem_state = mm_modem_get_state(manager->mm_modem);
|
||||||
|
|
||||||
if (manager->mm_modem && modem_state >= MM_MODEM_STATE_REGISTERED)
|
if (manager->mm_modem && modem_state >= MM_MODEM_STATE_REGISTERED)
|
||||||
modem_update_state(manager, modem_state);
|
modem_update_state(manager, modem_state);
|
||||||
else
|
else
|
||||||
manager->modem_state = EG25_STATE_CONFIGURED;
|
manager->modem_state = EG25_STATE_CONFIGURED;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
manager->modem_state = EG25_STATE_CONFIGURED;
|
manager->modem_state = EG25_STATE_CONFIGURED;
|
||||||
|
Reference in New Issue
Block a user