Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Commit

Permalink
Improve channel disconnecting
Browse files Browse the repository at this point in the history
  • Loading branch information
RoEdAl committed Jul 25, 2023
1 parent 7335cee commit 8aceb11
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
12 changes: 5 additions & 7 deletions src/at_command.c
Original file line number Diff line number Diff line change
Expand Up @@ -1218,14 +1218,12 @@ int at_hangup_immediately(struct cpvt* cpvt, int release_cause)

int at_disable_uac_immediately(struct pvt *pvt)
{
if (!pvt->is_simcom) {
static const char cmd_qpcmv[] = "+QPCMV=0";
static const at_queue_cmd_t cmd = ATQ_CMD_DECLARE_ST(CMD_AT_QPCMV_0, cmd_qpcmv);
static const char cmd_qpcmv[] = "+QPCMV=0";
static const at_queue_cmd_t cmd = ATQ_CMD_DECLARE_ST(CMD_AT_QPCMV_0, cmd_qpcmv);

if (at_queue_add(&pvt->sys_chan, &cmd, 1, 0, 1u) == NULL) {
chan_quectel_err = E_QUEUE;
return -1;
}
if (at_queue_add(&pvt->sys_chan, &cmd, 1, 0, 1u) == NULL) {
chan_quectel_err = E_QUEUE;
return -1;
}

return 0;
Expand Down
6 changes: 4 additions & 2 deletions src/at_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,10 @@ int at_queue_run_immediately(struct pvt* pvt)
AST_LIST_TRAVERSE(&pvt->at_queue, task, entry) {
if (!task->at_once) continue;
for(unsigned i=0; i<task->cmdsno; ++i) {
ast_str_append_substr(&buf, buflen, task->cmds[i].data, task->cmds[i].length);
ast_str_append_substr(&buf, buflen, (pos < cmdsno) ? ";" : "\r", 1);
if (task->cmds[i].length) {
ast_str_append_substr(&buf, buflen, task->cmds[i].data, task->cmds[i].length);
ast_str_append_substr(&buf, buflen, (pos < cmdsno) ? ";" : "\r", 1);
}
pos += 1u;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/chan_quectel.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ static void disconnect_quectel(struct pvt* pvt)
}
}

if (CONF_UNIQ(pvt, uac) == TRIBOOL_TRUE) {
if (!pvt->is_simcom && CONF_UNIQ(pvt, uac) == TRIBOOL_TRUE) {
at_disable_uac_immediately(pvt);
}

Expand Down

0 comments on commit 8aceb11

Please sign in to comment.