• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqtwindows誰得cocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

Commit MetaInfo

Revision7482615e74a56e2c43c01ecf5c26493c47d3d381 (tree)
Zeit2022-08-16 15:58:23
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: main.c
modified: rig_read.c

Ändern Zusammenfassung

Diff

--- a/config.h
+++ b/config.h
@@ -102,7 +102,7 @@
102102 #define PACKAGE_NAME "dmonitor"
103103
104104 /* Define to the full name and version of this package. */
105-#define PACKAGE_STRING "dmonitor 01.80"
105+#define PACKAGE_STRING "dmonitor 01.81"
106106
107107 /* Define to the one symbol short name of this package. */
108108 #define PACKAGE_TARNAME "dmonitor"
@@ -111,13 +111,13 @@
111111 #define PACKAGE_URL ""
112112
113113 /* Define to the version of this package. */
114-#define PACKAGE_VERSION "01.80"
114+#define PACKAGE_VERSION "01.81"
115115
116116 /* Define to 1 if you have the ANSI C header files. */
117117 #define STDC_HEADERS 1
118118
119119 /* Version number of package */
120-#define VERSION "01.80"
120+#define VERSION "01.81"
121121
122122 /* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
123123 <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
11 #! /bin/sh
22 # Guess values for system-dependent variables and create Makefiles.
3-# Generated by GNU Autoconf 2.69 for dmonitor 01.80.
3+# Generated by GNU Autoconf 2.69 for dmonitor 01.81.
44 #
55 # Report bugs to <7m3tjz@jarl.com>.
66 #
@@ -580,8 +580,8 @@ MAKEFLAGS=
580580 # Identity of this package.
581581 PACKAGE_NAME='dmonitor'
582582 PACKAGE_TARNAME='dmonitor'
583-PACKAGE_VERSION='01.80'
584-PACKAGE_STRING='dmonitor 01.80'
583+PACKAGE_VERSION='01.81'
584+PACKAGE_STRING='dmonitor 01.81'
585585 PACKAGE_BUGREPORT='7m3tjz@jarl.com'
586586 PACKAGE_URL=''
587587
@@ -1277,7 +1277,7 @@ if test "$ac_init_help" = "long"; then
12771277 # Omit some internal or obsolete options to make the list less imposing.
12781278 # This message is too long to be a string in the A/UX 3.1 sh.
12791279 cat <<_ACEOF
1280-\`configure' configures dmonitor 01.80 to adapt to many kinds of systems.
1280+\`configure' configures dmonitor 01.81 to adapt to many kinds of systems.
12811281
12821282 Usage: $0 [OPTION]... [VAR=VALUE]...
12831283
@@ -1344,7 +1344,7 @@ fi
13441344
13451345 if test -n "$ac_init_help"; then
13461346 case $ac_init_help in
1347- short | recursive ) echo "Configuration of dmonitor 01.80:";;
1347+ short | recursive ) echo "Configuration of dmonitor 01.81:";;
13481348 esac
13491349 cat <<\_ACEOF
13501350
@@ -1435,7 +1435,7 @@ fi
14351435 test -n "$ac_init_help" && exit $ac_status
14361436 if $ac_init_version; then
14371437 cat <<\_ACEOF
1438-dmonitor configure 01.80
1438+dmonitor configure 01.81
14391439 generated by GNU Autoconf 2.69
14401440
14411441 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1912,7 +1912,7 @@ cat >config.log <<_ACEOF
19121912 This file contains any messages produced by compilers while
19131913 running configure, to aid debugging if configure makes a mistake.
19141914
1915-It was created by dmonitor $as_me 01.80, which was
1915+It was created by dmonitor $as_me 01.81, which was
19161916 generated by GNU Autoconf 2.69. Invocation command line was
19171917
19181918 $ $0 $@
@@ -2773,7 +2773,7 @@ fi
27732773
27742774 # Define the identity of the package.
27752775 PACKAGE='dmonitor'
2776- VERSION='01.80'
2776+ VERSION='01.81'
27772777
27782778
27792779 cat >>confdefs.h <<_ACEOF
@@ -5043,7 +5043,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
50435043 # report actual input values of CONFIG_FILES etc. instead of their
50445044 # values after options handling.
50455045 ac_log="
5046-This file was extended by dmonitor $as_me 01.80, which was
5046+This file was extended by dmonitor $as_me 01.81, which was
50475047 generated by GNU Autoconf 2.69. Invocation command line was
50485048
50495049 CONFIG_FILES = $CONFIG_FILES
@@ -5109,7 +5109,7 @@ _ACEOF
51095109 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
51105110 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
51115111 ac_cs_version="\\
5112-dmonitor config.status 01.80
5112+dmonitor config.status 01.81
51135113 configured by $0, generated by GNU Autoconf 2.69,
51145114 with options \\"\$ac_cs_config\\"
51155115
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,12 @@
1+dmonitor (01.81) unstable; urgency=low
2+
3+ * bug fixed main.c (#141)
4+
5+ -- Satoshi Yasuda <7m3tjz@jarl.com> Mon, 11 Jul 2022 13:00:00 +0900
6+
17 dmonitor (01.80) unstable; urgency=low
28
3- * bug fixed typo
9+ * bug fixed typo (#140)
410
511 -- Satoshi Yasuda <7m3tjz@jarl.com> Sun, 26 Jun 2022 00:00:00 +0900
612
--- a/dmonitor.h
+++ b/dmonitor.h
@@ -30,13 +30,14 @@
3030 #include <usb.h>
3131 #include "dstar.h"
3232 #include "node.h"
33+#include "init.h"
3334 #include "config.h"
3435
3536 #define _DEBUG_DVAP
3637 //#define _DEBUG_DVMEGA
3738 //#define _SPECIFICATIO_CHECK
38-#define _DEBUG_DVAP_SEND
39-#define _DEBUG_DVAP_RECV
39+//#define _DEBUG_DVAP_SEND
40+//#define _DEBUG_DVAP_RECV
4041 //#define _DEBUG_DVAP_SQUELCH
4142 //#define _DEBUG_JITTER
4243 //#define _DEBUG_INET
@@ -314,4 +315,12 @@ time_t msg_send_set_time;
314315 int unlink_sw;
315316 int no_cmd_sw;
316317 int used_call_sw;
317-long int l_int;
318+long int l_int;
319+
320+/* GPS skip */
321+int gps_wait;
322+int gps_only;
323+
324+char rf_header_save[44];
325+
326+
--- a/dmonitor_utils.c
+++ b/dmonitor_utils.c
@@ -1,5 +1,5 @@
11 #include "extern_dmonitor.h"
2-#include "init.h"
2+//#include "init.h"
33
44 void rig_write (int length, char buff[]);
55 int getFifo (unsigned char pkt[]);
@@ -333,7 +333,6 @@ void send_keep_alive(void)
333333 sprintf (&buff[4], "%s", inet_ntoa (in_addr.sin_addr));
334334 ret =sendto(in_addr_sock, &buff[4], 24, MSG_DONTWAIT,
335335 (struct sockaddr *)&in_addr, sizeof(in_addr));
336- syslog (LOG_DEBUG, "sendto length:%d", ret);
337336 time(&hole_punch_send_time);
338337
339338 memcpy (&buff[20], "dmoni", 5);
@@ -365,7 +364,6 @@ void send_keep_alive(void)
365364 buff[79] = 0x20;
366365 ret = sendto(in_addr_sock, buff, 88, MSG_DONTWAIT,
367366 (struct sockaddr *)&in_addr, sizeof(in_addr));
368- syslog (LOG_DEBUG, "sendto length:%d", ret);
369367 time(&hole_punch_send_time);
370368 time(&dest_keep_alive_send_time);
371369 }
--- a/dvap.c
+++ b/dvap.c
@@ -617,6 +617,7 @@ void dvap_send_header (void)
617617 }
618618 gw_on = FALSE;
619619 if (!inet_send_buff_set()) return;
620+ #if 0
620621 inet_send_buff[16] = 0x80;
621622 memcpy (&inet_send_buff[17], &dvap_header[6], 41);
622623 memcpy (&inet_send_buff[20], area_call, 8);
@@ -681,11 +682,94 @@ void dvap_send_header (void)
681682 m_seq++;
682683 m_seq &= 0xffff;
683684 //dvap_last_frame_sw = TRUE;
685+ #endif
686+ memcpy (rf_header_save, &dvap_header[3], 44);
687+ gps_wait = TRUE;
688+ gps_only = FALSE;
684689 }
685690
686691 void dvap_send_voice (void)
687692 {
688693 int length;
694+ int ret;
695+ unsigned short int crc;
696+
697+
698+ if (gps_only) return;
699+ if (gps_wait)
700+ {
701+ gps_wait = FALSE;
702+ if (!memcmp (&dvap_voice[6], NullVoice, 12))
703+ {
704+ gps_only = TRUE;
705+ return;
706+ }
707+ inet_send_buff[16] = 0x80;
708+ //memcpy (&inet_send_buff[17], &dvap_header[6], 41);
709+ memcpy (&inet_send_buff[17], &rf_header_save[3], 41);
710+ memcpy (&inet_send_buff[20], area_call, 8);
711+ memcpy (&inet_send_buff[28], area_call, 8);
712+ if (memcmp (&inet_send_buff[36], "CQCQCQ ", 8)) gw_on = TRUE;
713+ if (send_sw && !rig_send_sw && no_cmd_sw)
714+ {
715+ memset (inet_frame_id, 0xff, 2);
716+ in_addr.sin_port = htons(dest_inet_port);
717+ in_addr.sin_addr.s_addr = inet_addr(dest_address);
718+ m_seq++;
719+ m_seq &= 0xffff;
720+ inet_send_buff[4] = (m_seq >> 8) & 0xff;
721+ inet_send_buff[5] = m_seq & 0xff;
722+ inet_send_buff[7] |= FWD | ZR;
723+ crc = crc_calc (&inet_send_buff[17], 39);
724+ inet_send_buff[56] = (crc >> 8) & 0xff;
725+ inet_send_buff[57] = crc & 0xff;
726+ ret = sendto (in_addr_sock, inet_send_buff, 58, MSG_DONTWAIT,
727+ (struct sockaddr *)&in_addr, sizeof(in_addr));
728+ m_seq++;
729+ m_seq &= 0xffff;
730+ inet_send_buff[4] = (m_seq >> 8) & 0xff;
731+ inet_send_buff[5] = m_seq & 0xff;
732+ memcpy (&inet_send_buff[28], area_call, 8);
733+ memcpy (&inet_send_buff[20], area_call, 8);
734+ crc = crc_calc (&inet_send_buff[17], 39);
735+ inet_send_buff[56] = (crc >> 8) & 0xff;
736+ inet_send_buff[57] = crc & 0xff;
737+ sendto (in_addr_sock, inet_send_buff, 58, MSG_DONTWAIT,
738+ (struct sockaddr *)&in_addr, sizeof(in_addr));
739+ memset (short_msg, 0x20, 20);
740+ memcpy (used_call, &inet_send_buff[44], 8);
741+ memcpy (used_call2, &inet_send_buff[52], 4);
742+ used_call_sw = TRUE;
743+ short_msg_wrt ();
744+ send_header_sw = TRUE;
745+ if (gw_on)
746+ {
747+ memcpy (&inet_send_buff[20], zone_call, 8);
748+ inet_send_buff[27] = 'G';
749+ inet_send_buff[7] &= 0x33;
750+ inet_send_buff[7] |= GW;
751+ m_seq++;
752+ m_seq &= 0xffff;
753+ inet_send_buff[4] = (m_seq >> 8) & 0xff;
754+ inet_send_buff[5] = m_seq & 0xff;
755+ crc = crc_calc (&inet_send_buff[17], 39);
756+ inet_send_buff[56] = (crc >> 8) & 0xff;
757+ inet_send_buff[57] = crc & 0xff;
758+ sendto (in_addr_sock, inet_send_buff, 58, MSG_DONTWAIT,
759+ (struct sockaddr *)&in_addr, sizeof(in_addr));
760+ m_seq++;
761+ m_seq &= 0xffff;
762+ inet_send_buff[4] = (m_seq >> 8) & 0xff;
763+ inet_send_buff[5] = m_seq & 0xff;
764+ sendto (in_addr_sock, inet_send_buff, 58, MSG_DONTWAIT,
765+ (struct sockaddr *)&in_addr, sizeof(in_addr));
766+ if ((m_seq % 5) == 0) inet_led_onoff();
767+ }
768+ }
769+ m_seq++;
770+ m_seq &= 0xffff;
771+ //dvap_last_frame_sw = TRUE;
772+ }
689773 if (!send_header_sw)
690774 {
691775 inet_send_buff[16] = dvap_voice[4];
@@ -813,6 +897,8 @@ void dvap_write (int fd, unsigned char buff[], int length)
813897 {
814898 dvap_send_pkt[4] |= 0x40;
815899 send_header_sw = FALSE;
900+ gps_wait = TRUE;
901+ gps_only = FALSE;
816902 }
817903 ret = write (fd, dvap_send_pkt, 18);
818904 dvap_send_pkt[5]++;
--- a/dvmega_utils.c
+++ b/dvmega_utils.c
@@ -142,6 +142,7 @@ void dvmega_read (void)
142142 if (!rig_status_check()) return;
143143 gw_on = FALSE;
144144 if (!inet_send_buff_set()) break;
145+ #if 0
145146 inet_send_buff[16] = 0x80;
146147 memcpy (&inet_send_buff[17], &rig_buff[3], 41);
147148 memcpy (&inet_send_buff[20], area_call, 8);
@@ -202,9 +203,84 @@ void dvmega_read (void)
202203 m_seq++;
203204 m_seq &= 0xffff;
204205 dvmega_frame_seq = 0x00;
206+ #endif
207+ memcpy (rf_header_save, rig_buff, 44);
208+ gps_wait = TRUE;
209+ gps_only = FALSE;
205210 break;
206211
207212 case DVMEGA_DSTAR_DATA:
213+ if (gps_only) break;
214+ if (gps_wait)
215+ {
216+ gps_wait = FALSE;
217+ if (!memcpy (&rig_buff[4], NullVoice, 12))
218+ {
219+ gps_only = TRUE;
220+ break;
221+ }
222+ inet_send_buff[16] = 0x80;
223+ //memcpy (&inet_send_buff[17], &rig_buff[3], 41);
224+ memcpy (&inet_send_buff[17], &rf_header_save[3], 41);
225+ memcpy (&inet_send_buff[20], area_call, 8);
226+ memcpy (&inet_send_buff[28], area_call, 8);
227+ if (memcmp (&inet_send_buff[36], "CQCQCQ ", 8)) gw_on = TRUE;
228+ if (send_sw && !rig_send_sw && no_cmd_sw)
229+ {
230+ send_header_sw = TRUE;
231+ memset (inet_frame_id, 0xff, 2);
232+ dvmega_last_frame_sw = FALSE;
233+ in_addr.sin_port = htons(dest_inet_port);
234+ in_addr.sin_addr.s_addr = inet_addr(dest_address);
235+ m_seq++;
236+ m_seq &= 0xffff;
237+ inet_send_buff[4] = (m_seq >> 8) & 0xff;
238+ inet_send_buff[5] = m_seq & 0xff;
239+ inet_send_buff[7] |= FWD | ZR;
240+ crc = crc_calc (&inet_send_buff[17], 39);
241+ inet_send_buff[56] = (crc >> 8) & 0xff;
242+ inet_send_buff[57] = crc & 0xff;
243+ ret = sendto (in_addr_sock, inet_send_buff, 58, MSG_DONTWAIT,
244+ (struct sockaddr *)&in_addr, sizeof(in_addr));
245+ m_seq++;
246+ m_seq &= 0xffff;
247+ inet_send_buff[4] = (m_seq >> 8) & 0xff;
248+ inet_send_buff[5] = m_seq & 0xff;
249+ sendto (in_addr_sock, inet_send_buff, 58, MSG_DONTWAIT,
250+ (struct sockaddr *)&in_addr, sizeof(in_addr));
251+ memset (short_msg, 0x20, 20);
252+ memcpy (used_call, &inet_send_buff[44], 8);
253+ memcpy (used_call2, &inet_send_buff[52], 4);
254+ used_call_sw = TRUE;
255+ short_msg_wrt();
256+ if (gw_on)
257+ {
258+ memcpy (&inet_send_buff[20], zone_call, 8);
259+ inet_send_buff[27] = 'G';
260+ inet_send_buff[7] &= 0x33;
261+ inet_send_buff[7] |= GW;
262+ m_seq++;
263+ m_seq &= 0xffff;
264+ inet_send_buff[4] = (m_seq >> 8) & 0xff;
265+ inet_send_buff[5] = m_seq & 0xff;
266+ crc = crc_calc (&inet_send_buff[17], 39);
267+ inet_send_buff[56] = (crc >> 8) & 0xff;
268+ inet_send_buff[57] = crc & 0xff;
269+ sendto (in_addr_sock, inet_send_buff, 58, MSG_DONTWAIT,
270+ (struct sockaddr *)&in_addr, sizeof(in_addr));
271+ m_seq++;
272+ m_seq &= 0xffff;
273+ inet_send_buff[4] = (m_seq >> 8) & 0xff;
274+ inet_send_buff[5] = m_seq & 0xff;
275+ sendto (in_addr_sock, inet_send_buff, 58, MSG_DONTWAIT,
276+ (struct sockaddr *)&in_addr, sizeof(in_addr));
277+ if ((m_seq % 5) == 0) inet_led_onoff();
278+ }
279+ }
280+ m_seq++;
281+ m_seq &= 0xffff;
282+ dvmega_frame_seq = 0x00;
283+ }
208284 if (!memcmp (&rig_buff[12], resync, 3)) dvmega_frame_seq = 0;
209285 if (!send_header_sw)
210286 {
@@ -320,6 +396,8 @@ void dvmega_read (void)
320396 (struct sockaddr *)&in_addr, sizeof(in_addr));
321397 m_seq++;
322398 m_seq &= 0xffff;
399+ gps_wait = TRUE;
400+ gps_only = FALSE;
323401 }
324402 }
325403 frameID = 0;
--- a/extern_dmonitor.h
+++ b/extern_dmonitor.h
@@ -315,3 +315,12 @@ extern int unlink_sw;
315315 extern int no_cmd_sw;
316316 extern int used_call_sw;
317317 extern long int l_int;
318+
319+/* GPS only cehck */
320+extern int gps_wait;
321+extern int gps_only;
322+
323+extern char rf_header_save[44];
324+
325+extern char NullVoice[12];
326+extern char NullVoice1[12];
--- a/from_node.c
+++ b/from_node.c
@@ -7,7 +7,6 @@ void inet_led_onoff (void);
77 int inet_send_buff_set (void);
88 void short_msg_wrt (void);
99 void dstar_data (unsigned char string[], int inet);
10-void dstar_alt_header (unsigned char string[], int inet);
1110 unsigned short int crc_calc (char str[], int length);
1211 int no_cmd_check (unsigned char cmd[]);
1312 int rig_status_check(void);
@@ -54,12 +53,13 @@ void header_read_from_node(void) /* read from rig (DV packet) */
5453 if (!rig_status_check()) return;
5554 gw_on = FALSE;
5655 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);
6060 memcpy (&inet_send_buff[28], area_call, 8);
6161 if (memcmp (&inet_send_buff[36], "CQCQCQ ", 8)) gw_on = TRUE;
62- if (send_sw && !rig_send_sw && !node_voice_send_sw && no_cmd_sw)
62+ if (send_sw && !rig_send_sw && !node_voice_send_sw)
6363 {
6464 memset (inet_frame_id, 0xff, 2);
6565 node_last_frame_sw = FALSE;
@@ -85,7 +85,6 @@ void header_read_from_node(void) /* read from rig (DV packet) */
8585 memset (short_msg, 0x20, 20);
8686 memcpy (used_call, &inet_send_buff[44], 8);
8787 memcpy (used_call2, &inet_send_buff[52], 4);
88- used_call_sw = TRUE;
8988 short_msg_wrt ();
9089 if (gw_on)
9190 {
@@ -113,10 +112,13 @@ void header_read_from_node(void) /* read from rig (DV packet) */
113112 }
114113 m_seq++;
115114 m_seq &= 0xffff;
115+ seq = 0;
116+ #endif
116117 HeaderLength = 41;
117- send_header_sw = TRUE;
118118 voice_pnt = 12;
119- seq = 0;
119+ memcpy (rf_header_save, usb.buffer, 41);
120+ gps_wait = TRUE;
121+ gps_only = FALSE;
120122 }
121123 }
122124
@@ -139,6 +141,7 @@ int voice_read_from_node()
139141 {
140142 int i;
141143 int ret;
144+ unsigned short int crc;
142145
143146 int read_len;
144147
@@ -147,12 +150,83 @@ int voice_read_from_node()
147150 ret = usb_control_msg(udev, 0xC0, GET_DATA, 0, 0, usb.buffer, read_len, 200);
148151 if (ret > 0)
149152 {
153+ //gettimeofday(&Node_InTime, NULL);
150154 for (i = 0 ; i < ret; i++)
151155 {
152156 node_voice_save[voice_pnt] = usb.buffer[i];
153157 voice_pnt++;
154158 if (voice_pnt == 24)
155159 {
160+ if (gps_only) return ret;
161+ if (gps_wait)
162+ {
163+ gps_wait = FALSE;
164+ if (!memcmp (&node_voice_save[12], NullVoice, 12))
165+ {
166+ gps_only = TRUE;
167+ return ret;
168+ }
169+ inet_send_buff[16] = 0x80;
170+ //memcpy (&inet_send_buff[17], usb.buffer, 41);
171+ memcpy (&inet_send_buff[17], rf_header_save, 41);
172+ memcpy (&inet_send_buff[20], area_call, 8);
173+ memcpy (&inet_send_buff[28], area_call, 8);
174+ if (memcmp (&inet_send_buff[36], "CQCQCQ ", 8)) gw_on = TRUE;
175+ if (send_sw && !rig_send_sw && !node_voice_send_sw)
176+ {
177+ memset (inet_frame_id, 0xff, 2);
178+ node_last_frame_sw = FALSE;
179+ node_voice_send_sw = TRUE;
180+ in_addr.sin_port = htons(dest_inet_port);
181+ in_addr.sin_addr.s_addr = inet_addr(dest_address);
182+ m_seq++;
183+ m_seq &= 0xffff;
184+ inet_send_buff[4] = (m_seq >> 8) & 0xff;
185+ inet_send_buff[5] = m_seq & 0xff;
186+ inet_send_buff[7] |= FWD | ZR;
187+ crc = crc_calc (&inet_send_buff[17], 39);
188+ inet_send_buff[56] = (crc >> 8) & 0xff;
189+ inet_send_buff[57] = crc & 0xff;
190+ ret = sendto (in_addr_sock, inet_send_buff, 58, MSG_DONTWAIT,
191+ (struct sockaddr *)&in_addr, sizeof(in_addr));
192+ m_seq++;
193+ m_seq &= 0xffff;
194+ inet_send_buff[4] = (m_seq >> 8) & 0xff;
195+ inet_send_buff[5] = m_seq & 0xff;
196+ sendto (in_addr_sock, inet_send_buff, 58, MSG_DONTWAIT,
197+ (struct sockaddr *)&in_addr, sizeof(in_addr));
198+ memset (short_msg, 0x20, 20);
199+ memcpy (used_call, &inet_send_buff[44], 8);
200+ memcpy (used_call2, &inet_send_buff[52], 4);
201+ short_msg_wrt ();
202+ if (gw_on)
203+ {
204+ memcpy (&inet_send_buff[20], zone_call, 8);
205+ inet_send_buff[27] = 'G';
206+ inet_send_buff[7] &= 0x33;
207+ inet_send_buff[7] |= GW;
208+ m_seq++;
209+ m_seq &= 0xffff;
210+ inet_send_buff[4] = (m_seq >> 8) & 0xff;
211+ inet_send_buff[5] = m_seq & 0xff;
212+ crc = crc_calc (&inet_send_buff[17], 39);
213+ inet_send_buff[56] = (crc >> 8) & 0xff;
214+ inet_send_buff[57] = crc & 0xff;
215+ sendto (in_addr_sock, inet_send_buff, 58, MSG_DONTWAIT,
216+ (struct sockaddr *)&in_addr, sizeof(in_addr));
217+ m_seq++;
218+ m_seq &= 0xffff;
219+ inet_send_buff[4] = (m_seq >> 8) & 0xff;
220+ inet_send_buff[5] = m_seq & 0xff;
221+ sendto (in_addr_sock, inet_send_buff, 58, MSG_DONTWAIT,
222+ (struct sockaddr *)&in_addr, sizeof(in_addr));
223+ if ((m_seq % 5) == 0) inet_led_onoff();
224+ }
225+ }
226+ m_seq++;
227+ m_seq &= 0xffff;
228+ seq = 0;
229+ }
156230 voice_pnt = 12;
157231 memcpy (&inet_send_buff[17], &node_voice_save[12], 12);
158232 memcpy (node_voice_save, &node_voice_save[12], 12);
@@ -171,7 +245,7 @@ int voice_read_from_node()
171245 seq++;
172246 if (seq > 20) seq = 0;
173247 memcpy (&inet_send_buff[17], node_voice_save, 12);
174- if (send_sw && !rig_send_sw && send_header_sw && no_cmd_sw)
248+ if (send_sw && !rig_send_sw && node_voice_send_sw)
175249 {
176250 in_addr.sin_port = htons(dest_inet_port);
177251 in_addr.sin_addr.s_addr = inet_addr(dest_address);
@@ -179,9 +253,6 @@ int voice_read_from_node()
179253 (struct sockaddr *)&in_addr, sizeof(in_addr));
180254 dstar_data (inet_send_buff, FALSE);
181255 }
182- else
183- dstar_alt_header (inet_send_buff, FALSE);
184-
185256 m_seq++;
186257 m_seq &= 0xffff;
187258 }
@@ -193,7 +264,7 @@ int voice_read_from_node()
193264 inet_send_buff[5] = m_seq & 0xff;
194265 inet_send_buff[16] = seq | 0x40;
195266 memcpy (&inet_send_buff[17], &node_voice_save[12], 12);
196- if (send_sw && !rig_send_sw && node_voice_send_sw && no_cmd_sw)
267+ if (send_sw && !rig_send_sw && node_voice_send_sw)
197268 {
198269 in_addr.sin_port = htons(dest_inet_port);
199270 in_addr.sin_addr.s_addr = inet_addr(dest_address);
@@ -203,10 +274,11 @@ int voice_read_from_node()
203274 memset (inet_frame_id, 0x00, 2);
204275 frameID = 0;
205276 HeaderLength = 0;
206- send_header_sw = FALSE;
207277 node_voice_send_sw = FALSE;
208278 digitalWrite (RIG_LED, 0);
209279 digitalWrite (INET_LED, 0);
280+ gps_wait = TRUE;
281+ gps_only = FALSE;
210282 }
211283 }
212284
--- a/main.c
+++ b/main.c
@@ -103,6 +103,9 @@ int main(int argc, char *argv[])
103103 send_header_sw = FALSE;
104104 unlink_sw = FALSE;
105105
106+ gps_wait = TRUE;
107+ gps_only = FALSE;
108+
106109 ntpdate ();
107110
108111 openlog ("dmonitor", LOG_CONS | LOG_PID, LOG_LOCAL0);
--- a/rig_read.c
+++ b/rig_read.c
@@ -431,6 +431,7 @@ int rig_read (void)
431431 if (!rig_status_check()) return FALSE;
432432 gw_on = FALSE;
433433 if (!inet_send_buff_set()) return TRUE;
434+ #if 0
434435 inet_send_buff[16] = 0x80;
435436 memcpy (&inet_send_buff[17], &rig_buff[2], 41);
436437 memcpy (&inet_send_buff[20], area_call, 8);
@@ -490,9 +491,84 @@ int rig_read (void)
490491 }
491492 m_seq++;
492493 m_seq &= 0xffff;
494+ #endif
495+ /* gps only stream check */
496+ memcpy (rf_header_save, rig_buff, 44);
497+ gps_wait = TRUE;
498+ gps_only = FALSE;
493499 }
494500 else if (len == 16) /* voice */
495501 {
502+ if (gps_only) break;
503+ if (gps_wait)
504+ {
505+ gps_wait = FALSE;
506+ if (!memcmp (&rig_buff[4], NullVoice, 12))
507+ {
508+ gps_only = TRUE;
509+ break;
510+ }
511+ inet_send_buff[16] = 0x80;
512+ //memcpy (&inet_send_buff[17], &rig_buff[2], 41);
513+ memcpy (&inet_send_buff[17], &rf_header_save[2], 41);
514+ memcpy (&inet_send_buff[20], area_call, 8);
515+ memcpy (&inet_send_buff[28], area_call, 8);
516+ if (memcmp (&inet_send_buff[36], "CQCQCQ ", 8)) gw_on = TRUE;
517+ if (send_sw && !rig_send_sw && no_cmd_sw)
518+ {
519+ send_header_sw = TRUE;
520+ memset (inet_frame_id, 0xff, 2);
521+ in_addr.sin_port = htons(dest_inet_port);
522+ in_addr.sin_addr.s_addr = inet_addr(dest_address);
523+ m_seq++;
524+ m_seq &= 0xffff;
525+ inet_send_buff[4] = (m_seq >> 8) & 0xff;
526+ inet_send_buff[5] = m_seq & 0xff;
527+ inet_send_buff[7] |= FWD | ZR;
528+ crc = crc_calc (&inet_send_buff[17], 39);
529+ inet_send_buff[56] = (crc >> 8) & 0xff;
530+ inet_send_buff[57] = crc & 0xff;
531+ ret = sendto (in_addr_sock, inet_send_buff, 58, MSG_DONTWAIT,
532+ (struct sockaddr *)&in_addr, sizeof(in_addr));
533+ m_seq++;
534+ m_seq &= 0xffff;
535+ inet_send_buff[4] = (m_seq >> 8) & 0xff;
536+ inet_send_buff[5] = m_seq & 0xff;
537+ //memcpy (&inet_send_buff[28], area_call, 8);
538+ //memcpy (&inet_send_buff[20], area_call, 8);
539+ sendto (in_addr_sock, inet_send_buff, 58, MSG_DONTWAIT,
540+ (struct sockaddr *)&in_addr, sizeof(in_addr));
541+ memset (short_msg, 0x20, 20);
542+ memcpy (used_call, &inet_send_buff[44], 8);
543+ memcpy (used_call2, &inet_send_buff[52], 4);
544+ short_msg_wrt();
545+ if (gw_on)
546+ {
547+ memcpy (&inet_send_buff[20], zone_call, 8);
548+ inet_send_buff[27] = 'G';
549+ inet_send_buff[7] &= 0x33;
550+ inet_send_buff[7] |= GW;
551+ m_seq++;
552+ m_seq &= 0xffff;
553+ inet_send_buff[4] = (m_seq >> 8) & 0xff;
554+ inet_send_buff[5] = m_seq & 0xff;
555+ crc = crc_calc (&inet_send_buff[17], 39);
556+ inet_send_buff[56] = (crc >> 8) & 0xff;
557+ inet_send_buff[57] = crc & 0xff;
558+ sendto (in_addr_sock, inet_send_buff, 58, MSG_DONTWAIT,
559+ (struct sockaddr *)&in_addr, sizeof(in_addr));
560+ m_seq++;
561+ m_seq &= 0xffff;
562+ inet_send_buff[4] = (m_seq >> 8) & 0xff;
563+ inet_send_buff[5] = m_seq & 0xff;
564+ sendto (in_addr_sock, inet_send_buff, 58, MSG_DONTWAIT,
565+ (struct sockaddr *)&in_addr, sizeof(in_addr));
566+ if ((m_seq % 5) == 0) inet_led_onoff();
567+ }
568+ }
569+ m_seq++;
570+ m_seq &= 0xffff;
571+ }
496572 inet_send_buff[9] = 0x13;
497573 inet_send_buff[4] = (m_seq >> 8) & 0xff;
498574 inet_send_buff[5] = m_seq & 0xff;
@@ -522,6 +598,8 @@ int rig_read (void)
522598 send_header_sw = FALSE;
523599 digitalWrite (RIG_LED, 0);
524600 digitalWrite (INET_LED, 0);
601+ gps_wait = TRUE;
602+ gps_only = FALSE;
525603 }
526604 m_seq++;
527605 m_seq &= 0xffff;