• R/O
  • HTTP
  • SSH
  • HTTPS

rpi-dmonitor: Commit


Commit MetaInfo

Révision93019ea2cf9283de80cf9fe2dc8cfc2266989605 (tree)
l'heure2019-11-09 21:43:32
AuteurSatoshi Yasuda <7m3tjz@jarl...>
CommiterSatoshi Yasuda

Message de Log

modified: dmonitor.h
modified: dmonitor_utils.c
modified: main.c
modified: rig_read.c

Change Summary

Modification

--- a/dmonitor.h
+++ b/dmonitor.h
@@ -29,7 +29,7 @@
2929
3030 //#define _DEBUG
3131 //#define _DEBUG_RIG
32-#define _DEBUG_RIG_9
32+//#define _DEBUG_RIG_9
3333 //#define _DEBUG_INET
3434 //#define _DEBUG_JITTER
3535 #define _SPECIFICATION_CHECK
--- a/dmonitor_utils.c
+++ b/dmonitor_utils.c
@@ -337,6 +337,17 @@ void putFifo (int len, unsigned char pkt[])
337337 rig_fifo_check();
338338 }
339339
340+void delete_last_header (void)
341+{
342+ struct FifoPkt *ret;
343+
344+ if (Wp->length != 42) return;
345+ ret = Wp;
346+ Wp = ret->next;
347+ Fifo_cnt--;
348+ free (ret);
349+}
350+
340351 void connected_table(char str[])
341352 {
342353 struct stat sb;
--- a/main.c
+++ b/main.c
@@ -21,6 +21,7 @@ int getFifo (unsigned char str[]);
2121 void dummy_last_frame (void);
2222 void jitter_putFifo(void);
2323 void jitter_buff_init (void);
24+void delete_last_header (void);
2425
2526 time_t send_time;
2627
@@ -210,12 +211,22 @@ int main(int argc, char *argv[])
210211 timeradd (&inet_recv_time, &inet_recv_timeout, &temp_time);
211212 if (timercmp (&c_time, &temp_time, >))
212213 {
213- syslog(LOG_INFO, "insert dummy_last_frame");
214- dummy_last_frame();
215- #ifdef _SPECIFICATION_CHECK
216- timersub (&c_time, &inet_recv_time, &temp_time);
217- syslog (LOG_INFO, "Long Interval %ld.%03ld Sec.", temp_time.tv_sec, temp_time.tv_usec/1000);
214+ #if 0
215+ if (inet_read_cnt == 0)
216+ {
217+ syslog (LOG_INFO, "no voice packet");
218+ delete_last_header();
219+ }
220+ else
218221 #endif
222+ {
223+ syslog(LOG_INFO, "insert dummy_last_frame");
224+ dummy_last_frame();
225+ #ifdef _SPECIFICATION_CHECK
226+ timersub (&c_time, &inet_recv_time, &temp_time);
227+ syslog (LOG_INFO, "Long Interval %ld.%03ld Sec.", temp_time.tv_sec, temp_time.tv_usec/1000);
228+ #endif
229+ }
219230 }
220231 }
221232 else
--- a/rig_read.c
+++ b/rig_read.c
@@ -97,7 +97,7 @@ void rig(void)
9797 break;
9898
9999 case RIG_INIT:
100- memset (inet_frame_id, 0xff, 2);
100+ //memset (inet_frame_id, 0xff, 2);
101101 send_rig_init();
102102 rig_state = RIG_INIT_DONE;
103103 time (&rig_init_time);
@@ -109,13 +109,14 @@ void rig(void)
109109 {
110110 rig_state = RIG_READ;
111111 syslog (LOG_INFO, "RIG(ID-xxPlus) init/re-init done");
112- memset (inet_frame_id, 0x00, 2);
112+ //memset (inet_frame_id, 0x00, 2);
113113 rig_send_sw = FALSE;
114114 rig_buff_pnt = 0;
115115 rig_last_frame_send = TRUE;
116116 jitter_buff_init();
117117 length = 1;
118118 while (length) length = getFifo(dummy);
119+ gettimeofday (&inet_recv_time, NULL);
119120 Fifo_cnt = 0;
120121 rig_send_sw = FALSE;
121122 }
@@ -124,8 +125,8 @@ void rig(void)
124125 time (&cur_time);
125126 if ((cur_time - rig_init_time) >= 2)
126127 rig_state = RIG_INIT;
127- break;
128128 }
129+ break;
129130
130131 case RIG_READ:
131132 if (!rig_read()) rig_state = RIG_OPEN;
Afficher sur ancien navigateur de dépôt.