• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-cqtcocoa誰得pythonphprubygameguibathyscaphec翻訳計画中(planning stage)omegatframeworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

Commit MetaInfo

Revision702bb511edc11cf8b16ff9d26fa941359f49c66c (tree)
Zeit2022-10-17 08:49:47
AutorSatoshi Yasuda <7m3tjz@jarl...>
CommiterSatoshi Yasuda

Log Message

modified: dmonitor.h
modified: dmonitor_utils.c
modified: dvap.c
modified: dvmega_utils.c
modified: extern_dmonitor.h
modified: from_node.c
modified: init.h
modified: main.c
modified: node_utils.c
modified: repeater_mon.c
modified: rig_read.c

Ändern Zusammenfassung

Diff

--- a/Makefile.am
+++ b/Makefile.am
@@ -1,10 +1,11 @@
1-bin_PROGRAMS = dmonitor repeater_mon repeater_mon_light repeater_scan rpt_conn dstar_ntpdate
1+bin_PROGRAMS = dmonitor repeater_mon repeater_mon_light repeater_scan rpt_conn dstar_ntpdate ci_v
22 dmonitor_SOURCES = main.c dmonitor_utils.c init.c dmonitor_cmd.c inet_read.c rig_read.c dvap_utils.c dvap.c dvap_conf.c dvmega.c dvmega_conf.c dstar_data.c crc.c send_msg.c dvmega_utils.c node_conf.c node_utils.c from_node.c send_node.c PICinfo.c lcd.c ntpdate.c crc.h dvap.h dmonitor.h init.h config.h dstar.h
33 dmonitor_LDADD = -lusb -lwiringPi -lwiringPiDev -lcrypto
44 repeater_mon_SOURCES = repeater_mon.c repeater_mon.h
55 repeater_mon_light_SOURCES = repeater_mon_light.c repeater_mon.h
66 repeater_scan_SOURCES = repeater_scan.c repeater_mon.h
77 rpt_conn_SOURCES = rpt_conn.c rpt_conn_utils.c rpt_conn_dvap.c rpt_dvap_utils.c rpt_conn_dvmega.c rpt_dvmega_utils.c rpt_conn_rig.c rpt_node_utils.c rpt_conn_send_msg.c rpt_conn_scan.c crc.c rpt_conn_lcd.c crc.h rpt_conn.h
8+ci_v_SOURCES = ci_v.c
89 rpt_conn_LDADD = -lusb -lwiringPi -lwiringPiDev
910 dstar_ntpdate_SOURCES = dstar_ntpdate.c
1011
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,9 @@
11 dmonitor (01.81) unstable; urgency=low
22
33 * bug fixed main.c (#141)
4+ * added skip the gps only packet & ci-v mode
45
5- -- Satoshi Yasuda <7m3tjz@jarl.com> Mon, 11 Jul 2022 13:00:00 +0900
6+ -- Satoshi Yasuda <7m3tjz@jarl.com> Sun, 16 Oct 2022 11:45:00 +0900
67
78 dmonitor (01.80) unstable; urgency=low
89
--- a/debian/control
+++ b/debian/control
@@ -8,7 +8,7 @@ Homepage: http://app.d-star.info/
88
99 Package: dmonitor
1010 Architecture: armhf
11-Depends: ${shlibs:Depends}, ${perl:Depends}, libcgi-application-perl, nkf, lighttpd, surf, wiringpi
11+Depends: ${shlibs:Depends}, ${perl:Depends}, libcgi-application-perl, nkf, lighttpd, surf, wiringpi, bluetooth, pi-bluetooth, bluez, blueman, expect
1212 Description: D-STAR repeater monitor
1313 D-STAR Rpeater monitor program
1414 access point multi_forward program
--- a/debian/install
+++ b/debian/install
@@ -7,6 +7,7 @@ auto_repmon /usr/bin
77 auto_repmon_light /usr/bin
88 rpt_conn /usr/bin
99 kill_dmonitor /usr/bin
10+ci_v /usr/bin
1011 monitor /var/www/cgi-bin
1112 kill_dmon /var/www/cgi-bin
1213 kill_repScan /var/www/cgi-bin
@@ -48,6 +49,11 @@ FileExpand.sh /var/www/cgi-bin
4849 FileExpand /var/www/cgi-bin
4950 lighttpd_first /var/www/cgi-bin
5051 dmonitor_upd /var/www/cgi-bin
52+ci-v /var/www/cgi-bin
53+CI-VSet /var/www/cgi-bin
54+CI-VStore /var/www/cgi-bin
55+bluetooth /var/www/cgi-bin
56+bluetooth_status /var/www/cgi-bin
5157 debug_exec /var/www/cgi-bin
5258 log_delete /var/www/cgi-bin
5359 index.html /var/www/html
@@ -77,6 +83,7 @@ buff_hold.txt /var/www
7783 connected_table.html.save /var/www/html
7884 error_msg.html.save /var/www/html
7985 short_msg.html.save /var/www/html
86+bluetooth.html.save /var/www/html
8087 010_www-data-nopasswd /etc/sudoers.d
8188 dmonitor_log /etc/logrotate.d
8289 rpt_conn_log /etc/logrotate.d
@@ -84,6 +91,8 @@ auto_repmon.service /etc/systemd/system
8491 rpt_conn.service /etc/systemd/system
8592 auto_repmon_light.service /etc/systemd/system
8693 dstar_ntpdate.service /etc/systemd/system
94+rfcomm.service /etc/systemd/system
95+bluetooth.service /var/tmp
8796 jquery.cookie.js /usr/share/javascript/jquery/
8897 lighttpd.conf.bullseye /var/tmp
8998 localhost.conf /var/tmp
@@ -103,7 +112,10 @@ rpt_mast.txt /var/www
103112 dvap.conf.save /var/www
104113 dvmega.conf.save /var/www
105114 node.conf.save /var/www
115+ci-v.conf.save /var/www
106116 99-dstar.rules /var/tmp
107117 dmonitor_update /var/tmp
108118 dmonitor_update_surf /var/tmp
109119 dmonitor_start /var/tmp
120+bluetooth_pair /var/tmp
121+
--- a/debian/rules
+++ b/debian/rules
@@ -33,6 +33,7 @@ override_dh_prep:
3333 cp /var/www/html/connected_table.html.save debian/tmp/
3434 cp /var/www/html/error_msg.html.save debian/tmp/
3535 cp /var/www/html/short_msg.html.save debian/tmp/
36+ cp /var/www/html/bluetooth.html.save debian/tmp/
3637 cp /var/www/html/localhost/index.html debian/tmp/localhost.index.html
3738 cp /var/www/html/localhost/simple.html debian/tmp/localhost.simple.html
3839 cp /var/www/html/update.html debian/tmp/
@@ -87,9 +88,15 @@ override_dh_prep:
8788 cp /var/www/cgi-bin/lighttpd_first debian/tmp/
8889 cp /var/www/cgi-bin/log_delete debian/tmp/
8990 cp /var/www/cgi-bin/dmonitor_upd debian/tmp/
91+ cp /var/www/cgi-bin/ci-v debian/tmp/
92+ cp /var/www/cgi-bin/CI-VSet debian/tmp/
93+ cp /var/www/cgi-bin/CI-VStore debian/tmp/
94+ cp /var/www/cgi-bin/bluetooth debian/tmp/
95+ cp /var/www/cgi-bin/bluetooth_status debian/tmp/
9096 cp /var/www/dvap.conf.save debian/tmp/
9197 cp /var/www/dvmega.conf.save debian/tmp/
9298 cp /var/www/node.conf.save debian/tmp/
99+ cp /var/www/ci-v.conf.save debian/tmp/
93100 cp /var/www/html/buff_hold.txt debian/tmp/
94101 cp /etc/sudoers.d/010_www-data-nopasswd debian/tmp/
95102 cp /etc/logrotate.d/dmonitor_log debian/tmp/
@@ -102,6 +109,8 @@ override_dh_prep:
102109 cp /etc/systemd/system/rpt_conn.service debian/tmp/
103110 cp /etc/systemd/system/auto_repmon_light.service debian/tmp/
104111 cp /etc/systemd/system/dstar_ntpdate.service debian/tmp/
112+ cp /etc/systemd/system/rfcomm.service debian/tmp/
113+ cp /lib/systemd/system/bluetooth.service debian/tmp/
105114 cp /lib/systemd/system/lighttpd.service debian/tmp/
106115 cp /etc/lighttpd/lighttpd.conf.bullseye debian/tmp/
107116 cp /etc/lighttpd/localhost.conf debian/tmp/
@@ -119,3 +128,5 @@ override_dh_prep:
119128 cp /usr/local/bin/dmonitor_update debian/tmp/
120129 cp /usr/local/bin/dmonitor_update_surf debian/tmp/
121130 cp /usr/local/bin/dmonitor_start debian/tmp/
131+ cp /usr/local/bin/bluetooth_pair debian/tmp/
132+
--- a/dmonitor.h
+++ b/dmonitor.h
@@ -41,6 +41,7 @@
4141 //#define _DEBUG_DVAP_SQUELCH
4242 //#define _DEBUG_JITTER
4343 //#define _DEBUG_INET
44+#define _DEBUG_MD5
4445
4546 #define GW 0x80
4647 #define ZR 0x40
@@ -68,6 +69,7 @@
6869 #define IDxxPlus_SPEED B38400
6970 #define DVAP_SPEED B230400
7071 #define DVMEGA_SPEED B115200
72+#define CI_V B38400
7173
7274 #define RIG_LED 19
7375 #define INET_LED 26
@@ -210,6 +212,7 @@ unsigned char MD5_dmonitor[32];
210212 #define DVAP 0x01
211213 #define DVMEGA 0x02
212214 #define NODE 0x03
215+#define CI-V 0xf0
213216
214217 char rig_type;
215218
--- a/dmonitor_utils.c
+++ b/dmonitor_utils.c
@@ -602,15 +602,15 @@ void connected_table(char str[])
602602 connected_fd = fopen (CONNECTED_LIST_TEMP, "w");
603603 fprintf (connected_fd, "<!DOCTYPE HTML>\n");
604604 fprintf (connected_fd, "<html lang=\"ja\"><head>\n");
605- fprintf (connected_fd, "<meta http-equiv=\"Pragma\" content=\"no-cache\">\n");
606- fprintf (connected_fd, "<meta http-equiv=\"Cache-Control\" content=\"no-cache\">\n");
607- fprintf (connected_fd, "<meta name=\"expires\" content=\"0\">\n");
605+ //fprintf (connected_fd, "<meta http-equiv=\"Pragma\" content=\"no-cache\">\n");
606+ //fprintf (connected_fd, "<meta http-equiv=\"Cache-Control\" content=\"no-cache\">\n");
607+ //fprintf (connected_fd, "<meta name=\"expires\" content=\"0\">\n");
608608 //fprintf (connected_fd, "<meta http-equiv=\"refresh\" content=\"1;URL=./connected_table.html\">\n");
609609 fprintf (connected_fd, "<meta http-equiv=\"refresh\" content=\"1\">\n");
610610 fprintf (connected_fd, "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n");
611- //fprintf (connected_fd, "<script type=\"text/javascript\">\n");
612- //fprintf (connected_fd, "setTimeout (function() {location.reload() ;} , 1000) ;\n");
613- //fprintf (connected_fd, "</script>\n");
611+ fprintf (connected_fd, "<script type=\"text/javascript\">\n");
612+ fprintf (connected_fd, "setTimeout (function() {location.reload() ;} , 1000) ;\n");
613+ fprintf (connected_fd, "</script>\n");
614614 fprintf (connected_fd, "</head>\n");
615615 fprintf (connected_fd, "<body style=\"background-color:#ffe6e6;\">\n");
616616 //fprintf (connected_fd, "<center>%8.8s 接続ユーザ 一覧 (%s)<br>\n", &str[36], &str[10]);
@@ -668,6 +668,9 @@ void error_msg (char str[])
668668 fprintf (error_fd, "<meta http-equiv=\"Cache-Control\" content=\"no-cache\">\n");
669669 fprintf (error_fd, "<meta name=\"expires\" content=\"0\">\n");
670670 fprintf (error_fd, "<meta http-equiv=\"refresh\" content=\"1;URL=./error_msg.html\">\n");
671+ //fprintf (connected_fd, "<script type=\"text/javascript\">\n");
672+ //fprintf (connected_fd, "setTimeout (function() {location.reload() ;} , 1000) ;\n");
673+ //fprintf (connected_fd, "</script>\n");
671674 fprintf (error_fd, "</head>\n");
672675 fprintf (error_fd, "<body style=\"background-color:#ff8c00;\">\n");
673676 fprintf (error_fd, "<center>%s</center>", &str[5]);
@@ -695,6 +698,22 @@ void error_msg (char str[])
695698 time (&msg_send_set_time);
696699 lcd_write ();
697700 }
701+ if (!memcmp (&str[41], "タイムアウト", 18))
702+ {
703+ sprintf (msg_temp, "TIME OUT %8.8s ", area_call);
704+ memcpy (mycall2, "TOUT", 4);
705+ send_msg_sw = TRUE;
706+ time (&msg_send_set_time);
707+ lcd_write ();
708+ }
709+ if (!memcmp (&str[5], "接続制限数", 15))
710+ {
711+ sprintf (msg_temp, "MAX CONNECT %8.8s", area_call);
712+ memcpy (mycall2, "MAXC", 4);
713+ send_msg_sw = TRUE;
714+ time (&msg_send_set_time);
715+ lcd_write ();
716+ }
698717 }
699718
700719 void called_msg (char mycall[], char urcall[8])
--- a/dvap.c
+++ b/dvap.c
@@ -695,14 +695,15 @@ void dvap_send_voice (void)
695695 unsigned short int crc;
696696
697697
698- if (gps_only) return;
698+ if (gps_only) goto gps_skip;
699699 if (gps_wait)
700700 {
701701 gps_wait = FALSE;
702- if (!memcmp (&dvap_voice[6], NullVoice, 12))
702+ if (!memcmp (&dvap_voice[6], NullVoice, 12)
703+ || !memcmp (&dvap_voice[6], gps_only_1, 12))
703704 {
704705 gps_only = TRUE;
705- return;
706+ goto gps_skip;
706707 }
707708 inet_send_buff[16] = 0x80;
708709 //memcpy (&inet_send_buff[17], &dvap_header[6], 41);
@@ -798,16 +799,18 @@ void dvap_send_voice (void)
798799 (struct sockaddr *)&in_addr, sizeof(in_addr));
799800 dstar_data (inet_send_buff, FALSE);
800801 }
802+ m_seq++;
803+ m_seq &= 0xffff;
804+gps_skip:
801805 if (dvap_voice[4] & 0x40)
802806 {
803807 memset (inet_frame_id, 0x00, 2);
804808 frameID = 0;
805809 digitalWrite (RIG_LED, 0);
806810 digitalWrite (INET_LED, 0);
811+ gps_wait = TRUE;
812+ gps_only = FALSE;
807813 }
808- m_seq++;
809- m_seq &= 0xffff;
810-
811814 }
812815
813816 void send_dvap_keep_alive(void)
--- a/dvmega_utils.c
+++ b/dvmega_utils.c
@@ -214,7 +214,8 @@ void dvmega_read (void)
214214 if (gps_wait)
215215 {
216216 gps_wait = FALSE;
217- if (!memcpy (&rig_buff[4], NullVoice, 12))
217+ if (!memcpy (&rig_buff[4], NullVoice, 12)
218+ || !memcmp (&rig_buff[4], gps_only_1, 12))
218219 {
219220 gps_only = TRUE;
220221 break;
--- a/extern_dmonitor.h
+++ b/extern_dmonitor.h
@@ -67,6 +67,7 @@
6767 #define IDxxPlus_SPEED B38400
6868 #define DVAP_SPEED B230400
6969 #define DVMEGA_SPEED B115200
70+#define CI_V B38400
7071
7172 #define RIG_LED 19
7273 #define INET_LED 26
@@ -324,3 +325,4 @@ extern char rf_header_save[44];
324325
325326 extern char NullVoice[12];
326327 extern char NullVoice1[12];
328+extern char gps_only_1[12];
--- a/from_node.c
+++ b/from_node.c
@@ -51,9 +51,9 @@ void header_read_from_node(void) /* read from rig (DV packet) */
5151 }
5252 no_cmd_sw = no_cmd_check (usb.node_hdr.YourCall);
5353 if (!rig_status_check()) return;
54+ #if 0
5455 gw_on = FALSE;
5556 if (!inet_send_buff_set()) return;
56- #if 0
5757 inet_send_buff[16] = 0x80;
5858 memcpy (&inet_send_buff[17], usb.buffer, 41);
5959 memcpy (&inet_send_buff[20], area_call, 8);
@@ -141,31 +141,58 @@ int voice_read_from_node()
141141 {
142142 int i;
143143 int ret;
144+ int len;
144145 unsigned short int crc;
145146
146147 int read_len;
147148
148149 read_len = 24 - voice_pnt;
149-
150- ret = usb_control_msg(udev, 0xC0, GET_DATA, 0, 0, usb.buffer, read_len, 200);
151- if (ret > 0)
150+ len = usb_control_msg(udev, 0xC0, GET_DATA, 0, 0, usb.buffer, read_len, 200);
151+ if (len > 0)
152152 {
153153 //gettimeofday(&Node_InTime, NULL);
154- for (i = 0 ; i < ret; i++)
154+ for (i = 0 ; i < len ; i++)
155155 {
156156 node_voice_save[voice_pnt] = usb.buffer[i];
157157 voice_pnt++;
158+ #if 0
159+ if ((voice_pnt == 15) && gps_only)
160+ {
161+ if (!memcmp (&node_voice_save[9], lastframe, 6))
162+ {
163+ memset (inet_frame_id, 0x00, 2);
164+ frameID = 0;
165+ HeaderLength = 0;
166+ node_voice_send_sw = FALSE;
167+ digitalWrite (RIG_LED, 0);
168+ digitalWrite (INET_LED, 0);
169+ gps_wait = TRUE;
170+ gps_only = FALSE;
171+ }
172+ }
173+ else if (voice_pnt == 24)
174+ #endif
158175 if (voice_pnt == 24)
159176 {
160- if (gps_only) return ret;
177+ if (gps_only)
178+ {
179+ memcpy (node_voice_save, &node_voice_save[12], 12);
180+ voice_pnt = 12;
181+ //return ret;
182+ goto loop_end;
183+ }
161184 if (gps_wait)
162185 {
163- gps_wait = FALSE;
164- if (!memcmp (&node_voice_save[12], NullVoice, 12))
186+ if (!memcmp (&node_voice_save[12], NullVoice, 12)
187+ || !memcmp (&node_voice_save[12], gps_only_1, 12))
165188 {
166189 gps_only = TRUE;
167- return ret;
190+ voice_pnt = 12;
191+ goto loop_end;;
168192 }
193+ gw_on = FALSE;
194+ if (!inet_send_buff_set()) return len;
195+ gps_wait = FALSE;
169196 inet_send_buff[16] = 0x80;
170197 //memcpy (&inet_send_buff[17], usb.buffer, 41);
171198 memcpy (&inet_send_buff[17], rf_header_save, 41);
@@ -256,15 +283,15 @@ int voice_read_from_node()
256283 m_seq++;
257284 m_seq &= 0xffff;
258285 }
259- else if (voice_pnt == 15)
286+ if (voice_pnt == 15)
260287 {
261288 if (!memcmp (&node_voice_save[9], lastframe, 6))
262- {
289+ {
263290 inet_send_buff[4] = (m_seq >> 8) & 0xff;
264291 inet_send_buff[5] = m_seq & 0xff;
265292 inet_send_buff[16] = seq | 0x40;
266293 memcpy (&inet_send_buff[17], &node_voice_save[12], 12);
267- if (send_sw && !rig_send_sw && node_voice_send_sw)
294+ if (send_sw && !rig_send_sw && node_voice_send_sw && !gps_only)
268295 {
269296 in_addr.sin_port = htons(dest_inet_port);
270297 in_addr.sin_addr.s_addr = inet_addr(dest_address);
@@ -279,11 +306,13 @@ int voice_read_from_node()
279306 digitalWrite (INET_LED, 0);
280307 gps_wait = TRUE;
281308 gps_only = FALSE;
309+ return len;
282310 }
283311 }
284-
312+ loop_end:
313+ continue;
285314 }
286- return ret;
315+ return len;
287316 }
288317 else if (ret < 0)
289318 {
--- a/init.h
+++ b/init.h
@@ -1,4 +1,6 @@
11 unsigned char NullVoice[12] = {0x9e,0x8d,0x32,0x88,0x26,0x1a,0x3f,0x61,0xe8,0x55,0x2d,0x16};
22 unsigned char NullVoice1[12] = {0x9e,0x8d,0x32,0x88,0x26,0x1a,0x3f,0x61,0xe8,0xe7,0x84,0x76};
3+unsigned char gps_only_1[12] = {0xb2, 0x4d, 0x22, 0x48, 0xc0, 0x16, 0x28, 0x26, 0xc8, 0x55, 0x2d, 0x16};
4+unsigned char gps_only_2[12] = {0xae, 0xcb, 0x2e, 0x59, 0xe7, 0x0a, 0x5f, 0xe7, 0xe4, 0x55, 0x2d, 0x16};
35
46
--- a/main.c
+++ b/main.c
@@ -46,7 +46,7 @@ void lcd_write (void);
4646 void ntpdate(void);
4747 void dvap_reopen(void);
4848 void invalid_os (void);
49-void right_os (void);
49+
5050
5151 time_t send_time;
5252 unsigned char *ppp;
@@ -90,7 +90,7 @@ int main(int argc, char *argv[])
9090 node_VenderID = 0x4d8;
9191 node_ProductID = 0x300;
9292 HeaderLength = 0;
93- voice_pnt = 0;
93+ voice_pnt = 12;
9494 node_tx_inv = 0;
9595 node_rx_inv = 0;
9696 node_tx_delay = 100;
@@ -189,7 +189,9 @@ os_ok:
189189 if (length <= 0 ) return -1;
190190 pg_path[length] = 0x00;
191191 if (ETagGen (pg_path, MD5_dmonitor) < 0) return 5;
192+ #ifdef _DEBUG_MD5
192193 memcpy (MD5_dmonitor, "5ebe211107266a57b1af14a7fdcd8480", 32);
194+ #endif
193195
194196 Rp = malloc (sizeof (struct FifoPkt) - 1024);
195197 Wp = Rp;
--- a/node_utils.c
+++ b/node_utils.c
@@ -124,7 +124,9 @@ void node(void)
124124 {
125125 //if (last_frame_sw) node_last_frame_send();
126126 HeaderLength = 0;
127- voice_pnt = 0;
127+ voice_pnt = 12;
128+ gps_only = FALSE;
129+ gps_wait = TRUE;
128130 }
129131 }
130132 }
--- a/repeater_mon.c
+++ b/repeater_mon.c
@@ -13,9 +13,11 @@ int col;
1313 int active_col;
1414 int json_length;
1515 int json_cnt;
16+char RigType[10];
1617 char ConnectCall[10];
1718 int repeater_cnt;
1819 char temp[256];
20+int ci_v_sw;
1921
2022 int ja_check (unsigned char callsign[])
2123 {
@@ -225,44 +227,80 @@ void prase (char str[])
225227 rep_temp[l] = 0x00;
226228 if (status)
227229 {
228- fprintf (html_fd, "<td title=\"rpt1:%8.8s rpt2:%8.8s ur:%8.8s my:%8.8s\"<tt><a href=\"/cgi-bin/monitor?ip_addr=%s&port=%d&callsign='%8.8s'&rep_name='%s'&zr_call='%8.8s'\" target=\"cmd1\" style=\"color:red;\">%s</a></tt></td><td>%s</td>\n",
230+ if (ci_v_sw)
231+ {
232+ fprintf (html_fd, "<td title=\"rpt1:%8.8s rpt2:%8.8s ur:%8.8s my:%8.8s\"<tt><a href=\"/cgi-bin/ci-v?ar_call='%8.8s'&rep_name='%s'\" target=\"cmd1\" style=\"color:red;\">%s</a></tt></td><td>%s</td>\n",
233+ rpt1_call, rpt2_call, ur_call, my_call, callsign, &rep_temp[8], call, &rep_temp[8]);
234+ } else {
235+ fprintf (html_fd, "<td title=\"rpt1:%8.8s rpt2:%8.8s ur:%8.8s my:%8.8s\"<tt><a href=\"/cgi-bin/monitor?ip_addr=%s&port=%d&callsign='%8.8s'&rep_name='%s'&zr_call='%8.8s'\" target=\"cmd1\" style=\"color:red;\">%s</a></tt></td><td>%s</td>\n",
229236 rpt1_call, rpt2_call, ur_call, my_call, ip_addr, port, callsign, &rep_temp[8], zr_call, call, &rep_temp[8]);
237+ }
230238 if (active_col == 0)
231239 {
232- fprintf (html_active_fd, "<table border=\"1\" style=\"font-size:1.0em;\">\n");
233- fprintf (html_active_fd, "<tr><td><center>Rep. Call</center></td><td><center>Rep. Name</center></td><td><center>GW Call</center></td><td><center>Ur Call</center></td><td><center>My Call</center></td></tr>\n");
240+ fprintf (html_active_fd, "<table id=\"active\" sortable=\"sortable\" border=\"1\" style=\"font-size:1.0em;\">\n");
241+ fprintf (html_active_fd, "<tr><th><center>Rep. Call</center></th><th><center>Rep. Name</center></td><th><center>GW Call</center></th><th onclick=\"sortTable(3)\"><center>Ur Call</center></th><th onclick=\"sortTable(4)\"><center>My Call</center></th></tr>\n");
234242 }
235- fprintf (html_active_fd, "<tr><td><tt><a href=\"/cgi-bin/monitor?ip_addr=%s&port=%d&callsign='%8.8s'&rep_name='%s'&zr_call='%8.8s'\" target=\"cmd1\" style=\"color:red;\">%s</a></tt></td><td>%s</td><td><tt>%8.8s</tt></td><td><tt>%8.8s</tt></td><td><tt>%8.8s</tt></td></tr>\n",
243+ if (ci_v_sw)
244+ {
245+ fprintf (html_active_fd, "<tr><td><tt><a href=\"/cgi-bin/ci-v?ar_call='%8.8s'&rep_name='%s'\" target=\"cmd1\" style=\"color:red;\">%s</a></tt></td><td>%s</td><td><tt>%8.8s</tt></td><td><tt>%8.8s</tt></td><td><tt>%8.8s</tt></td></tr>\n",
246+ callsign, &rep_temp[8], call, &rep_temp[8], zr_call, ur_call, my_call);
247+ } else {
248+ fprintf (html_active_fd, "<tr><td><tt><a href=\"/cgi-bin/monitor?ip_addr=%s&port=%d&callsign='%8.8s'&rep_name='%s'&zr_call='%8.8s'\" target=\"cmd1\" style=\"color:red;\">%s</a></tt></td><td>%s</td><td><tt>%8.8s</tt></td><td><tt>%8.8s</tt></td><td><tt>%8.8s</tt></td></tr>\n",
236249 ip_addr, port, callsign,
237-&rep_temp[8], zr_call, call, &rep_temp[8], zr_call, ur_call, my_call);
250+ &rep_temp[8], zr_call, call, &rep_temp[8], zr_call, ur_call, my_call);
251+ }
238252 active_col++;
239253 }
240254 else
241- fprintf (html_fd, "<td><tt><a href=\"/cgi-bin/monitor?ip_addr=%s&port=%d&callsign='%8.8s'&rep_name='%s'&zr_call='%8.8s'\" target=\"cmd1\">%s</a></tt></td><td>%s</td>\n",
255+ {
256+ if (ci_v_sw)
257+ {
258+ fprintf (html_fd, "<td><tt><a href=\"/cgi-bin/ci-v?ar_call='%8.8s'&rep_name='%s'\" target=\"cmd1\">%s</a></tt></td><td>%s</td>\n",
259+ callsign, &rep_temp[8], call, &rep_temp[8]);
260+ } else {
261+ fprintf (html_fd, "<td><tt><a href=\"/cgi-bin/monitor?ip_addr=%s&port=%d&callsign='%8.8s'&rep_name='%s'&zr_call='%8.8s'\" target=\"cmd1\"><font size=+0.1>%s</font></a></tt></td><td><font size=+0.1>%s</font></td>\n",
242262 ip_addr, port, callsign, &rep_temp[8], zr_call, call, &rep_temp[8]);
263+ }
264+ }
243265
244266 goto mast_close;
245267 }
246268 }
247269 }
248- if (status)
270+ if (status) // not found
249271 {
250- fprintf (html_fd, "<td title=\"rpt1:%8.8s rpt2:%8.8s ur:%8.8s my:%8.8s\"><tt><a href=\"/cgi-bin/monitor?ip_addr=%s&port=%d&callsign='%8.8s'&zr_call='%8.8s'\" target=\"cmd1\" style=\"color:red;\">%s</a></td></tt><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>\n",
272+ if (ci_v_sw)
273+ {
274+ fprintf (html_fd, "<td title=\"rpt1:%8.8s rpt2:%8.8s ur:%8.8s my:%8.8s\"><tt><a href=\"/cgi-bin/ci-v?&ar_call='%8.8s'&rep_name=' '\" target=\"cmd1\" style=\"color:red;\">%s</a></td></tt><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>\n",
275+ rpt1_call, rpt2_call, ur_call, my_call, callsign, call);
276+ } else {
277+ fprintf (html_fd, "<td title=\"rpt1:%8.8s rpt2:%8.8s ur:%8.8s my:%8.8s\"><tt><a href=\"/cgi-bin/monitor?ip_addr=%s&port=%d&callsign='%8.8s'&zr_call='%8.8s'&rep_name=' '\" target=\"cmd1\" style=\"color:red;\">%s</a></td></tt><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>\n",
251278 rpt1_call, rpt2_call, ur_call, my_call, ip_addr, port, callsign, zr_call, call);
252- if (active_col == 0)
253- {
254- fprintf (html_active_fd, "<table border=\"1\" style=\"font-size:0.9em;\">\n");
255- fprintf (html_active_fd, "<tr><td><center>Rep. Call</center></td><td><center>Rep. Name</center></td><td><center>GW Call</center></td><td><center>Ur Call</center></td><td><center>My Call</center></td></tr>\n");
256- }
257-
258- fprintf (html_active_fd, "<tr><td><tt><a href=\"/cgi-bin/monitor?ip_addr=%s&port=%d&callsign='%8.8s'&zr_call='%8.8s'\" target=\"cmd1\" style=\"color:red;\">%s</a></td></tt><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td><tt>%8.8s</tt></td><td><tt>%8.8s</tt></td><td><tt>%8.8s</tt></td></tr>\n",
279+ }
280+ if (active_col == 0)
281+ {
282+ fprintf (html_active_fd, "<table border=\"1\" style=\"font-size:0.9em;\">\n");
283+ fprintf (html_active_fd, "<tr><td><center>Rep. Call</center></td><td><center>Rep. Name</center></td><td><center>GW Call</center></td><td><center>Ur Call</center></td><td><center>My Call</center></td></tr>\n");
284+ }
285+ if (ci_v_sw)
286+ {
287+ fprintf (html_active_fd, "<tr><td><tt><a href=\"/cgi-bin/ci-v?ar_call='%8.8s'&rep_name=' '\" target=\"cmd1\" style=\"color:red;\">%s</a></td></tt><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td><tt>%8.8s</tt></td><td><tt>%8.8s</tt></td><td><tt>%8.8s</tt></td></tr>\n",
288+ callsign, call, zr_call, ur_call, my_call);
289+ } else {
290+ fprintf (html_active_fd, "<tr><td><tt><a href=\"/cgi-bin/monitor?ip_addr=%s&port=%d&callsign='%8.8s'&zr_call='%8.8s&rep_name=' ''\" target=\"cmd1\" style=\"color:red;\">%s</a></td></tt><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td><tt>%8.8s</tt></td><td><tt>%8.8s</tt></td><td><tt>%8.8s</tt></td></tr>\n",
259291 ip_addr, port, callsign, zr_call, call, zr_call, ur_call, my_call);
292+ }
260293 active_col++;
261294 }
262295 else
263296 {
264- fprintf (html_fd, "<td><tt><a href=\"/cgi-bin/monitor?ip_addr=%s&port=%d&callsign='%8.8s'&zr_call='%8.8s'\" target=\"cmd1\">%s</a></tt></td><td></td>\n",
297+ if (ci_v_sw)
298+ {
299+ fprintf (html_fd, "<td><tt><a href=\"/cgi-bin/ci-v?ar_call='%8.8s'&rep_name=' '\" target=\"cmd1\">%s</a></tt></td><td></td>\n", callsign, call);
300+ } else {
301+ fprintf (html_fd, "<td><tt><a href=\"/cgi-bin/monitor?ip_addr=%s&port=%d&callsign='%8.8s'&zr_call='%8.8s'&rep_name=' '\" target=\"cmd1\">%s</a></tt></td><td></td>\n",
265302 ip_addr, port, callsign, zr_call, call);
303+ }
266304 }
267305 mast_close:
268306 fprintf (conn_fd, "%8.8sdmonitor '%8.8s' %s %d '%8.8s' '%8.8s'\n", callsign, ConnectCall, ip_addr, port, callsign, zr_call);
@@ -424,12 +462,14 @@ os_ok:
424462 }
425463
426464 connect_fd = fopen (DMONITOR_FILE, "r");
427- fgets (ConnectCall, 10, connect_fd); // skip 2 lines
465+ fgets (RigType, 10, connect_fd);
428466 fgets (ConnectCall, 10, connect_fd);
429467 fgets (ConnectCall, 10, connect_fd);
430468 fclose (connect_fd);
431469
432470 if (!ja_check(ConnectCall)) return;
471+ if (!memcmp (RigType, "CI-V", 4)) ci_v_sw = TRUE;
472+ else ci_v_sw = FALSE;
433473
434474 ret = -1;
435475 n = 0;
@@ -537,11 +577,33 @@ os_ok:
537577 fprintf (html_fd, "\n");
538578
539579 fprintf (html_fd, "// -->\n</script>\n");
580+ fprintf (html_fd, "<style type=\"text/css\"><!--\n");
581+ fprintf (html_fd, "div.mon\n");
582+ fprintf (html_fd, "width: 500emx;\n");
583+ fprintf (html_fd, "}\n");
584+ fprintf (html_fd, "div.mon table {\n");
585+ fprintf (html_fd, "border-collapse: collapse;\n");
586+ fprintf (html_fd, "border: 1px solid black;\n");
587+ fprintf (html_fd, "width: 800px;\n");
588+ fprintf (html_fd, "}\n");
589+ fprintf (html_fd, "div.mon table th,\n");
590+ fprintf (html_fd, "div.mon table td {\n");
591+ fprintf (html_fd, "padding: 0.1em 0.6em;\n");
592+ fprintf (html_fd, "border: 1px solid gray;\n");
593+ fprintf (html_fd, "}\n");
594+ fprintf (html_fd, "div.mon table tr:nth-child(2n) {\n");
595+ fprintf (html_fd, "background-color: white;\n");
596+ fprintf (html_fd, "}\n");
597+ fprintf (html_fd, "div.mon table tr:nth-child(2n+1) {\n");
598+ fprintf (html_fd, "background-color: #e0e0e0\n");
599+ fprintf (html_fd, "}\n");
600+ fprintf (html_fd, "--></style>\n");
540601 fprintf (html_fd, "</head>\n");
541602 fprintf (html_fd, "<BODY onload=\"disp_reload()\" style=\"background-color:#ffffcc;\">\n");
542603 fprintf (html_fd, "<center>\n");
604+ fprintf (html_fd, "<div class=\"mon\">\n");
543605
544- fprintf (html_active_fd, "\n<!DOCTYPE html>\n\n");
606+ fprintf (html_active_fd, "\n<!DOCTYPE html>\n\n");
545607 fprintf (html_active_fd, "<html>\n");
546608 fprintf (html_active_fd, "<head>\n");
547609 fprintf (html_active_fd, "<title>Multi Forward Active Repeater</title>\n");
@@ -556,10 +618,55 @@ os_ok:
556618 //fprintf (html_active_fd, "setTimeout (function() {location.reload() ;} , 5000) ;\n");
557619 //fprintf (html_active_fd, "<table border=\"1\" style=\"font-size:0.9em;\">\n");
558620 fprintf (html_active_fd, "self.focus();\n");
559- fprintf (html_active_fd, "// -->\n</script>\n");
621+ fprintf (html_active_fd, "// -->\n");
622+ fprintf (html_active_fd, "function sortTable(n) {\n");
623+ fprintf (html_active_fd, "var table, rows, switching, i, x, y, shouldSwitch;\n");
624+ fprintf (html_active_fd, "table = document.getElementById(\"active\");\n");
625+ fprintf (html_active_fd, "switching = true;\n");
626+ fprintf (html_active_fd, "while (switching) {\n");
627+ fprintf (html_active_fd, "switching = false;\n");
628+ fprintf (html_active_fd, "rows = table.rows;\n");
629+ fprintf (html_active_fd, "for (i = 1; i < (rows.length - 1); i++) {\n");
630+ fprintf (html_active_fd, "shouldSwitch = false;\n");
631+ fprintf (html_active_fd, "x = rows[i].getElementsByTagName(\"TD\")[n];\n");
632+ fprintf (html_active_fd, "y = rows[i + 1].getElementsByTagName(\"TD\")[n];\n");
633+ fprintf (html_active_fd, "if (x.innerHTML.toLowerCase() > y.innerHTML.toLowerCase()) {\n");
634+ fprintf (html_active_fd, "shouldSwitch = true;\n");
635+ fprintf (html_active_fd, "break;\n}\n}\n");
636+ fprintf (html_active_fd, "if (shouldSwitch) {\n");
637+ fprintf (html_active_fd, "rows[i].parentNode.insertBefore(rows[i + 1], rows[i]);\n");
638+ fprintf (html_active_fd, "switching = true;\n");
639+ fprintf (html_active_fd, "}\n}\n}\n");
640+ fprintf (html_active_fd, "</script>\n");
641+ fprintf (html_active_fd, "<style type=\"text/css\"><!--\n");
642+ fprintf (html_active_fd, "div.active\n");
643+ fprintf (html_active_fd, "width: 500emx;\n");
644+ fprintf (html_active_fd, "}\n");
645+ fprintf (html_active_fd, "div.active table {\n");
646+ fprintf (html_active_fd, "border-collapse: collapse;\n");
647+ fprintf (html_active_fd, "border: 1px solid black;\n");
648+ fprintf (html_active_fd, "width: 800px;\n");
649+ fprintf (html_active_fd, "}\n");
650+ fprintf (html_active_fd, "div.active table th,\n");
651+ fprintf (html_active_fd, "div.active table td {\n");
652+ fprintf (html_active_fd, "padding: 0.1em 0.6em;\n");
653+ fprintf (html_active_fd, "border: 1px solid gray;\n");
654+ fprintf (html_active_fd, "}\n");
655+ fprintf (html_active_fd, "div.active table tr:nth-child(2n) {\n");
656+ fprintf (html_active_fd, "background-color: white;\n");
657+ fprintf (html_active_fd, "}\n");
658+ fprintf (html_active_fd, "div.active table tr:nth-child(2n+1) {\n");
659+ fprintf (html_active_fd, "background-color: #e0e0e0\n");
660+ fprintf (html_active_fd, "}\n");
661+ fprintf (html_active_fd, "div.active table tr:nth-child(1) {\n");
662+ fprintf (html_active_fd, "background-color: blue;\n");
663+ fprintf (html_active_fd, "color: white;\n");
664+ fprintf (html_active_fd, "}\n");
665+ fprintf (html_active_fd, "--></style>\n");
560666 fprintf (html_active_fd, "</head>\n");
561667 fprintf (html_active_fd, "<BODY style=\"background-color:#ffffcc;\">\n");
562668 fprintf (html_active_fd, "<center>\n");
669+ fprintf (html_active_fd, "<div class=\"active sortable-table\">\n");
563670 //fprintf (html_active_fd, "<table border=\"1\" style=\"font-size:0.9em;\"><tr>\n");
564671 p_cnt = 0;
565672 buff_pnt = 0;
@@ -678,7 +785,11 @@ next:
678785
679786 if (active_col)
680787 {
681- fprintf (html_active_fd, "</table>\n");
788+ fprintf (html_active_fd, "</table></div>\n");
789+ }
790+ else
791+ {
792+ fprintf (html_active_fd, "ありません");
682793 }
683794 end:
684795 fprintf (html_active_fd, "</center></BODY></HTML>\n");
--- a/rig_read.c
+++ b/rig_read.c
@@ -499,14 +499,27 @@ int rig_read (void)
499499 }
500500 else if (len == 16) /* voice */
501501 {
502- if (gps_only) break;
502+ if (gps_only)
503+ {
504+ if (rig_buff[3] & 0x40)
505+ {
506+ memset (inet_frame_id, 0x00, 2);
507+ frameID = 0;
508+ send_header_sw = FALSE;
509+ digitalWrite (RIG_LED, 0);
510+ gps_wait = TRUE;
511+ gps_only = FALSE;
512+ }
513+ goto voice_skip;
514+ }
503515 if (gps_wait)
504516 {
505517 gps_wait = FALSE;
506- if (!memcmp (&rig_buff[4], NullVoice, 12))
518+ if (!memcmp (&rig_buff[4], NullVoice, 12)
519+ || !memcmp (&rig_buff[4], gps_only_1, 12))
507520 {
508521 gps_only = TRUE;
509- break;
522+ goto voice_skip;
510523 }
511524 inet_send_buff[16] = 0x80;
512525 //memcpy (&inet_send_buff[17], &rig_buff[2], 41);
@@ -616,6 +629,7 @@ int rig_read (void)
616629 }
617630 else
618631 len = 1;
632+voice_skip:
619633 k = rig_buff_pnt - len;
620634 if (k > 0) memmove (&rig_buff[0], &rig_buff[len], k);
621635 rig_buff_pnt = k;