• R/O
  • HTTP
  • SSH
  • HTTPS

dxchange: Commit


Commit MetaInfo

Revisionc6c094d1bfbc9edb4a83d5b7f73b7292fa440711 (tree)
Time2017-12-08 10:45:09
AuthorSatoshi Yasuda <7m3tjz@jk1z...>
CommiterSatoshi Yasuda

Log Message

modified: dxchange.h
modified: gps.c
modified: gps_a.c

Change Summary

Incremental Difference

--- a/dxchange.h
+++ b/dxchange.h
@@ -79,6 +79,7 @@ struct ModuleTable
7979 int HeaderCnt;
8080 int rpt_save_length;
8181 int lost_cnt;
82+ int qsy_sw;
8283 unsigned char RadioLat[8];
8384 unsigned char RadioLong[9];
8485 unsigned char RadioCall[8];
--- a/gps.c
+++ b/gps.c
@@ -488,7 +488,11 @@ void aprs_message (char string[], struct ModuleTable *id)
488488 }
489489 }
490490
491- if (id->RadioCall[k-1] == '-') id->RadioCall[k-1] = 0x00;
491+ if (id->RadioCall[k-1] == '-')
492+ {
493+ id->RadioCall[k-1] = 0x00;
494+ id->qsy_sw = TRUE;
495+ }
492496
493497 if (k < 7) id->RadioCall[k] = 0x00;
494498
@@ -518,6 +522,7 @@ void Dprs_Send(struct ModuleTable *id)
518522
519523 memset (temp, 0x00, 256);
520524 memset (call_id, 0x20, 10);
525+ id->qsy_sw = FALSE;
521526 for (i = 0 ; i < 8 ; i++)
522527 {
523528 if (id->RadioCall[i] == 0x00) break;
@@ -666,10 +671,13 @@ void Dprs_Send(struct ModuleTable *id)
666671 memcpy (&temp[posit], "000000", 6);
667672 posit += 6;
668673 // QSY info
669- memcpy (&temp[posit], "D-STAR>", 7);
670- posit += 7;
671- memcpy (&temp[posit], id->ModuleName, 8);
672- posit += 8;
674+ if (id->qsy_sw)
675+ {
676+ memcpy (&temp[posit], "D-STAR>", 7);
677+ posit += 7;
678+ memcpy (&temp[posit], id->ModuleName, 8);
679+ posit += 8;
680+ }
673681 if (msg_len > 0)
674682 {
675683 memcpy (&temp[posit], &GpsMsg[4], msg_len);
--- a/gps_a.c
+++ b/gps_a.c
@@ -54,6 +54,7 @@ void GPS_A_Send(char string[], struct ModuleTable *id)
5454 char string_temp[256];
5555 int err;
5656
57+ id->qsy_sw = TRUE;
5758 memset (CallSign, 0x20, 10);
5859 for (i = 0 ; i < 10 ; i++)
5960 {
@@ -67,6 +68,17 @@ void GPS_A_Send(char string[], struct ModuleTable *id)
6768 memcpy (id->aprs_msg_save, id->aprs_msg, 256);
6869 return;
6970 }
71+ for (i = 0 ; i < 10 ; i++)
72+ {
73+ if (string[i] == '-')
74+ {
75+ if (isalpha(string[i+1]))
76+ {
77+ id->qsy_sw = FALSE;
78+ break;
79+ }
80+ }
81+ }
7082
7183 len = strlen((char *)string);
7284 memset (string_temp, 0x00, 256);
@@ -120,12 +132,15 @@ void GPS_A_Send(char string[], struct ModuleTable *id)
120132 }
121133 n++;
122134 }
123- if (string[k] == '[') k++;
124- if (string[k] == '>') k += 8;
125- if (string[k] == '/') k += 9;
126- memcpy (&string_temp[k+15], &string[k], len - k);
127- memcpy (&string_temp[k], "D-STAR>", 7);
128- memcpy (&string_temp[k+7], id->ModuleName, 8);
135+ if (id->qsy_sw)
136+ {
137+ if (string[k] == '[') k++;
138+ if (string[k] == '>') k += 8;
139+ if (string[k] == '/') k += 9;
140+ memcpy (&string_temp[k+15], &string[k], len - k);
141+ memcpy (&string_temp[k], "D-STAR>", 7);
142+ memcpy (&string_temp[k+7], id->ModuleName, 8);
143+ }
129144 break;
130145 }
131146 }
Show on old repository browser