comparison mtctest/disconnect.c @ 8:a902ccbf6bbc

mtctest: introduce general user command structure
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 09 Jun 2024 02:48:55 +0000
parents e7b192a5dee5
children
comparison
equal deleted inserted replaced
7:d0b86b144577 8:a902ccbf6bbc
16 #include "../include/mncc.h" 16 #include "../include/mncc.h"
17 #include "../include/gsm48_const.h" 17 #include "../include/gsm48_const.h"
18 18
19 int disconnect_mode; 19 int disconnect_mode;
20 20
21 void
21 send_disconnect_req() 22 send_disconnect_req()
22 { 23 {
23 struct gsm_mncc msg; 24 struct gsm_mncc msg;
24 25
25 printf("Sending disconnect request\n"); 26 printf("Sending disconnect request\n");
29 mncc_set_cause(&msg, GSM48_CAUSE_LOC_USER, 30 mncc_set_cause(&msg, GSM48_CAUSE_LOC_USER,
30 GSM48_CC_CAUSE_NORM_CALL_CLEAR); 31 GSM48_CC_CAUSE_NORM_CALL_CLEAR);
31 send_mncc_to_gsm(&msg, sizeof(struct gsm_mncc)); 32 send_mncc_to_gsm(&msg, sizeof(struct gsm_mncc));
32 disconnect_mode = 1; 33 disconnect_mode = 1;
33 } 34 }
35
36 void
37 disconnect_command()
38 {
39 if (disconnect_mode) {
40 printf("Already in disconnect mode, command ignored\n");
41 return;
42 }
43 send_disconnect_req();
44 }