Revision | 702bb511edc11cf8b16ff9d26fa941359f49c66c (tree) |
---|---|
Zeit | 2022-10-17 08:49:47 |
Autor | Satoshi Yasuda <7m3tjz@jarl...> |
Commiter | Satoshi Yasuda |
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
@@ -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 | |
2 | 2 | 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 |
3 | 3 | dmonitor_LDADD = -lusb -lwiringPi -lwiringPiDev -lcrypto |
4 | 4 | repeater_mon_SOURCES = repeater_mon.c repeater_mon.h |
5 | 5 | repeater_mon_light_SOURCES = repeater_mon_light.c repeater_mon.h |
6 | 6 | repeater_scan_SOURCES = repeater_scan.c repeater_mon.h |
7 | 7 | 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 | |
8 | 9 | rpt_conn_LDADD = -lusb -lwiringPi -lwiringPiDev |
9 | 10 | dstar_ntpdate_SOURCES = dstar_ntpdate.c |
10 | 11 |
@@ -1,8 +1,9 @@ | ||
1 | 1 | dmonitor (01.81) unstable; urgency=low |
2 | 2 | |
3 | 3 | * bug fixed main.c (#141) |
4 | + * added skip the gps only packet & ci-v mode | |
4 | 5 | |
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 | |
6 | 7 | |
7 | 8 | dmonitor (01.80) unstable; urgency=low |
8 | 9 |
@@ -8,7 +8,7 @@ Homepage: http://app.d-star.info/ | ||
8 | 8 | |
9 | 9 | Package: dmonitor |
10 | 10 | 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 | |
12 | 12 | Description: D-STAR repeater monitor |
13 | 13 | D-STAR Rpeater monitor program |
14 | 14 | access point multi_forward program |
@@ -7,6 +7,7 @@ auto_repmon /usr/bin | ||
7 | 7 | auto_repmon_light /usr/bin |
8 | 8 | rpt_conn /usr/bin |
9 | 9 | kill_dmonitor /usr/bin |
10 | +ci_v /usr/bin | |
10 | 11 | monitor /var/www/cgi-bin |
11 | 12 | kill_dmon /var/www/cgi-bin |
12 | 13 | kill_repScan /var/www/cgi-bin |
@@ -48,6 +49,11 @@ FileExpand.sh /var/www/cgi-bin | ||
48 | 49 | FileExpand /var/www/cgi-bin |
49 | 50 | lighttpd_first /var/www/cgi-bin |
50 | 51 | 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 | |
51 | 57 | debug_exec /var/www/cgi-bin |
52 | 58 | log_delete /var/www/cgi-bin |
53 | 59 | index.html /var/www/html |
@@ -77,6 +83,7 @@ buff_hold.txt /var/www | ||
77 | 83 | connected_table.html.save /var/www/html |
78 | 84 | error_msg.html.save /var/www/html |
79 | 85 | short_msg.html.save /var/www/html |
86 | +bluetooth.html.save /var/www/html | |
80 | 87 | 010_www-data-nopasswd /etc/sudoers.d |
81 | 88 | dmonitor_log /etc/logrotate.d |
82 | 89 | rpt_conn_log /etc/logrotate.d |
@@ -84,6 +91,8 @@ auto_repmon.service /etc/systemd/system | ||
84 | 91 | rpt_conn.service /etc/systemd/system |
85 | 92 | auto_repmon_light.service /etc/systemd/system |
86 | 93 | dstar_ntpdate.service /etc/systemd/system |
94 | +rfcomm.service /etc/systemd/system | |
95 | +bluetooth.service /var/tmp | |
87 | 96 | jquery.cookie.js /usr/share/javascript/jquery/ |
88 | 97 | lighttpd.conf.bullseye /var/tmp |
89 | 98 | localhost.conf /var/tmp |
@@ -103,7 +112,10 @@ rpt_mast.txt /var/www | ||
103 | 112 | dvap.conf.save /var/www |
104 | 113 | dvmega.conf.save /var/www |
105 | 114 | node.conf.save /var/www |
115 | +ci-v.conf.save /var/www | |
106 | 116 | 99-dstar.rules /var/tmp |
107 | 117 | dmonitor_update /var/tmp |
108 | 118 | dmonitor_update_surf /var/tmp |
109 | 119 | dmonitor_start /var/tmp |
120 | +bluetooth_pair /var/tmp | |
121 | + |
@@ -33,6 +33,7 @@ override_dh_prep: | ||
33 | 33 | cp /var/www/html/connected_table.html.save debian/tmp/ |
34 | 34 | cp /var/www/html/error_msg.html.save debian/tmp/ |
35 | 35 | cp /var/www/html/short_msg.html.save debian/tmp/ |
36 | + cp /var/www/html/bluetooth.html.save debian/tmp/ | |
36 | 37 | cp /var/www/html/localhost/index.html debian/tmp/localhost.index.html |
37 | 38 | cp /var/www/html/localhost/simple.html debian/tmp/localhost.simple.html |
38 | 39 | cp /var/www/html/update.html debian/tmp/ |
@@ -87,9 +88,15 @@ override_dh_prep: | ||
87 | 88 | cp /var/www/cgi-bin/lighttpd_first debian/tmp/ |
88 | 89 | cp /var/www/cgi-bin/log_delete debian/tmp/ |
89 | 90 | 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/ | |
90 | 96 | cp /var/www/dvap.conf.save debian/tmp/ |
91 | 97 | cp /var/www/dvmega.conf.save debian/tmp/ |
92 | 98 | cp /var/www/node.conf.save debian/tmp/ |
99 | + cp /var/www/ci-v.conf.save debian/tmp/ | |
93 | 100 | cp /var/www/html/buff_hold.txt debian/tmp/ |
94 | 101 | cp /etc/sudoers.d/010_www-data-nopasswd debian/tmp/ |
95 | 102 | cp /etc/logrotate.d/dmonitor_log debian/tmp/ |
@@ -102,6 +109,8 @@ override_dh_prep: | ||
102 | 109 | cp /etc/systemd/system/rpt_conn.service debian/tmp/ |
103 | 110 | cp /etc/systemd/system/auto_repmon_light.service debian/tmp/ |
104 | 111 | 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/ | |
105 | 114 | cp /lib/systemd/system/lighttpd.service debian/tmp/ |
106 | 115 | cp /etc/lighttpd/lighttpd.conf.bullseye debian/tmp/ |
107 | 116 | cp /etc/lighttpd/localhost.conf debian/tmp/ |
@@ -119,3 +128,5 @@ override_dh_prep: | ||
119 | 128 | cp /usr/local/bin/dmonitor_update debian/tmp/ |
120 | 129 | cp /usr/local/bin/dmonitor_update_surf debian/tmp/ |
121 | 130 | cp /usr/local/bin/dmonitor_start debian/tmp/ |
131 | + cp /usr/local/bin/bluetooth_pair debian/tmp/ | |
132 | + |
@@ -41,6 +41,7 @@ | ||
41 | 41 | //#define _DEBUG_DVAP_SQUELCH |
42 | 42 | //#define _DEBUG_JITTER |
43 | 43 | //#define _DEBUG_INET |
44 | +#define _DEBUG_MD5 | |
44 | 45 | |
45 | 46 | #define GW 0x80 |
46 | 47 | #define ZR 0x40 |
@@ -68,6 +69,7 @@ | ||
68 | 69 | #define IDxxPlus_SPEED B38400 |
69 | 70 | #define DVAP_SPEED B230400 |
70 | 71 | #define DVMEGA_SPEED B115200 |
72 | +#define CI_V B38400 | |
71 | 73 | |
72 | 74 | #define RIG_LED 19 |
73 | 75 | #define INET_LED 26 |
@@ -210,6 +212,7 @@ unsigned char MD5_dmonitor[32]; | ||
210 | 212 | #define DVAP 0x01 |
211 | 213 | #define DVMEGA 0x02 |
212 | 214 | #define NODE 0x03 |
215 | +#define CI-V 0xf0 | |
213 | 216 | |
214 | 217 | char rig_type; |
215 | 218 |
@@ -602,15 +602,15 @@ void connected_table(char str[]) | ||
602 | 602 | connected_fd = fopen (CONNECTED_LIST_TEMP, "w"); |
603 | 603 | fprintf (connected_fd, "<!DOCTYPE HTML>\n"); |
604 | 604 | 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"); | |
608 | 608 | //fprintf (connected_fd, "<meta http-equiv=\"refresh\" content=\"1;URL=./connected_table.html\">\n"); |
609 | 609 | fprintf (connected_fd, "<meta http-equiv=\"refresh\" content=\"1\">\n"); |
610 | 610 | 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"); | |
614 | 614 | fprintf (connected_fd, "</head>\n"); |
615 | 615 | fprintf (connected_fd, "<body style=\"background-color:#ffe6e6;\">\n"); |
616 | 616 | //fprintf (connected_fd, "<center>%8.8s 接続ユーザ 一覧 (%s)<br>\n", &str[36], &str[10]); |
@@ -668,6 +668,9 @@ void error_msg (char str[]) | ||
668 | 668 | fprintf (error_fd, "<meta http-equiv=\"Cache-Control\" content=\"no-cache\">\n"); |
669 | 669 | fprintf (error_fd, "<meta name=\"expires\" content=\"0\">\n"); |
670 | 670 | 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"); | |
671 | 674 | fprintf (error_fd, "</head>\n"); |
672 | 675 | fprintf (error_fd, "<body style=\"background-color:#ff8c00;\">\n"); |
673 | 676 | fprintf (error_fd, "<center>%s</center>", &str[5]); |
@@ -695,6 +698,22 @@ void error_msg (char str[]) | ||
695 | 698 | time (&msg_send_set_time); |
696 | 699 | lcd_write (); |
697 | 700 | } |
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 | + } | |
698 | 717 | } |
699 | 718 | |
700 | 719 | void called_msg (char mycall[], char urcall[8]) |
@@ -695,14 +695,15 @@ void dvap_send_voice (void) | ||
695 | 695 | unsigned short int crc; |
696 | 696 | |
697 | 697 | |
698 | - if (gps_only) return; | |
698 | + if (gps_only) goto gps_skip; | |
699 | 699 | if (gps_wait) |
700 | 700 | { |
701 | 701 | 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)) | |
703 | 704 | { |
704 | 705 | gps_only = TRUE; |
705 | - return; | |
706 | + goto gps_skip; | |
706 | 707 | } |
707 | 708 | inet_send_buff[16] = 0x80; |
708 | 709 | //memcpy (&inet_send_buff[17], &dvap_header[6], 41); |
@@ -798,16 +799,18 @@ void dvap_send_voice (void) | ||
798 | 799 | (struct sockaddr *)&in_addr, sizeof(in_addr)); |
799 | 800 | dstar_data (inet_send_buff, FALSE); |
800 | 801 | } |
802 | + m_seq++; | |
803 | + m_seq &= 0xffff; | |
804 | +gps_skip: | |
801 | 805 | if (dvap_voice[4] & 0x40) |
802 | 806 | { |
803 | 807 | memset (inet_frame_id, 0x00, 2); |
804 | 808 | frameID = 0; |
805 | 809 | digitalWrite (RIG_LED, 0); |
806 | 810 | digitalWrite (INET_LED, 0); |
811 | + gps_wait = TRUE; | |
812 | + gps_only = FALSE; | |
807 | 813 | } |
808 | - m_seq++; | |
809 | - m_seq &= 0xffff; | |
810 | - | |
811 | 814 | } |
812 | 815 | |
813 | 816 | void send_dvap_keep_alive(void) |
@@ -214,7 +214,8 @@ void dvmega_read (void) | ||
214 | 214 | if (gps_wait) |
215 | 215 | { |
216 | 216 | 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)) | |
218 | 219 | { |
219 | 220 | gps_only = TRUE; |
220 | 221 | break; |
@@ -67,6 +67,7 @@ | ||
67 | 67 | #define IDxxPlus_SPEED B38400 |
68 | 68 | #define DVAP_SPEED B230400 |
69 | 69 | #define DVMEGA_SPEED B115200 |
70 | +#define CI_V B38400 | |
70 | 71 | |
71 | 72 | #define RIG_LED 19 |
72 | 73 | #define INET_LED 26 |
@@ -324,3 +325,4 @@ extern char rf_header_save[44]; | ||
324 | 325 | |
325 | 326 | extern char NullVoice[12]; |
326 | 327 | extern char NullVoice1[12]; |
328 | +extern char gps_only_1[12]; |
@@ -51,9 +51,9 @@ void header_read_from_node(void) /* read from rig (DV packet) */ | ||
51 | 51 | } |
52 | 52 | no_cmd_sw = no_cmd_check (usb.node_hdr.YourCall); |
53 | 53 | if (!rig_status_check()) return; |
54 | + #if 0 | |
54 | 55 | gw_on = FALSE; |
55 | 56 | if (!inet_send_buff_set()) return; |
56 | - #if 0 | |
57 | 57 | inet_send_buff[16] = 0x80; |
58 | 58 | memcpy (&inet_send_buff[17], usb.buffer, 41); |
59 | 59 | memcpy (&inet_send_buff[20], area_call, 8); |
@@ -141,31 +141,58 @@ int voice_read_from_node() | ||
141 | 141 | { |
142 | 142 | int i; |
143 | 143 | int ret; |
144 | + int len; | |
144 | 145 | unsigned short int crc; |
145 | 146 | |
146 | 147 | int read_len; |
147 | 148 | |
148 | 149 | 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) | |
152 | 152 | { |
153 | 153 | //gettimeofday(&Node_InTime, NULL); |
154 | - for (i = 0 ; i < ret; i++) | |
154 | + for (i = 0 ; i < len ; i++) | |
155 | 155 | { |
156 | 156 | node_voice_save[voice_pnt] = usb.buffer[i]; |
157 | 157 | 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 | |
158 | 175 | if (voice_pnt == 24) |
159 | 176 | { |
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 | + } | |
161 | 184 | if (gps_wait) |
162 | 185 | { |
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)) | |
165 | 188 | { |
166 | 189 | gps_only = TRUE; |
167 | - return ret; | |
190 | + voice_pnt = 12; | |
191 | + goto loop_end;; | |
168 | 192 | } |
193 | + gw_on = FALSE; | |
194 | + if (!inet_send_buff_set()) return len; | |
195 | + gps_wait = FALSE; | |
169 | 196 | inet_send_buff[16] = 0x80; |
170 | 197 | //memcpy (&inet_send_buff[17], usb.buffer, 41); |
171 | 198 | memcpy (&inet_send_buff[17], rf_header_save, 41); |
@@ -256,15 +283,15 @@ int voice_read_from_node() | ||
256 | 283 | m_seq++; |
257 | 284 | m_seq &= 0xffff; |
258 | 285 | } |
259 | - else if (voice_pnt == 15) | |
286 | + if (voice_pnt == 15) | |
260 | 287 | { |
261 | 288 | if (!memcmp (&node_voice_save[9], lastframe, 6)) |
262 | - { | |
289 | + { | |
263 | 290 | inet_send_buff[4] = (m_seq >> 8) & 0xff; |
264 | 291 | inet_send_buff[5] = m_seq & 0xff; |
265 | 292 | inet_send_buff[16] = seq | 0x40; |
266 | 293 | 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) | |
268 | 295 | { |
269 | 296 | in_addr.sin_port = htons(dest_inet_port); |
270 | 297 | in_addr.sin_addr.s_addr = inet_addr(dest_address); |
@@ -279,11 +306,13 @@ int voice_read_from_node() | ||
279 | 306 | digitalWrite (INET_LED, 0); |
280 | 307 | gps_wait = TRUE; |
281 | 308 | gps_only = FALSE; |
309 | + return len; | |
282 | 310 | } |
283 | 311 | } |
284 | - | |
312 | + loop_end: | |
313 | + continue; | |
285 | 314 | } |
286 | - return ret; | |
315 | + return len; | |
287 | 316 | } |
288 | 317 | else if (ret < 0) |
289 | 318 | { |
@@ -1,4 +1,6 @@ | ||
1 | 1 | unsigned char NullVoice[12] = {0x9e,0x8d,0x32,0x88,0x26,0x1a,0x3f,0x61,0xe8,0x55,0x2d,0x16}; |
2 | 2 | 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}; | |
3 | 5 | |
4 | 6 |
@@ -46,7 +46,7 @@ void lcd_write (void); | ||
46 | 46 | void ntpdate(void); |
47 | 47 | void dvap_reopen(void); |
48 | 48 | void invalid_os (void); |
49 | -void right_os (void); | |
49 | + | |
50 | 50 | |
51 | 51 | time_t send_time; |
52 | 52 | unsigned char *ppp; |
@@ -90,7 +90,7 @@ int main(int argc, char *argv[]) | ||
90 | 90 | node_VenderID = 0x4d8; |
91 | 91 | node_ProductID = 0x300; |
92 | 92 | HeaderLength = 0; |
93 | - voice_pnt = 0; | |
93 | + voice_pnt = 12; | |
94 | 94 | node_tx_inv = 0; |
95 | 95 | node_rx_inv = 0; |
96 | 96 | node_tx_delay = 100; |
@@ -189,7 +189,9 @@ os_ok: | ||
189 | 189 | if (length <= 0 ) return -1; |
190 | 190 | pg_path[length] = 0x00; |
191 | 191 | if (ETagGen (pg_path, MD5_dmonitor) < 0) return 5; |
192 | + #ifdef _DEBUG_MD5 | |
192 | 193 | memcpy (MD5_dmonitor, "5ebe211107266a57b1af14a7fdcd8480", 32); |
194 | + #endif | |
193 | 195 | |
194 | 196 | Rp = malloc (sizeof (struct FifoPkt) - 1024); |
195 | 197 | Wp = Rp; |
@@ -124,7 +124,9 @@ void node(void) | ||
124 | 124 | { |
125 | 125 | //if (last_frame_sw) node_last_frame_send(); |
126 | 126 | HeaderLength = 0; |
127 | - voice_pnt = 0; | |
127 | + voice_pnt = 12; | |
128 | + gps_only = FALSE; | |
129 | + gps_wait = TRUE; | |
128 | 130 | } |
129 | 131 | } |
130 | 132 | } |
@@ -13,9 +13,11 @@ int col; | ||
13 | 13 | int active_col; |
14 | 14 | int json_length; |
15 | 15 | int json_cnt; |
16 | +char RigType[10]; | |
16 | 17 | char ConnectCall[10]; |
17 | 18 | int repeater_cnt; |
18 | 19 | char temp[256]; |
20 | +int ci_v_sw; | |
19 | 21 | |
20 | 22 | int ja_check (unsigned char callsign[]) |
21 | 23 | { |
@@ -225,44 +227,80 @@ void prase (char str[]) | ||
225 | 227 | rep_temp[l] = 0x00; |
226 | 228 | if (status) |
227 | 229 | { |
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", | |
229 | 236 | rpt1_call, rpt2_call, ur_call, my_call, ip_addr, port, callsign, &rep_temp[8], zr_call, call, &rep_temp[8]); |
237 | + } | |
230 | 238 | if (active_col == 0) |
231 | 239 | { |
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"); | |
234 | 242 | } |
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", | |
236 | 249 | 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 | + } | |
238 | 252 | active_col++; |
239 | 253 | } |
240 | 254 | 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", | |
242 | 262 | ip_addr, port, callsign, &rep_temp[8], zr_call, call, &rep_temp[8]); |
263 | + } | |
264 | + } | |
243 | 265 | |
244 | 266 | goto mast_close; |
245 | 267 | } |
246 | 268 | } |
247 | 269 | } |
248 | - if (status) | |
270 | + if (status) // not found | |
249 | 271 | { |
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> </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> </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> </td>\n", | |
251 | 278 | 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> </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> </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> </td><td><tt>%8.8s</tt></td><td><tt>%8.8s</tt></td><td><tt>%8.8s</tt></td></tr>\n", | |
259 | 291 | ip_addr, port, callsign, zr_call, call, zr_call, ur_call, my_call); |
292 | + } | |
260 | 293 | active_col++; |
261 | 294 | } |
262 | 295 | else |
263 | 296 | { |
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", | |
265 | 302 | ip_addr, port, callsign, zr_call, call); |
303 | + } | |
266 | 304 | } |
267 | 305 | mast_close: |
268 | 306 | 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: | ||
424 | 462 | } |
425 | 463 | |
426 | 464 | connect_fd = fopen (DMONITOR_FILE, "r"); |
427 | - fgets (ConnectCall, 10, connect_fd); // skip 2 lines | |
465 | + fgets (RigType, 10, connect_fd); | |
428 | 466 | fgets (ConnectCall, 10, connect_fd); |
429 | 467 | fgets (ConnectCall, 10, connect_fd); |
430 | 468 | fclose (connect_fd); |
431 | 469 | |
432 | 470 | if (!ja_check(ConnectCall)) return; |
471 | + if (!memcmp (RigType, "CI-V", 4)) ci_v_sw = TRUE; | |
472 | + else ci_v_sw = FALSE; | |
433 | 473 | |
434 | 474 | ret = -1; |
435 | 475 | n = 0; |
@@ -537,11 +577,33 @@ os_ok: | ||
537 | 577 | fprintf (html_fd, "\n"); |
538 | 578 | |
539 | 579 | 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"); | |
540 | 601 | fprintf (html_fd, "</head>\n"); |
541 | 602 | fprintf (html_fd, "<BODY onload=\"disp_reload()\" style=\"background-color:#ffffcc;\">\n"); |
542 | 603 | fprintf (html_fd, "<center>\n"); |
604 | + fprintf (html_fd, "<div class=\"mon\">\n"); | |
543 | 605 | |
544 | - fprintf (html_active_fd, "\n<!DOCTYPE html>\n\n"); | |
606 | + fprintf (html_active_fd, "\n<!DOCTYPE html>\n\n"); | |
545 | 607 | fprintf (html_active_fd, "<html>\n"); |
546 | 608 | fprintf (html_active_fd, "<head>\n"); |
547 | 609 | fprintf (html_active_fd, "<title>Multi Forward Active Repeater</title>\n"); |
@@ -556,10 +618,55 @@ os_ok: | ||
556 | 618 | //fprintf (html_active_fd, "setTimeout (function() {location.reload() ;} , 5000) ;\n"); |
557 | 619 | //fprintf (html_active_fd, "<table border=\"1\" style=\"font-size:0.9em;\">\n"); |
558 | 620 | 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"); | |
560 | 666 | fprintf (html_active_fd, "</head>\n"); |
561 | 667 | fprintf (html_active_fd, "<BODY style=\"background-color:#ffffcc;\">\n"); |
562 | 668 | fprintf (html_active_fd, "<center>\n"); |
669 | + fprintf (html_active_fd, "<div class=\"active sortable-table\">\n"); | |
563 | 670 | //fprintf (html_active_fd, "<table border=\"1\" style=\"font-size:0.9em;\"><tr>\n"); |
564 | 671 | p_cnt = 0; |
565 | 672 | buff_pnt = 0; |
@@ -678,7 +785,11 @@ next: | ||
678 | 785 | |
679 | 786 | if (active_col) |
680 | 787 | { |
681 | - fprintf (html_active_fd, "</table>\n"); | |
788 | + fprintf (html_active_fd, "</table></div>\n"); | |
789 | + } | |
790 | + else | |
791 | + { | |
792 | + fprintf (html_active_fd, "ありません"); | |
682 | 793 | } |
683 | 794 | end: |
684 | 795 | fprintf (html_active_fd, "</center></BODY></HTML>\n"); |
@@ -499,14 +499,27 @@ int rig_read (void) | ||
499 | 499 | } |
500 | 500 | else if (len == 16) /* voice */ |
501 | 501 | { |
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 | + } | |
503 | 515 | if (gps_wait) |
504 | 516 | { |
505 | 517 | 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)) | |
507 | 520 | { |
508 | 521 | gps_only = TRUE; |
509 | - break; | |
522 | + goto voice_skip; | |
510 | 523 | } |
511 | 524 | inet_send_buff[16] = 0x80; |
512 | 525 | //memcpy (&inet_send_buff[17], &rig_buff[2], 41); |
@@ -616,6 +629,7 @@ int rig_read (void) | ||
616 | 629 | } |
617 | 630 | else |
618 | 631 | len = 1; |
632 | +voice_skip: | |
619 | 633 | k = rig_buff_pnt - len; |
620 | 634 | if (k > 0) memmove (&rig_buff[0], &rig_buff[len], k); |
621 | 635 | rig_buff_pnt = k; |