• R/O
  • HTTP
  • SSH
  • HTTPS

rpi-dmonitor: Commit


Commit MetaInfo

Revision10e7ffec32519b40208b9e7302605844b0ccefe1 (tree)
Zeit2019-11-03 18:20:05
AutorSatoshi Yasuda <7m3tjz@jarl...>
CommiterSatoshi Yasuda

Log Message

Merge branch 'master' of git.osdn.net:/gitroot/rpi-dmonitor/rpi-dmonitor

dmonitor.h
dmonitor_utils.c
inet_read.c
main.c
rig_read.c

Ändern Zusammenfassung

Diff

--- a/config.h
+++ b/config.h
@@ -86,7 +86,11 @@
8686 #define PACKAGE_NAME "dmonitor"
8787
8888 /* Define to the full name and version of this package. */
89+<<<<<<< HEAD
8990 #define PACKAGE_STRING "dmonitor 01.24"
91+=======
92+#define PACKAGE_STRING "dmonitor 01.22"
93+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
9094
9195 /* Define to the one symbol short name of this package. */
9296 #define PACKAGE_TARNAME "dmonitor"
@@ -95,10 +99,18 @@
9599 #define PACKAGE_URL ""
96100
97101 /* Define to the version of this package. */
102+<<<<<<< HEAD
98103 #define PACKAGE_VERSION "01.24"
104+=======
105+#define PACKAGE_VERSION "01.22"
106+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
99107
100108 /* Define to 1 if you have the ANSI C header files. */
101109 #define STDC_HEADERS 1
102110
103111 /* Version number of package */
112+<<<<<<< HEAD
104113 #define VERSION "01.24"
114+=======
115+#define VERSION "01.22"
116+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
--- a/configure
+++ b/configure
@@ -1,6 +1,10 @@
11 #! /bin/sh
22 # Guess values for system-dependent variables and create Makefiles.
3+<<<<<<< HEAD
34 # Generated by GNU Autoconf 2.69 for dmonitor 01.24.
5+=======
6+# Generated by GNU Autoconf 2.69 for dmonitor 01.22.
7+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
48 #
59 # Report bugs to <7m3tjz@jarl.com>.
610 #
@@ -580,8 +584,13 @@ MAKEFLAGS=
580584 # Identity of this package.
581585 PACKAGE_NAME='dmonitor'
582586 PACKAGE_TARNAME='dmonitor'
587+<<<<<<< HEAD
583588 PACKAGE_VERSION='01.24'
584589 PACKAGE_STRING='dmonitor 01.24'
590+=======
591+PACKAGE_VERSION='01.22'
592+PACKAGE_STRING='dmonitor 01.22'
593+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
585594 PACKAGE_BUGREPORT='7m3tjz@jarl.com'
586595 PACKAGE_URL=''
587596
@@ -1277,7 +1286,11 @@ if test "$ac_init_help" = "long"; then
12771286 # Omit some internal or obsolete options to make the list less imposing.
12781287 # This message is too long to be a string in the A/UX 3.1 sh.
12791288 cat <<_ACEOF
1289+<<<<<<< HEAD
12801290 \`configure' configures dmonitor 01.24 to adapt to many kinds of systems.
1291+=======
1292+\`configure' configures dmonitor 01.22 to adapt to many kinds of systems.
1293+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
12811294
12821295 Usage: $0 [OPTION]... [VAR=VALUE]...
12831296
@@ -1344,7 +1357,11 @@ fi
13441357
13451358 if test -n "$ac_init_help"; then
13461359 case $ac_init_help in
1360+<<<<<<< HEAD
13471361 short | recursive ) echo "Configuration of dmonitor 01.24:";;
1362+=======
1363+ short | recursive ) echo "Configuration of dmonitor 01.22:";;
1364+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
13481365 esac
13491366 cat <<\_ACEOF
13501367
@@ -1435,7 +1452,11 @@ fi
14351452 test -n "$ac_init_help" && exit $ac_status
14361453 if $ac_init_version; then
14371454 cat <<\_ACEOF
1455+<<<<<<< HEAD
14381456 dmonitor configure 01.24
1457+=======
1458+dmonitor configure 01.22
1459+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
14391460 generated by GNU Autoconf 2.69
14401461
14411462 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1804,7 +1825,11 @@ cat >config.log <<_ACEOF
18041825 This file contains any messages produced by compilers while
18051826 running configure, to aid debugging if configure makes a mistake.
18061827
1828+<<<<<<< HEAD
18071829 It was created by dmonitor $as_me 01.24, which was
1830+=======
1831+It was created by dmonitor $as_me 01.22, which was
1832+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
18081833 generated by GNU Autoconf 2.69. Invocation command line was
18091834
18101835 $ $0 $@
@@ -2670,7 +2695,11 @@ fi
26702695
26712696 # Define the identity of the package.
26722697 PACKAGE='dmonitor'
2698+<<<<<<< HEAD
26732699 VERSION='01.24'
2700+=======
2701+ VERSION='01.22'
2702+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
26742703
26752704
26762705 cat >>confdefs.h <<_ACEOF
@@ -4768,7 +4797,11 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
47684797 # report actual input values of CONFIG_FILES etc. instead of their
47694798 # values after options handling.
47704799 ac_log="
4800+<<<<<<< HEAD
47714801 This file was extended by dmonitor $as_me 01.24, which was
4802+=======
4803+This file was extended by dmonitor $as_me 01.22, which was
4804+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
47724805 generated by GNU Autoconf 2.69. Invocation command line was
47734806
47744807 CONFIG_FILES = $CONFIG_FILES
@@ -4834,7 +4867,11 @@ _ACEOF
48344867 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
48354868 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
48364869 ac_cs_version="\\
4870+<<<<<<< HEAD
48374871 dmonitor config.status 01.24
4872+=======
4873+dmonitor config.status 01.22
4874+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
48384875 configured by $0, generated by GNU Autoconf 2.69,
48394876 with options \\"\$ac_cs_config\\"
48404877
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,4 @@
1+<<<<<<< HEAD
12 dmonitor (01.25) unstable; urgency=low
23
34 * update Closes: (#087)
@@ -25,6 +26,14 @@ dmonitor (01.22) unstable; urgency=low
2526 * added jitter buffer.
2627
2728 -- Satoshi Yasuda <7m3tjz@jarl.com> Wed, 30 Oct 2019 15:00:00 +0900
29+=======
30+dmonitor (01.22) unstable; urgency=low
31+
32+ * update Closes: (#084)
33+ * changed rig ack check
34+
35+ -- Satoshi Yasuda <7m3tjz@jarl.com> Wed, 30 Oct 2019 16:45:00 +0900
36+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
2837
2938 dmonitor (01.21) unstable; urgency=low
3039
--- a/debian/dmonitor/DEBIAN/control
+++ b/debian/dmonitor/DEBIAN/control
@@ -1,5 +1,9 @@
11 Package: dmonitor
2+<<<<<<< HEAD
23 Version: 01.24
4+=======
5+Version: 01.22
6+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
37 Architecture: armhf
48 Maintainer: Satoshi Yasuda <7m3tjz@jarl.com>
59 Installed-Size: 143
--- a/debian/dmonitor/DEBIAN/md5sums
+++ b/debian/dmonitor/DEBIAN/md5sums
@@ -1,9 +1,17 @@
11 d27fb6e6be7d30ba05eedaf0319f2ce9 usr/bin/auto_repmon
2+<<<<<<< HEAD
23 b8b0a1ae5c8daacb26db9583466f2ade usr/bin/dmonitor
4+=======
5+3eb561604c5cc784f4c180d51546e803 usr/bin/dmonitor
6+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
37 4883951bb1a98b2aebec93706608ed67 usr/bin/repeater_mon
48 c5b0337b130e0b603f3c18c521b94c99 usr/bin/repeater_scan
59 fd7d34a7321d40fd2c1c039565778ec9 usr/bin/rig_port_check
10+<<<<<<< HEAD
611 29e02e0d1d6d3b5390b986740e7a7214 usr/share/doc/dmonitor/changelog.gz
12+=======
13+2562c2b2c80987d394a3f40a70f42ba3 usr/share/doc/dmonitor/changelog.gz
14+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
715 50704bff5afce197b1ea87f23e44f64a usr/share/doc/dmonitor/copyright
816 7a7d517fe81db8a20e729e972b95e943 var/tmp/10-cgi.conf.buster
917 474a2f7237ded372896c3d3020c5a953 var/tmp/10-expire.conf.buster
@@ -14,18 +22,31 @@ c445d79dbc0f455f11e4571b96d02dbc var/tmp/rc.local.new
1422 6a90cfd5694d36946458968923289676 var/www/cgi-bin/RegistCall
1523 aa5923807af7900b8fe07694ec4fc1e3 var/www/cgi-bin/Shutdown
1624 e0081f02dc77e7ef87cea584add175ad var/www/cgi-bin/Update
25+<<<<<<< HEAD
1726 cc0b4506b8c48d08043183ab7e6bb270 var/www/cgi-bin/add_buffer
1827 6ebb966c3e3d71d8a6da3648d6f24059 var/www/cgi-bin/init_cmd
1928 c2cb1bcb277afdc44fd678198404b57e var/www/cgi-bin/kill_dmon
2029 6d034a17fb4dce8e47fff2767b6ca705 var/www/cgi-bin/kill_repScan
2130 6fe96aa66f9408b970bfaa5edf1eb9e2 var/www/cgi-bin/menu
2231 12c3bae07dfe0d76a25b9f042f08a26b var/www/cgi-bin/monitor
32+=======
33+5fe14ee7c9137c14a998fb0c2f138a42 var/www/cgi-bin/add_buffer
34+6ebb966c3e3d71d8a6da3648d6f24059 var/www/cgi-bin/init_cmd
35+c2cb1bcb277afdc44fd678198404b57e var/www/cgi-bin/kill_dmon
36+6d034a17fb4dce8e47fff2767b6ca705 var/www/cgi-bin/kill_repScan
37+69b9b416350890d7bb54a92e50f81790 var/www/cgi-bin/menu
38+be28ce0cf4da50a8ecae06c25b6e799c var/www/cgi-bin/monitor
39+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
2340 bffa48941e01dee9ced1fb836476faab var/www/cgi-bin/redirect
2441 a5a6370479b0af00df0a9c1b87719188 var/www/cgi-bin/repActive
2542 de110ae308456d9a9f1689272e226bf2 var/www/cgi-bin/repMon
2643 0065c03f23c5757abc113929a6b83355 var/www/cgi-bin/repScan
2744 6f40ef2beb41d6bb59cb5d4e2b92141b var/www/cgi-bin/repUpd
45+<<<<<<< HEAD
2846 440252ca9bf01ed117125bc9ca3cac8e var/www/cgi-bin/sub_buffer
47+=======
48+88373bf269a1febe6a05d9de9c2c98f5 var/www/cgi-bin/sub_buffer
49+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
2950 b48eb3a363cba9a5d49dd28c4f964165 var/www/cgi-bin/update_log
3051 899400a1c7d58e203b3346654342f5d9 var/www/html/TrustAccessLog.html
3152 c4887e79fc60e14a6da36e60c5c289ae var/www/html/connected_table.html.save
--- a/debian/files
+++ b/debian/files
@@ -1,3 +1,9 @@
1+<<<<<<< HEAD
12 dmonitor-dbgsym_01.24_armhf.deb debug optional automatic=yes
23 dmonitor_01.24_armhf.buildinfo hamradio optional
34 dmonitor_01.24_armhf.deb hamradio optional
5+=======
6+dmonitor-dbgsym_01.22_armhf.deb debug optional automatic=yes
7+dmonitor_01.22_armhf.buildinfo hamradio optional
8+dmonitor_01.22_armhf.deb hamradio optional
9+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
--- a/debian/tmp/add_buffer
+++ b/debian/tmp/add_buffer
@@ -20,7 +20,11 @@ print <<'EOF';
2020
2121 </HEAD>
2222 <BODY>
23+<<<<<<< HEAD
2324 <h3>dmonitor connection status V01.24</h3>
25+=======
26+<h3>dmonitor connection status V01.22</h3>
27+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
2428 EOF
2529 print $call;
2630 open(BuffSize, "< /var/tmp/buff_hold.txt") or die("Error: $!");
--- a/debian/tmp/menu
+++ b/debian/tmp/menu
@@ -85,7 +85,11 @@ EOF
8585 print '<a href=http://' . $result . '/tool.html target=list>システム ツール</a>&nbsp;&nbsp;&nbsp;';
8686 print '<a href=http://log.d-star.info/dmonitor_news.html target=_blank>ニュース</a>&nbsp;&nbsp;&nbsp;';
8787 print <<'EOF'
88+<<<<<<< HEAD
8889 閉じる(戻るボタンで閉じてください) Multi Forward Monitor (dmonitor) V01.24
90+=======
91+閉じる(戻るボタンで閉じてください) Multi Forward Monitor (dmonitor) V01.22
92+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
8993 </center></body>
9094 </html>
9195 EOF
--- a/debian/tmp/monitor
+++ b/debian/tmp/monitor
@@ -22,7 +22,11 @@ print <<'EOF';
2222 <TITLE>Monitor Interface</TITLE>
2323 </HEAD>
2424 <BODY>
25+<<<<<<< HEAD
2526 <h3>dmonitor connection status V01.24</h3>
27+=======
28+<h3>dmonitor connection status V01.22</h3>
29+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
2630 <font color=red>
2731 接続コールサインが設定されていません<br>
2832 最上部のメニューから<br>
@@ -46,7 +50,11 @@ print <<'EOF';
4650
4751 </HEAD>
4852 <BODY>
53+<<<<<<< HEAD
4954 <h3>dmonitor connection status V01.24</h3>
55+=======
56+<h3>dmonitor connection status V01.22</h3>
57+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
5058 EOF
5159 system ("sudo killall -q -s 9 repeater_scan");
5260 system ("sudo killall -q -s 2 dmonitor");
--- a/debian/tmp/sub_buffer
+++ b/debian/tmp/sub_buffer
@@ -23,7 +23,11 @@ print <<'EOF';
2323
2424 </HEAD>
2525 <BODY>
26+<<<<<<< HEAD
2627 <h3>dmonitor connection status V01.24</h3>
28+=======
29+<h3>dmonitor connection status V01.22</h3>
30+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
2731 EOF
2832 print $call;
2933 print "<br><br>";
--- a/dmonitor.h
+++ b/dmonitor.h
@@ -27,11 +27,20 @@
2727 #include <wiringPi.h>
2828 #include "config.h"
2929
30+<<<<<<< HEAD
3031 //#define _DEBUG
3132 //#define _DEBUG_RIG
3233 //#define _DEBUG_RIG_9
3334 //#define _DEBUG_INET
3435 //#define _DEBUG_JITTER
36+=======
37+#define _DEBUG
38+#define _DEBUG1
39+#define _DEBUG_RIG
40+#define _DEBUG_INET
41+//#define _DEBUG_JITTER
42+
43+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
3544 #define GW 0x80
3645 #define ZR 0x40
3746 #define FWD 0x04
@@ -109,6 +118,7 @@ time_t rig_init_time;
109118 int scan_sw;
110119 struct timeval inet_time;
111120 struct timeval c_time;
121+struct timeval rig_send_time_20mSec;
112122
113123 struct timeval rig_send_time;
114124
@@ -136,6 +146,10 @@ int fifo_hold;
136146 int fifo_new_hold;
137147 int rig_last_frame_send;
138148
149+<<<<<<< HEAD
150+=======
151+
152+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
139153 int inet_led_sw;
140154 int rig_led_sw;
141155
@@ -154,6 +168,14 @@ unsigned int inet_m_save;
154168 long int inet_read_cnt;
155169 long int inet_read_drop_cnt;
156170
171+<<<<<<< HEAD
172+=======
173+unsigned char last_frame_seq;
174+
175+//int rig_voice_ack_wait;
176+//int rig_header_ack_wait;
177+
178+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
157179 long int jitter_max;
158180 long int jitter_min;
159181 long int jitter_ave;
@@ -163,4 +185,17 @@ int jitter_rd_pnt;
163185 int jitter_wr_cnt;
164186 int jitter_wr_pnt;
165187
188+<<<<<<< HEAD
166189 char ptt;
190+=======
191+unsigned char ptt;
192+unsigned char rig_buffer_save[20];
193+
194+//struct timeval rig_voice_ack_wait_timer;
195+//struct timeval rig_header_ack_wait_timer;
196+
197+//struct timeval ack_timeout;
198+
199+unsigned char recvBuff[256];
200+unsigned char save_buff[17];
201+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
--- a/dmonitor_utils.c
+++ b/dmonitor_utils.c
@@ -8,6 +8,7 @@ void rig_led_onoff(void);
88 void inet_led_onoff(void);
99 void buff_hold_size (int n);
1010 void rig_send_check (void);
11+int getFifo_length (void);
1112
1213 int rig_open(void)
1314 {
@@ -57,7 +58,7 @@ void pselectSet(void)
5758 {
5859 FD_ZERO (&fd_save);
5960 timeout.tv_sec = 0;
60- timeout.tv_nsec = 10000000;
61+ timeout.tv_nsec = 5000000;
6162 }
6263
6364 void handler (int sig)
@@ -213,6 +214,7 @@ int send_rig (void)
213214 int length;
214215 int rate;
215216
217+<<<<<<< HEAD
216218 length = getFifo (&send_buff[3]);
217219 if (length == 0)
218220 {
@@ -221,15 +223,26 @@ int send_rig (void)
221223 return FALSE;
222224 }
223225 else if (length == 42)
226+=======
227+ length = getFifo (&send_buff[3]);
228+ if (length == 42)
229+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
224230 {
231+ length = getFifo (&send_buff[3]);
225232 rig_write (42, &send_buff[3]);
226233 seq = 0;
234+<<<<<<< HEAD
235+=======
236+ rig_write (3, alive);
237+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
227238 }
228239 else if (length == 13)
229240 {
230241 send_buff[0] = 0x10;
231242 send_buff[1] = 0x22;
232243 send_buff[2] = seq & 0xff;
244+ seq++;
245+ seq &= 0xff;
233246 if ((seq % 5) == 0) rig_led_onoff();
234247 send_buff[16] = 0xff;
235248 rig_write (17, send_buff);
@@ -240,6 +253,11 @@ int send_rig (void)
240253 #endif
241254 if (Fifo_cnt < fifo_hold) rig_send_sw = FALSE;
242255 }
256+<<<<<<< HEAD
257+=======
258+ //last_frame_seq = send_buff[3];
259+ //last_frame_seq &= 0x1f;
260+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
243261 }
244262 return TRUE;
245263 }
@@ -270,7 +288,10 @@ void LastFrameSend (void)
270288 send_buff[3] |= 0x40;
271289 memcpy (&send_buff[4], last_data1, 3);
272290 rig_write (17, send_buff);
291+<<<<<<< HEAD
273292 drop_rate_print();
293+=======
294+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
274295 inet_read_cnt = 0;
275296 inet_read_drop_cnt = 0;
276297 rig_last_frame_send = TRUE;
@@ -441,7 +462,11 @@ void jitter_put (unsigned char buff[])
441462 jitter_wr_cnt++;
442463 if (jitter_wr_cnt < 0) jitter_wr_cnt = 0;
443464 #ifdef _DEBUG_JITTER
465+<<<<<<< HEAD
444466 syslog (LOG_INFO, "jitter put %d %d", jitter_wr_pnt, jitter_wr_cnt);
467+=======
468+ syslog (LOG_DEBUG, "jitter put jitter write pnt:%d jitter read pnt:%d", jitter_wr_pnt, jitter_wr_cnt);
469+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
445470 #endif
446471 }
447472
@@ -452,8 +477,13 @@ void jitter_putFifo (void)
452477
453478 if ((jitter_buff[jitter_wr_pnt][0] != 0xff) && (jitter_buff[jitter_wr_pnt][0] & 0x40))
454479 {
480+<<<<<<< HEAD
455481 #ifdef _DEBUG_JITTER
456482 syslog(LOG_INFO, "last freame in jitter");
483+=======
484+ #ifdef _DEBUG
485+ syslog(LOG_DEBUG, "last frame in jitter");
486+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
457487 #endif
458488 while (jitter_wr_pnt != jitter_rd_pnt)
459489 {
@@ -470,8 +500,8 @@ void jitter_putFifo (void)
470500 if (jitter_rd_pnt > 20) jitter_rd_pnt = 0;
471501 }
472502 putFifo (13, &jitter_buff[jitter_wr_pnt][0]);
473- jitter_buff[jitter_wr_pnt][0] = 0xff;
474- jitter_rd_pnt = 0;
503+ jitter_buff_init();
504+ memset (inet_frame_id, 0x00, 2);
475505 return;
476506 }
477507 while (jitter_buff[jitter_rd_pnt][0] != 0xff)
@@ -485,10 +515,17 @@ void jitter_putFifo (void)
485515 jitter_wr_cnt--;
486516 }
487517 #ifdef _DEBUG_JITTER
518+<<<<<<< HEAD
488519 syslog (LOG_INFO, "debug %d %d", jitter_wr_pnt, jitter_rd_pnt);
489520 syslog (LOG_INFO, "%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x",
490521 jitter_buff[0][0], jitter_buff[1][0],jitter_buff[2][0],jitter_buff[3][0],jitter_buff[4][0],
491522 jitter_buff[5][0],jitter_buff[6][0],jitter_buff[7][0],jitter_buff[8][0],jitter_buff[8][0],jitter_buff[10][0],
523+=======
524+ syslog (LOG_DEBUG, "debug %d %d", jitter_wr_pnt, jitter_rd_pnt);
525+ syslog (LOG_DEBUG, "%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x",
526+ jitter_buff[0][0], jitter_buff[1][0],jitter_buff[2][0],jitter_buff[3][0],jitter_buff[4][0],jitter_buff[5][0],
527+ jitter_buff[6][0],jitter_buff[7][0],jitter_buff[8][0],jitter_buff[8][0],jitter_buff[10][0],
528+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
492529 jitter_buff[11][0], jitter_buff[12][0],jitter_buff[13][0],jitter_buff[14][0],jitter_buff[15][0],
493530 jitter_buff[16][0],jitter_buff[17][0],jitter_buff[18][0],jitter_buff[19][0],jitter_buff[20][0]);
494531 #endif
@@ -507,9 +544,15 @@ void jitter_putFifo (void)
507544 k--;
508545 if (k < 0) k = 20;
509546 }
547+<<<<<<< HEAD
510548 #ifdef _DEBUG_JITTER
511549 syslog (LOG_INFO, "n:%d\n", n);
512550 #endif
551+=======
552+ #ifdef _DEBUG_JITTER
553+ if (n) syslog (LOG_DEBUG, "n:%d\n", n);
554+ #endif
555+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
513556 }
514557 if (n > 3)
515558 {
@@ -526,6 +569,11 @@ void jitter_putFifo (void)
526569 }
527570 jitter_wr_cnt = 0;
528571 }
572+<<<<<<< HEAD
573+=======
574+ //if (jitter_wr_pnt >= jitter_rd_pnt) syslog (LOG_INFO, "jitter0 %d", jitter_wr_pnt - jitter_rd_pnt);
575+ //else syslog (LOG_DEBUG, "jitter1 %d", jitter_wr_pnt - jitter_rd_pnt + 1);
576+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
529577 }
530578
531579 void drop_rate_print (void)
--- a/inet_read.c
+++ b/inet_read.c
@@ -12,10 +12,13 @@ void inet_led_onoff(void);
1212 void connected_table(char str[]);
1313 void error_msg (char str[]);
1414 void jitter_put (unsigned char str[]);
15+<<<<<<< HEAD
1516 void jitter_putFifo(void);
1617 void rig_send_check(void);
18+=======
19+void jitter_buff_init (void);
20+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
1721
18-unsigned char recvBuff[64];
1922 char LastFrame0[3] = {0x55, 0x55, 0x55};
2023 char LastFrame1[3] = {0x55, 0xc8, 0x7a};
2124 char dummyRFheader[42] = {0x29, 0x20, 0x00, 0x00, 0x00,
@@ -45,13 +48,24 @@ void rig_fifo_check (void)
4548
4649 void dummy_last_frame (void)
4750 {
51+<<<<<<< HEAD
4852 recvBuff[16] = jitter_rd_pnt;
53+=======
54+ int rate;
55+
56+ recvBuff[16] = jitter_rd_pnt;
57+ if (recvBuff[16] > 20) recvBuff[16] = 0;
58+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
4959 memcpy (&recvBuff[17], NullVoice, 12);
5060 memcpy (&recvBuff[26], LastFrame0, 3);
5161 jitter_put (&recvBuff[16]);
5262 jitter_putFifo();
5363 recvBuff[16]++;
64+<<<<<<< HEAD
5465 if (recvBuff[16] > 20) recvBuff[16] = 0x00;
66+=======
67+ if (recvBuff[16] > 20) recvBuff[16] = 0;
68+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
5569 recvBuff[16] |= 0x40;
5670 memcpy (&recvBuff[17], LastFrame1, 3);
5771 jitter_put (&recvBuff[16]);
@@ -60,9 +74,23 @@ void dummy_last_frame (void)
6074 digitalWrite (INET_LED, 0);
6175 digitalWrite (RIG_LED, 0);
6276 rig_last_frame_send = TRUE;
77+<<<<<<< HEAD
6378 drop_rate_print();
6479 }
6580
81+=======
82+ if (inet_read_cnt)
83+ {
84+ rate = (inet_read_drop_cnt * 10000) / inet_read_cnt;
85+ syslog(LOG_INFO, "drop pakcet rate %d.%02d%% (%ld/%ld)",
86+ rate/100, rate%100, inet_read_drop_cnt, inet_read_cnt);
87+ syslog(LOG_INFO, "jitter info. ave:%ldmSec. max:%ldmSec. min:%ldmSec.",
88+ jitter_ave/inet_read_cnt + 20, jitter_max, jitter_min);
89+ }
90+}
91+
92+
93+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
6694 void inet_read(void)
6795 {
6896 int length;
@@ -76,8 +104,11 @@ void inet_read(void)
76104 rig_fifo_check();
77105
78106 k = sizeof (struct sockaddr);
79- length = recvfrom (in_addr_sock, recvBuff, 64, 0,
107+ length = recvfrom (in_addr_sock, recvBuff, sizeof(recvBuff), 0,
80108 (struct sockaddr *)&in_addr, &k);
109+ #ifdef _DEBUG_INET
110+ syslog (LOG_INFO, "inet_read length:%d", length);
111+ #endif
81112 if (length < 0)
82113 {
83114 syslog (LOG_ERR, "recvfrom error (inet_read) %s", strerror (errno));
@@ -129,14 +160,14 @@ void inet_read(void)
129160 inet_m_save &= 0xffff;
130161 if (inet_m != inet_m_save)
131162 {
132- #ifdef _DEBUG
163+ #ifdef _DEBUG_INET
133164 if (inet_m_save != 1) syslog(LOG_ERR, "seq. error recv:%d drop:%d", inet_m, inet_m_save);
134165 #endif
135166 inet_m_save = inet_m;
136167 }
137168 if (recvBuff[13] == 0xff) return;
138169 gettimeofday (&inet_time, NULL);
139- #ifdef _DEBUG
170+ #ifdef _DEBUG_INET
140171 syslog(LOG_INFO, "length:%d FrameID:%2.2x%2.2x seq:%2.2x (Cur.FrameID:%2.2x%2.2x)",
141172 length, recvBuff[14], recvBuff[15], recvBuff[16], inet_frame_id[0], inet_frame_id[1]);
142173 #endif
@@ -162,6 +193,7 @@ void inet_read(void)
162193 jitter_max = 0;
163194 jitter_min = 500000;
164195 jitter_ave = 0;
196+ jitter_buff_init();
165197
166198 }
167199 if (!scan_sw)
@@ -180,10 +212,14 @@ void inet_read(void)
180212 {
181213 if (!memcmp (&inet_frame_id, &recvBuff[14], 2))
182214 {
183- #ifdef _DEBUG
184- if ((recvBuff[16] & 0x1f) > 0x14) syslog (LOG_INFO, "bad seq. info. %2.2x", recvBuff[16]);
215+ #ifdef _DEBUG_INET
216+ if ((recvBuff[16] & 0x1f) > 0x14) syslog (LOG_DEBUG, "bad seq. info. %2.2x", recvBuff[16]);
185217 #endif
186218 inet_read_cnt++;
219+<<<<<<< HEAD
220+=======
221+ //frame_seq_check ();
222+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
187223 if (recvBuff[16] == 0x00) inet_led_onoff();
188224 if (recvBuff[16] & 0x40)
189225 {
@@ -200,6 +236,9 @@ void inet_read(void)
200236 inet_recv_time_save.tv_sec = inet_recv_time.tv_sec;
201237 inet_recv_time_save.tv_usec = inet_recv_time.tv_usec;
202238 gettimeofday (&inet_recv_time, NULL);
239+ #ifdef _DEBUG_INET
240+ syslog (LOG_INFO, "inet read %ldmSec.", inet_recv_time.tv_usec/1000);
241+ #endif
203242 timersub (&inet_recv_time, &inet_recv_time_save, &time_sub);
204243 t_sub = time_sub.tv_sec * 1000 + time_sub.tv_usec / 1000;
205244 if (t_sub > jitter_max) jitter_max = t_sub;
@@ -211,12 +250,18 @@ void inet_read(void)
211250 {
212251 if (!memcmp (inet_frame_id, &recvBuff[14], 2))
213252 {
214- #ifdef _DEBUG
253+ #ifdef _DEBUG_INET
215254 if ((recvBuff[16] & 0x1f) > 0x14) syslog (LOG_INFO, "bad seq. info. %2.2x", recvBuff[16]);
216255 #endif
217256 inet_read_cnt++;
257+<<<<<<< HEAD
218258 recvBuff[16] &= 0x1f;
219259 memcpy (&recvBuff[17], NullVoice, 12);
260+=======
261+ //frame_seq_check ();
262+ //recvBuff[16] &= 0x1f;
263+ recvBuff[16] |= 0x40;
264+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
220265 memset (&recvBuff[26], 0x55, 3);
221266 jitter_put (&recvBuff[16]);
222267 jitter_putFifo();
@@ -229,6 +274,9 @@ void inet_read(void)
229274 inet_recv_time_save.tv_sec = inet_recv_time.tv_sec;
230275 inet_recv_time_save.tv_usec = inet_recv_time.tv_usec;
231276 gettimeofday (&inet_recv_time, NULL);
277+ #ifdef _DEBUG_INET
278+ syslog (LOG_INFO, "inet read %ldmSec.", inet_recv_time.tv_usec/1000);
279+ #endif
232280 timersub (&inet_recv_time, &inet_recv_time_save, &time_sub);
233281 t_sub = time_sub.tv_sec * 1000 + time_sub.tv_usec / 1000;
234282 if (t_sub > jitter_max) jitter_max = t_sub;
--- a/init.h
+++ b/init.h
@@ -5,5 +5,6 @@ unsigned char null_data[3] = {0xe7, 0x84, 0x76};
55 unsigned char last_data0[3] = {0x55, 0x55, 0x55};
66 unsigned char last_data1[3] = {0x55, 0xc8, 0x7a};
77 unsigned char sync_id[3] = {0x55, 0x2d, 0x16};
8+char alive[] = {0x02, 0x02, 0xff};
89
910
--- a/main.c
+++ b/main.c
@@ -24,8 +24,6 @@ void jitter_buff_init (void);
2424
2525 time_t send_time;
2626
27-unsigned char recvBuff[256];
28-
2927 int main(int argc, char *argv[])
3028 {
3129 int length;
@@ -133,9 +131,14 @@ int main(int argc, char *argv[])
133131 rig_send_time_20mSec.tv_sec = 0;
134132 rig_send_time_20mSec.tv_usec = 20000;
135133
134+<<<<<<< HEAD
136135 l_int = (fifo_hold - 5) * 20000;
137136 inet_recv_timeout.tv_sec = l_int / 1000000;
138137 inet_recv_timeout.tv_usec = l_int % 1000000;
138+=======
139+ rig_send_timeout.tv_sec = 0;
140+ rig_send_timeout.tv_usec = 400000;
141+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
139142
140143 rig_send_time.tv_sec = 0;
141144 rig_send_time.tv_usec = 0;
@@ -156,6 +159,11 @@ int main(int argc, char *argv[])
156159
157160 rig_buff_pnt = 0;
158161 rig_last_frame_send = TRUE;
162+<<<<<<< HEAD
163+=======
164+ //rig_header_ack_wait = FALSE;
165+ //rig_voice_ack_wait = FALSE;
166+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
159167
160168 jitter_buff_init();
161169
@@ -192,6 +200,16 @@ int main(int argc, char *argv[])
192200 {
193201 send_keep_alive();
194202 }
203+<<<<<<< HEAD
204+=======
205+#if 0
206+ if ((Fifo_cnt > fifo_hold) && (!rig_send_sw))
207+ {
208+ rig_send_sw = TRUE;
209+ gettimeofday (&rig_send_time, NULL);
210+ }
211+#endif
212+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
195213 if(rig_send_sw)
196214 {
197215 timeradd (&rig_send_time, &rig_send_time_20mSec, &temp_time);
@@ -210,6 +228,11 @@ int main(int argc, char *argv[])
210228 {
211229 syslog(LOG_INFO, "insert dummy_last_frame");
212230 dummy_last_frame();
231+<<<<<<< HEAD
232+=======
233+ memset (inet_frame_id, 0x00, 2);
234+ jitter_buff_init();
235+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
213236 }
214237 }
215238 }
--- a/rig_read.c
+++ b/rig_read.c
@@ -12,11 +12,16 @@ int rig_status (void);
1212 void rig_write (int length, unsigned char buff[]);
1313 void rig_led_onoff(void);
1414 void inet_led_onoff(void);
15+<<<<<<< HEAD
1516 int getFifo (char str[]);
1617 void jitter_buff_init (void);
18+=======
19+void jitter_buff_init (void);
20+int getFifo (char str[]);
21+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
1722
1823 char init_pkt[] = {0xff, 0xff, 0xff};
19-char alive[] = {0x02, 0x02, 0xff};
24+extern char alive[];
2025 int gw_on;
2126 unsigned char rig_buff[1024];
2227
@@ -86,8 +91,13 @@ enum
8691 void rig(void)
8792 {
8893 time_t cur_time;
94+<<<<<<< HEAD
8995 char dummy[42];
9096 int length;
97+=======
98+ int length;
99+ char dummy[42];
100+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
91101
92102 switch (rig_state)
93103 {
@@ -107,17 +117,29 @@ void rig(void)
107117 if (rig_init_recv())
108118 {
109119 rig_state = RIG_READ;
120+<<<<<<< HEAD
110121 syslog (LOG_INFO, "RIG(ID-xxPlus) init/re-init done");
111122 memset (inet_frame_id, 0x00, 2);
112123 rig_send_sw = FALSE;
124+=======
125+ syslog (LOG_INFO, "RIG(ID-xxPlus) init/re_init done");
126+ memset (inet_frame_id, 0x00, 2);
127+ rig_send_sw = FALSE;
128+ Fifo_cnt = 0;
129+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
113130 rig_buff_pnt = 0;
114131 rig_last_frame_send = TRUE;
115132 jitter_buff_init();
116133 length = 1;
134+<<<<<<< HEAD
117135 while (length) length = getFifo(dummy);
118136 gettimeofday (&inet_recv_time, NULL);
119137 Fifo_cnt = 0;
120138 rig_send_sw = FALSE;
139+=======
140+ while (length) length = getFifo(dummy); // buffer clear
141+ gettimeofday (&inet_recv_time, NULL);
142+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
121143 }
122144 else
123145 {
@@ -130,6 +152,7 @@ void rig(void)
130152 case RIG_READ:
131153 if (!rig_read()) rig_state = RIG_OPEN;
132154 time (&cur_time);
155+<<<<<<< HEAD
133156 if ((cur_time - rig_alive_send_time) >= 1)
134157 {
135158 rig_write (3, alive);
@@ -137,6 +160,20 @@ void rig(void)
137160 digitalWrite (RIG_LED, 0);
138161 }
139162 if ((cur_time - rig_alive_recv) >= 3)
163+=======
164+ //if (!rig_header_ack_wait && !rig_voice_ack_wait)
165+ if ((inet_frame_id[0] != 0x00) || (inet_frame_id[1] != 0x00))
166+ {
167+ if ((cur_time - rig_alive_send_time) >= 1)
168+ {
169+ rig_write (3, alive);
170+ rig_alive_send_time = cur_time;
171+ digitalWrite (RIG_LED, 0);
172+ //rig_ack_wait = TRUE;
173+ }
174+ }
175+ if ((cur_time - rig_alive_recv) >= 10)
176+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
140177 {
141178 rig_reinit();
142179 }
@@ -166,7 +203,6 @@ int rig_read (void)
166203 int ret;
167204 struct timeval cu_time;
168205 struct timeval t_time;
169- struct timeval ack_timeout;
170206
171207 if (FD_ISSET (rig_fd, &read_set))
172208 {
@@ -183,7 +219,11 @@ int rig_read (void)
183219 rig_buff_pnt += length;
184220 time (&rig_alive_recv);
185221 #ifdef _DEBUG_RIG
222+<<<<<<< HEAD
186223 syslog (LOG_INFO, "read length:%d (%d) %2.2x", length, rig_buff_pnt, rig_buff[0]);
224+=======
225+ syslog (LOG_DEBUG, "read length:%d (%d) %2.2x", length, rig_buff_pnt, rig_buff[0]);
226+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
187227 #endif
188228 }
189229 while (rig_buff_pnt)
@@ -197,18 +237,30 @@ int rig_read (void)
197237 {
198238 if (rig_buff[1] == 0x21)
199239 {
240+<<<<<<< HEAD
200241 #ifdef _DEBUG_RIG
201242 syslog (LOG_INFO, "ack header:%2.2x seq:%2.2x", rig_buff[1], rig_buff[2]);
243+=======
244+ #ifdef _DEBUG_RIG
245+ syslog (LOG_DEBUG, "ack header:%2.2x seq:%2.2x", rig_buff[1], rig_buff[2]);
246+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
202247 #endif
203248 }
204249 else if (rig_buff[1] = 0x03)
205250 {
206251 #ifdef _DEBUG_RIG
252+<<<<<<< HEAD
207253 syslog (LOG_INFO, "ack keep alive:%2.2x seq:%2.2x", rig_buff[1], rig_buff[2]);
208254 #endif
209255 ptt = rig_buff[2];
210256 }
211257
258+=======
259+ syslog (LOG_DEBUG, "ack keep alive:%2.2x seq:%2.2x", rig_buff[1], rig_buff[2]);
260+ #endif
261+ ptt = rig_buff[2];
262+ }
263+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
212264 k = rig_buff_pnt - len;
213265 if (k > 0) memmove(&rig_buff[0], &rig_buff[len], k);
214266 rig_buff_pnt = k;
@@ -221,6 +273,7 @@ int rig_read (void)
221273 if (rig_buff[2] == seq)
222274 {
223275 #ifdef _DEBUG_RIG
276+<<<<<<< HEAD
224277 syslog (LOG_INFO, "ack voice:%2.2x seq:%2.2x(%2.2x) %2.2x",
225278 rig_buff[1], rig_buff[2], seq & 0xff, rig_buff[3]);
226279 #endif
@@ -229,6 +282,23 @@ int rig_read (void)
229282 // seq++;
230283 // seq &= 0xff;
231284 //}
285+=======
286+ syslog (LOG_DEBUG, "ack voice:%2.2x seq:%2.2x(%2.2x) %2.2x",
287+ rig_buff[1], rig_buff[2], seq & 0xff, rig_buff[3]);
288+ #endif
289+ if (rig_buff[3] == 0x00)
290+ {
291+ seq++;
292+ seq &= 0xff;
293+ }
294+#if 0
295+ syslog (LOG_INFO, "%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x",
296+ rig_buff[3], save_buff[2], save_buff[3],
297+ save_buff[4], save_buff[5], save_buff[6], save_buff[7], save_buff[8], save_buff[9],
298+ save_buff[10], save_buff[11], save_buff[12], save_buff[13], save_buff[14], save_buff[15]);
299+#endif
300+
301+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
232302 k = rig_buff_pnt - len;
233303 if (k > 0) memmove(&rig_buff[0], &rig_buff[len], k);
234304 rig_buff_pnt = k;
@@ -236,8 +306,13 @@ int rig_read (void)
236306 }
237307 else
238308 {
309+<<<<<<< HEAD
239310 //seq = rig_buff[2] + 1;
240311 //seq &= 0xff;
312+=======
313+ seq++;
314+ seq &= 0xff;
315+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
241316 }
242317 #ifdef _DEBUG_RIG
243318 syslog(LOG_INFO, "ack seq error %2.2x %2.2x %2.2x", rig_buff[2], seq, rig_buff[3]);
@@ -347,11 +422,18 @@ int rig_read (void)
347422 }
348423 error_msg_sw = FALSE;
349424
425+<<<<<<< HEAD
350426 if ((Fifo_cnt > (fifo_hold + 20)) || (Fifo_cnt < 0))
351427 {
352428 syslog (LOG_INFO, "rig fifo overflow");
353429 rig_state = RIG_INIT;
354430 drop_rate_print();
431+=======
432+ if (Fifo_cnt > (fifo_hold + 10))
433+ {
434+ syslog (LOG_INFO, "rig Fifo bufer over ");
435+ rig_state = RIG_INIT;
436+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
355437 }
356438 return TRUE;
357439 }
@@ -359,6 +441,7 @@ int rig_read (void)
359441 void rig_write (int length, unsigned char buff[])
360442 {
361443 int ret;
444+<<<<<<< HEAD
362445
363446 if (length == 17)
364447 {
@@ -366,16 +449,34 @@ void rig_write (int length, unsigned char buff[])
366449 seq &= 0xff;
367450 recv_frame_seq = buff[3];
368451 }
452+=======
453+ struct timeval c_time;
454+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
369455
370456 ret = write (rig_fd, buff, length);
371457 if (ret == -1)
372458 {
373459 syslog(LOG_ERR, "rig write error %s", strerror(errno));
374460 }
461+<<<<<<< HEAD
375462 time (&rig_alive_send_time);
463+=======
464+ gettimeofday (&c_time, NULL);
465+ #ifdef _DEBUG_RIG
466+ syslog (LOG_DEBUG, "send time %ldmSec.", c_time.tv_usec/1000);
467+ #endif
468+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
376469 #ifdef _DEBUG_RIG
377470 syslog (LOG_INFO, "rig_write %d %d %2.2x %2.2x", length, ret, buff[2], buff[3]);
471+ if (length == 17)
472+ {
473+ syslog (LOG_INFO, "%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x",
474+ buff[2], buff[3],
475+ buff[4], buff[5], buff[6], buff[7], buff[8], buff[9],
476+ buff[10], buff[11], buff[12], buff[13], buff[14], buff[15]);
477+ }
378478 #endif
479+<<<<<<< HEAD
379480 #ifdef _DEBUG_RIG_9
380481 if (length == 17)
381482 {
@@ -385,6 +486,9 @@ void rig_write (int length, unsigned char buff[])
385486 buff[11], buff[12], buff[13], buff[14], buff[15], buff[16], Fifo_cnt);
386487 }
387488 #endif
489+=======
490+ if (length == 17) memcpy (save_buff, buff, 17);
491+>>>>>>> 81354636e20f706919e40e1639528b30b06a4f38
388492 }
389493
390494 void send_rig_init (void)
Show on old repository browser