aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2022-02-09 11:23:56 +0100
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2022-03-28 20:50:45 +0200
commitf360a8cf20aa5cdca3bcd182eda45a2d6aca2602 (patch)
tree59411dd511bbf347f1bc6db7898409167f0aafa0 /tools
parentff8a294ed5ebe41987f2ac50f25dbb69200261ba (diff)
downloadhardware_replicant_libsamsung-ipc-f360a8cf20aa5cdca3bcd182eda45a2d6aca2602.tar.gz
hardware_replicant_libsamsung-ipc-f360a8cf20aa5cdca3bcd182eda45a2d6aca2602.tar.bz2
hardware_replicant_libsamsung-ipc-f360a8cf20aa5cdca3bcd182eda45a2d6aca2602.zip
tools: ipc-modem: get rid of out_call global variable
Since we now have a private struct for all the data we need, we don't need to use global variables anymore. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/ipc-modem.c20
-rw-r--r--tools/ipc-modem.h1
2 files changed, 11 insertions, 10 deletions
diff --git a/tools/ipc-modem.c b/tools/ipc-modem.c
index 8099972..85473d7 100644
--- a/tools/ipc-modem.c
+++ b/tools/ipc-modem.c
@@ -45,7 +45,6 @@ enum log_target log_target;
int state = MODEM_STATE_LPM;
int seq;
-int out_call;
int seq_get(void)
{
@@ -91,11 +90,11 @@ void modem_snd_audio_path_ctrl(struct ipc_client *client)
-void modem_exec_call_out(struct ipc_client *client, char *num)
+void modem_exec_call_out(struct ipc_modem_data *data, char *num)
{
struct ipc_call_outgoing_data call_out;
- modem_snd_no_mic_mute(client);
+ modem_snd_no_mic_mute(data->client);
memset(&call_out, 0, sizeof(struct ipc_call_outgoing_data));
@@ -107,15 +106,16 @@ void modem_exec_call_out(struct ipc_client *client, char *num)
call_out.prefix = IPC_CALL_PREFIX_NONE; //0x21;//IPC_CALL_PREFIX_NONE;
memcpy(call_out.number, num, call_out.number_length);
- ipc_client_send(client, seq_get(), IPC_CALL_OUTGOING, IPC_TYPE_EXEC,
+ ipc_client_send(data->client,
+ seq_get(), IPC_CALL_OUTGOING, IPC_TYPE_EXEC,
(void *) &call_out,
sizeof(struct ipc_call_outgoing_data));
- out_call = 1;
+ data->out_call = 1;
- modem_snd_no_mic_mute(client);
- modem_snd_spkr_volume_ctrl(client);
- modem_snd_audio_path_ctrl(client);
+ modem_snd_no_mic_mute(data->client);
+ modem_snd_spkr_volume_ctrl(data->client);
+ modem_snd_audio_path_ctrl(data->client);
}
void modem_exec_call_answer(struct ipc_client *client)
@@ -271,7 +271,7 @@ void modem_response_call(struct ipc_modem_data *data, struct ipc_message *resp)
/*
* if (data->in_call)
* modem_exec_call_answer(data->client);
- * if (out_call)
+ * if (data->out_call)
* modem_snd_no_mic_mute(data->client);
*/
break;
@@ -384,7 +384,7 @@ void modem_response_net(struct ipc_modem_data *data,
MODEM_LOG_INFO,
"Requesting outgoing call to %s!\n",
data->call_number);
- modem_exec_call_out(data->client, data->call_number);
+ modem_exec_call_out(data, data->call_number);
}
data->call_done = 1;
break;
diff --git a/tools/ipc-modem.h b/tools/ipc-modem.h
index 8a24d6f..09c021d 100644
--- a/tools/ipc-modem.h
+++ b/tools/ipc-modem.h
@@ -52,6 +52,7 @@ struct ipc_modem_data {
/* State */
bool call_done;
bool in_call;
+ bool out_call;
};
void ipc_modem_log(struct ipc_client *client,