• R/O
  • HTTP
  • SSH
  • HTTPS

rpi-dmonitor: Commit


Commit MetaInfo

Revision0e95f91d83a86f2d91a3d0a2dfe5bde83c0a17af (tree)
Time2019-11-04 09:45:57
AuthorSatoshi Yasuda <7m3tjz@jarl...>
CommiterSatoshi Yasuda

Log Message

modified: dmonitor.h
modified: dmonitor_utils.c
modified: inet_read.c

Change Summary

Incremental Difference

--- 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
@@ -165,3 +165,4 @@ int jitter_wr_cnt;
165165 int jitter_wr_pnt;
166166
167167 char ptt;
168+
--- a/dmonitor_utils.c
+++ b/dmonitor_utils.c
@@ -9,6 +9,10 @@ void inet_led_onoff(void);
99 void buff_hold_size (int n);
1010 void rig_send_check (void);
1111
12+extern char dummy_frame_1[];
13+extern char dummy_frame_2[];
14+extern char dummy_frame_3[];
15+
1216 int rig_open(void)
1317 {
1418 struct termios attr;
@@ -259,16 +263,23 @@ void LastFrameSend (void)
259263 recv_frame_seq++;
260264 recv_frame_seq %= 0x15;
261265 send_buff[3] = recv_frame_seq;
262- memcpy (&send_buff[4], NullVoice, 12);
263- memcpy (&send_buff[13], last_data0, 3);
266+ memcpy (&send_buff[4], dummy_frame_1, 12);
264267 send_buff[16] = 0xff;
265268 rig_write (17, send_buff);
269+
270+ send_buff[2] = seq & 0xff;
271+ recv_frame_seq++;
272+ recv_frame_seq %= 0x15;
273+ send_buff[3] = recv_frame_seq;
274+ memcpy (&send_buff[4], dummy_frame_2, 12);
275+ rig_write (17, send_buff);
276+
266277 send_buff[2] = seq & 0xff;
267278 recv_frame_seq++;
268279 recv_frame_seq %= 0x15;
269280 send_buff[3] = recv_frame_seq;
270281 send_buff[3] |= 0x40;
271- memcpy (&send_buff[4], last_data1, 3);
282+ memcpy (&send_buff[4], dummy_frame_3, 12);
272283 rig_write (17, send_buff);
273284 drop_rate_print();
274285 inet_read_cnt = 0;
@@ -453,7 +464,7 @@ void jitter_putFifo (void)
453464 if ((jitter_buff[jitter_wr_pnt][0] != 0xff) && (jitter_buff[jitter_wr_pnt][0] & 0x40))
454465 {
455466 #ifdef _DEBUG_JITTER
456- syslog(LOG_INFO, "last freame in jitter");
467+ syslog(LOG_DEBUG, "last freame in jitter");
457468 #endif
458469 while (jitter_wr_pnt != jitter_rd_pnt)
459470 {
@@ -461,6 +472,7 @@ void jitter_putFifo (void)
461472 {
462473 jitter_buff[jitter_rd_pnt][0] = jitter_rd_pnt;
463474 inet_read_drop_cnt++;
475+ syslog (LOG_INFO, "packet loss (drop) %2.2x", jitter_rd_pnt);
464476 }
465477 putFifo (13, &jitter_buff[jitter_rd_pnt][0]);
466478 jitter_buff[jitter_rd_pnt][0] = 0x00;
--- a/inet_read.c
+++ b/inet_read.c
@@ -25,6 +25,13 @@ char dummyRFheader[42] = {0x29, 0x20, 0x00, 0x00, 0x00,
2525 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
2626 0x20, 0x20, 0x20, 0x20, 0xff};
2727
28+char dummy_frame_1[12] = {
29+ 0x73, 0x44, 0x1a, 0x72, 0x31, 0x3c, 0xa7, 0x53, 0x02, 0x55, 0x55, 0x55};
30+char dummy_frame_2[12] = {
31+ 0x9e, 0x8d, 0x32, 0x88, 0x26, 0x1a, 0x3f, 0x61, 0xe8, 0xe7, 0x84, 0x76};
32+char dummy_frame_3[12] = {
33+ 0x55, 0xc8, 0x7a, 0x88, 0x26, 0x1a, 0x3f, 0x61, 0xe8, 0x55, 0x55, 0x55};
34+
2835 void rig_send_check (void)
2936 {
3037 if (!rig_send_sw && Fifo_cnt)
@@ -46,14 +53,18 @@ void rig_fifo_check (void)
4653 void dummy_last_frame (void)
4754 {
4855 recvBuff[16] = jitter_rd_pnt;
49- memcpy (&recvBuff[17], NullVoice, 12);
50- memcpy (&recvBuff[26], LastFrame0, 3);
56+ memcpy (&recvBuff[17], dummy_frame_1, 12);
5157 jitter_put (&recvBuff[16]);
5258 jitter_putFifo();
5359 recvBuff[16]++;
5460 if (recvBuff[16] > 20) recvBuff[16] = 0x00;
61+ memcpy (&recvBuff[17], dummy_frame_2, 12);
62+ jitter_put (&recvBuff[16]);
63+ jitter_putFifo();
64+ recvBuff[16]++;
65+ if (recvBuff[16] > 20) recvBuff[16] = 0x00;
5566 recvBuff[16] |= 0x40;
56- memcpy (&recvBuff[17], LastFrame1, 3);
67+ memcpy (&recvBuff[17], dummy_frame_3, 12);
5768 jitter_put (&recvBuff[16]);
5869 memset (inet_frame_id, 0x00, 2);
5970 rig_send_check();
Show on old repository browser