Skip to content

Commit

Permalink
net_modem: Implement answer command
Browse files Browse the repository at this point in the history
  • Loading branch information
Cacodemon345 authored Mar 13, 2024
1 parent 7f68245 commit 607f66a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/network/net_modem.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ static modem_t *instance;
#define MREG_DTR_DELAY 25

static void modem_do_command(modem_t* modem);
static void modem_answer_incoming_call(modem_t* modem);

extern ssize_t local_getline(char **buf, size_t *bufsiz, FILE *fp);

Expand Down Expand Up @@ -822,8 +823,12 @@ modem_do_command(modem_t* modem)
break;
case 'A': // Answer call
{
modem_send_res(modem, ResERROR);
return;
if (modem->waitingclientsocket == -1) {
modem_send_res(modem, ResERROR);
return;
}
modem_answer_incoming_call(modem);
break;
}
return;
case 'Z': { // Reset and load profiles
Expand Down

0 comments on commit 607f66a

Please sign in to comment.