mirror of
https://gitlab.com/mobian1/eg25-manager.git
synced 2025-08-30 15:52:11 +02:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
99aa7e2bf7 | ||
|
ce0fc25892 | ||
|
ec96153b0f |
12
src/at.c
12
src/at.c
@@ -73,10 +73,10 @@ gboolean at_send_command(struct EG25Manager *manager)
|
|||||||
int ret, len = 0, pos = 0;
|
int ret, len = 0, pos = 0;
|
||||||
|
|
||||||
if (at_cmd) {
|
if (at_cmd) {
|
||||||
/* Wake up the modem from soft sleep before sending an AT command */
|
/* Wake up the modem from soft sleep before sending an AT command */
|
||||||
gpio_sequence_wake(manager);
|
gpio_sequence_wake(manager);
|
||||||
|
|
||||||
/* Send AT command */
|
/* Send AT command */
|
||||||
if (at_cmd->subcmd == NULL && at_cmd->value == NULL && at_cmd->expected == NULL)
|
if (at_cmd->subcmd == NULL && at_cmd->value == NULL && at_cmd->expected == NULL)
|
||||||
len = snprintf(command, sizeof(command), "AT+%s\r\n", at_cmd->cmd);
|
len = snprintf(command, sizeof(command), "AT+%s\r\n", at_cmd->cmd);
|
||||||
else if (at_cmd->subcmd == NULL && at_cmd->value == NULL)
|
else if (at_cmd->subcmd == NULL && at_cmd->value == NULL)
|
||||||
@@ -126,8 +126,8 @@ gboolean at_send_command(struct EG25Manager *manager)
|
|||||||
|
|
||||||
g_message("Successfully sent command: %s", g_strstrip(command));
|
g_message("Successfully sent command: %s", g_strstrip(command));
|
||||||
} else {
|
} else {
|
||||||
/* Allow the modem to enter soft sleep again when we sent the AT command*/
|
/* Allow the modem to enter soft sleep again when we sent the AT command*/
|
||||||
gpio_sequence_sleep(manager);
|
gpio_sequence_sleep(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) {
|
||||||
@@ -146,8 +146,6 @@ gboolean at_send_command(struct EG25Manager *manager)
|
|||||||
}
|
}
|
||||||
} else if (manager->modem_state == EG25_STATE_SUSPENDING) {
|
} else if (manager->modem_state == EG25_STATE_SUSPENDING) {
|
||||||
modem_suspend_post(manager);
|
modem_suspend_post(manager);
|
||||||
} else if (manager->modem_state == EG25_STATE_RESETTING) {
|
|
||||||
manager->modem_state = EG25_STATE_POWERED;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -74,10 +74,6 @@ int gpio_line_set_value(struct EG25Manager *manager, int line, enum gpiod_line_v
|
|||||||
|
|
||||||
int gpio_sequence_poweron(struct EG25Manager *manager)
|
int gpio_sequence_poweron(struct EG25Manager *manager)
|
||||||
{
|
{
|
||||||
/* Disable airplane mode in case it was enabled by other software. The
|
|
||||||
* W_DISABLE pin is active-low, so we set it to high here. */
|
|
||||||
gpio_line_set_value(manager, GPIO_OUT_DISABLE, GPIOD_LINE_VALUE_ACTIVE);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Force the modem to poweroff using the RESET_N pin before attempting to
|
* Force the modem to poweroff using the RESET_N pin before attempting to
|
||||||
* boot in case the it got into a bad state.
|
* boot in case the it got into a bad state.
|
||||||
|
@@ -271,7 +271,7 @@ error:
|
|||||||
at_sequence_reset(manager);
|
at_sequence_reset(manager);
|
||||||
|
|
||||||
// Setup timer for making sure we don't queue other reset commands
|
// Setup timer for making sure we don't queue other reset commands
|
||||||
manager->complete_reset_timer = g_timeout_add_seconds(30, G_SOURCE_FUNC(modem_at_reset_done), manager);
|
manager->complete_reset_timer = g_timeout_add_seconds(45, G_SOURCE_FUNC(modem_at_reset_done), manager);
|
||||||
|
|
||||||
return G_SOURCE_REMOVE;
|
return G_SOURCE_REMOVE;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user