aboutsummaryrefslogtreecommitdiffstats
path: root/src/cnetz/cnetz.h
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2016-05-08 15:34:14 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2016-05-08 15:53:00 +0200
commit57ba648ac4bad5d3f50249ecb0c24d0321282cb1 (patch)
treeb59961d8e28a729a0b3f9575862413b83d58b516 /src/cnetz/cnetz.h
parentbae12156a23bc18561a9fd81a550edfd988ef437 (diff)
C-Netz: Add tiny database to track if phones are online
Reject calls, if not online. Use an interval to check if the phones are still online.
Diffstat (limited to 'src/cnetz/cnetz.h')
-rw-r--r--src/cnetz/cnetz.h31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/cnetz/cnetz.h b/src/cnetz/cnetz.h
index 66ca53e..531abb8 100644
--- a/src/cnetz/cnetz.h
+++ b/src/cnetz/cnetz.h
@@ -32,24 +32,25 @@ enum cnetz_state {
/* roaming to different base station/network */
#define TRANS_UM (1 << 1) /* roaming request received, sending reply */
/* check if phone is still on */
-#define TRANS_MA (1 << 2) /* periodic online check sent, waiting for reply */
+#define TRANS_MA (1 << 2) /* periodic online check, waiting for time slot to send order */
+#define TRANS_MFT (1 << 3) /* periodic online check sent, waiting for reply */
/* mobile originated call */
-#define TRANS_VWG (1 << 3) /* received dialing request, waiting for time slot to send dial order */
-#define TRANS_WAF (1 << 4) /* dial order sent, waiting for dialing */
-#define TRANS_WBP (1 << 5) /* dialing received, waiting for time slot to acknowledge call */
-#define TRANS_WBN (1 << 6) /* dialing received, waiting for time slot to reject call */
-#define TRANS_VAG (1 << 7) /* establishment of call sent, switching channel */
+#define TRANS_VWG (1 << 4) /* received dialing request, waiting for time slot to send dial order */
+#define TRANS_WAF (1 << 5) /* dial order sent, waiting for dialing */
+#define TRANS_WBP (1 << 6) /* dialing received, waiting for time slot to acknowledge call */
+#define TRANS_WBN (1 << 7) /* dialing received, waiting for time slot to reject call */
+#define TRANS_VAG (1 << 8) /* establishment of call sent, switching channel */
/* mobile terminated call */
-#define TRANS_VAK (1 << 8) /* establishment of call sent, switching channel */
+#define TRANS_VAK (1 << 9) /* establishment of call sent, switching channel */
/* traffic channel */
-#define TRANS_BQ (1 << 9) /* accnowledge channel */
-#define TRANS_VHQ (1 << 10) /* hold call */
-#define TRANS_RTA (1 << 11) /* hold call and make the phone ring */
-#define TRANS_DS (1 << 12) /* establish speech connection */
-#define TRANS_AHQ (1 << 13) /* establish speech connection after answer */
+#define TRANS_BQ (1 << 10) /* accnowledge channel */
+#define TRANS_VHQ (1 << 11) /* hold call */
+#define TRANS_RTA (1 << 12) /* hold call and make the phone ring */
+#define TRANS_DS (1 << 13) /* establish speech connection */
+#define TRANS_AHQ (1 << 14) /* establish speech connection after answer */
/* release */
-#define TRANS_AF (1 << 14) /* release connection by base station */
-#define TRANS_AT (1 << 15) /* release connection by mobile station */
+#define TRANS_AF (1 << 15) /* release connection by base station */
+#define TRANS_AT (1 << 16) /* release connection by mobile station */
/* timers */
#define F_BQ 8 /* number of not received frames at BQ state */
@@ -81,6 +82,7 @@ typedef struct transaction {
struct timer timer; /* for varous timeouts */
int mo_call; /* flags a moile originating call */
int mt_call; /* flags a moile terminating call */
+ int ma_failed; /* failed to get a response from MS */
} transaction_t;
struct clock_speed {
@@ -157,6 +159,7 @@ int cnetz_init(void);
int cnetz_create(int kanal, enum cnetz_chan_type chan_type, const char *sounddev, int samplerate, int cross_channels, double rx_gain, int auth, int ms_power, int measure_speed, double clock_speed[2], double deviation, double noise, int pre_emphasis, int de_emphasis, const char *write_wave, const char *read_wave, int loopback);
void cnetz_destroy(sender_t *sender);
void cnetz_sync_frame(cnetz_t *cnetz, double sync, int ts);
+int cnetz_meldeaufruf(uint8_t futln_nat, uint8_t futln_fuvst, uint16_t futln_rest);
const struct telegramm *cnetz_transmit_telegramm_rufblock(cnetz_t *cnetz);
const struct telegramm *cnetz_transmit_telegramm_meldeblock(cnetz_t *cnetz);
void cnetz_receive_telegramm_ogk(cnetz_t *cnetz, struct telegramm *telegramm, int block);