• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythonwindowsphpgamebathyscapheguic翻訳omegattwitterframeworkbtronvb.net計画中(planning stage)testdomarduinodirectxpreviewerゲームエンジン

Commit MetaInfo

Revisiond2a85b165e49f363db2caac0f939ca474febe4eb (tree)
Time2020-10-17 06:41:44
AuthorSASANO Takayoshi <uaa@uaa....>
CommiterSASANO Takayoshi

Log Message

Merge remote-tracking branch 'upstream/master'

git says about confilict of config.h and configure,
these files are no longer used so no problem without merging.

Change Summary

Incremental Difference

--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,16 @@
1+dmonitor (01.61) unstable; urgency=low
2+
3+ * update Closes: (#121)
4+ * BUG fixed for dvap header routine (dvap_weire)
5+
6+ -- Satoshi Yasuda <7m3tjz@jarl.com> Fri, 16 Oct 2020 20:00:00 +0900
7+
18 dmonitor (01.60) unstable; urgency=low
29
310 * update Closes: (#120)
411 * BUG fixed for node adapter routine
512
6- -- Satoshi Yasuda <7m3tjz@jarl.com> Thu, 15 Oct 2020 13:40:00 +0900
13+ -- Satoshi Yasuda <7m3tjz@jarl.com> Thu, 15 Oct 2020 14:30:00 +0900
714
815 dmonitor (01.59) unstable; urgency=low
916
--- a/dmonitor.h
+++ b/dmonitor.h
@@ -33,6 +33,7 @@
3333
3434 //#define _DEBUG_DVMEGA
3535 //#define _SPECIFICATIO_CHECK
36+//#define _DEBUG_DVAP_SEND
3637
3738 #define GW 0x80
3839 #define ZR 0x40
--- a/dmonitor_utils.c
+++ b/dmonitor_utils.c
@@ -15,6 +15,7 @@ void node_close (void);
1515 void lcd_write(void);
1616 int node_space_check (int length);
1717 int check_getFifo(void);
18+
1819 extern char dummy_frame_1[12];
1920 extern char dummy_frame_2[12];
2021 extern char dummy_frame_3[12];
@@ -404,6 +405,10 @@ int send_rig (void)
404405 fifo_hold_limit = fifo_hold + 10;
405406 }
406407 else fifo_hold_limit = Fifo_cnt + 10;
408+ rig_last_frame_send = TRUE;
409+ send_header_sw = FALSE;
410+ memset (inet_frame_id, 0x00, 2);
411+ frameID = 0;
407412 }
408413 }
409414 return TRUE;
--- a/dvap.c
+++ b/dvap.c
@@ -14,6 +14,7 @@ void short_msg_wrt (void);
1414 void send_msg (unsigned char str[], unsigned char my2[]);
1515 int cmd_check (unsigned char cmd[]);
1616 int rig_status_check(void);
17+unsigned short int crc_calc (unsigned char string[], int length);
1718
1819 struct termios save_attr;
1920 char dvap_buff[1024];
@@ -588,6 +589,7 @@ void dvap_send_header (void)
588589 {
589590 int ret;
590591 char temp[21];
592+ unsigned short int crc;
591593
592594 if (dvap_header[25] == 0x20) return;
593595 if (!cmd_check (&dvap_header[25])) return;
@@ -620,6 +622,9 @@ void dvap_send_header (void)
620622 inet_send_buff[4] = (m_seq >> 8) & 0xff;
621623 inet_send_buff[5] = m_seq & 0xff;
622624 inet_send_buff[7] |= FWD | ZR;
625+ crc = crc_calc (&inet_send_buff[17], 39);
626+ inet_send_buff[56] = (crc >> 8) & 0xff;
627+ inet_send_buff[57] = crc & 0xff;
623628 ret = sendto (in_addr_sock, inet_send_buff, 58, MSG_DONTWAIT,
624629 (struct sockaddr *)&in_addr, sizeof(in_addr));
625630 m_seq++;
@@ -628,6 +633,9 @@ void dvap_send_header (void)
628633 inet_send_buff[5] = m_seq & 0xff;
629634 memcpy (&inet_send_buff[28], area_call, 8);
630635 memcpy (&inet_send_buff[20], area_call, 8);
636+ crc = crc_calc (&inet_send_buff[17], 39);
637+ inet_send_buff[56] = (crc >> 8) & 0xff;
638+ inet_send_buff[57] = crc & 0xff;
631639 sendto (in_addr_sock, inet_send_buff, 58, MSG_DONTWAIT,
632640 (struct sockaddr *)&in_addr, sizeof(in_addr));
633641 memset (short_msg, 0x20, 20);
@@ -645,6 +653,9 @@ void dvap_send_header (void)
645653 m_seq &= 0xffff;
646654 inet_send_buff[4] = (m_seq >> 8) & 0xff;
647655 inet_send_buff[5] = m_seq & 0xff;
656+ crc = crc_calc (&inet_send_buff[17], 39);
657+ inet_send_buff[56] = (crc >> 8) & 0xff;
658+ inet_send_buff[57] = crc & 0xff;
648659 sendto (in_addr_sock, inet_send_buff, 58, MSG_DONTWAIT,
649660 (struct sockaddr *)&in_addr, sizeof(in_addr));
650661 m_seq++;
@@ -727,28 +738,29 @@ unsigned char dvap_send_pkt[47];
727738 void dvap_write (int fd, unsigned char buff[], int length)
728739 {
729740 unsigned short int tmp;
741+ unsigned short int crc;
730742 int ret;
731-
732743 if (length == 42)
733744 {
734- if (!send_header_sw)
735- {
736- time(&dvap_keep_alive);
737- dvap_send_pkt[0] = 0x2f;
738- dvap_send_pkt[1] = 0xa0;
739- tmp = rand() & 0xffff;
740- memcpy (&dvap_send_pkt[2], &tmp, 2);
741- dvap_send_pkt[4] = 0x80;
742- dvap_send_pkt[5] = 0x00;
743- memcpy (&dvap_send_pkt[6], &buff[2], 41);
744- dvap_send_pkt[6] &= 0x07;
745- ret = write (fd, dvap_send_pkt, 47);
746- //dvap_send_pkt[4] = 0x00;
747- //dvap_send_pkt[5]++;
745+ time(&dvap_keep_alive);
746+ dvap_send_pkt[0] = 0x2f;
747+ dvap_send_pkt[1] = 0xa0;
748+ //tmp = rand() & 0xffff;
749+ //memcpy (&dvap_send_pkt[2], &tmp, 2);
750+ memcpy (&dvap_send_pkt[2], inet_frame_id, 2);
751+ dvap_send_pkt[4] = 0x80;
752+ dvap_send_pkt[5] = 0x00;
753+ memcpy (&dvap_send_pkt[6], &buff[2], 41);
754+ dvap_send_pkt[6] &= 0x07;
755+ crc = crc_calc (&dvap_send_pkt[6], 39);
756+ dvap_send_pkt[45] = (crc >> 8) & 0xff;
757+ dvap_send_pkt[46] = crc & 0xff;
758+ ret = write (fd, dvap_send_pkt, 47);
759+ //dvap_send_pkt[4] = 0x00;
760+ //dvap_send_pkt[5]++;
748761
749- send_header_sw = TRUE;
750- dvap_first_voice_pkt = TRUE;
751- syslog (LOG_DEBUG, "to DVAP rpt2:%8.8s rpt1:%8.8s ur:%8.8s my:%8.8s my2:%4.4s", &buff[5], &buff[13],&buff[21], &buff[29], &buff[37]);
762+ dvap_first_voice_pkt = TRUE;
763+ syslog (LOG_DEBUG, "to DVAP rpt2:%8.8s rpt1:%8.8s ur:%8.8s my:%8.8s my2:%4.4s", &buff[5], &buff[13],&buff[21], &buff[29], &buff[37]);
752764 #ifdef _DEBUG_DVAP_SEND
753765 syslog (LOG_DEBUG, "%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x",
754766 dvap_send_pkt[0],dvap_send_pkt[1],dvap_send_pkt[2],dvap_send_pkt[3], dvap_send_pkt[4],dvap_send_pkt[5],dvap_send_pkt[6], dvap_send_pkt[7],dvap_send_pkt[8],dvap_send_pkt[9], dvap_send_pkt[10],dvap_send_pkt[11],dvap_send_pkt[12], dvap_send_pkt[13],dvap_send_pkt[14],dvap_send_pkt[15]);
@@ -757,35 +769,31 @@ syslog (LOG_DEBUG, "%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x
757769 syslog (LOG_DEBUG, "%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x",
758770 dvap_send_pkt[32],dvap_send_pkt[33],dvap_send_pkt[34],dvap_send_pkt[35], dvap_send_pkt[36],dvap_send_pkt[37],dvap_send_pkt[38], dvap_send_pkt[39],dvap_send_pkt[40],dvap_send_pkt[41], dvap_send_pkt[42],dvap_send_pkt[43],dvap_send_pkt[44], dvap_send_pkt[45],dvap_send_pkt[46],dvap_send_pkt[47]);
759771 #endif
760- }
761772 }
762773 else if (length == 17)
763774 {
764- //if (send_header_sw)
765- {
766- if (!dvap_first_voice_pkt || !memcmp (&buff[13], resync , 3))
767- {
768- time(&dvap_keep_alive);
769- dvap_send_pkt[0] = 0x12;
770- dvap_send_pkt[1] = 0xc0;
771- dvap_send_pkt[4] = buff[3];
772- memcpy (&dvap_send_pkt[6], &buff[4], 12);
773- if ((dvap_send_pkt[4] & 0x40) ||
774- (!memcmp (&dvap_send_pkt[6], &lastframe[3], 3) && !memcmp (&dvap_send_pkt[15], lastframe, 3)))
775- {
776- dvap_send_pkt[4] |= 0x40;
777- send_header_sw = FALSE;
778- }
779- ret = write (fd, dvap_send_pkt, 18);
780- dvap_send_pkt[5]++;
781- //dvap_send_pkt[4]++;
782- //if (dvap_send_pkt[4] == 21) dvap_send_pkt[4] = 0;
783- dvap_first_voice_pkt = FALSE;
775+ if (!dvap_first_voice_pkt || !memcmp (&buff[13], resync , 3))
776+ {
777+ time(&dvap_keep_alive);
778+ dvap_send_pkt[0] = 0x12;
779+ dvap_send_pkt[1] = 0xc0;
780+ dvap_send_pkt[4] = buff[3];
781+ memcpy (&dvap_send_pkt[6], &buff[4], 12);
782+ if ((dvap_send_pkt[4] & 0x40) ||
783+ (!memcmp (&dvap_send_pkt[6], &lastframe[3], 3) && !memcmp (&dvap_send_pkt[15], lastframe, 3)))
784+ {
785+ dvap_send_pkt[4] |= 0x40;
786+ send_header_sw = FALSE;
787+ }
788+ ret = write (fd, dvap_send_pkt, 18);
789+ dvap_send_pkt[5]++;
790+ //dvap_send_pkt[4]++;
791+ //if (dvap_send_pkt[4] == 21) dvap_send_pkt[4] = 0;
792+ dvap_first_voice_pkt = FALSE;
784793 #ifdef _DEBUG_DVAP_SEND
785794 syslog (LOG_DEBUG, "%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x",
786795 dvap_send_pkt[0], dvap_send_pkt[1], dvap_send_pkt[2], dvap_send_pkt[3], dvap_send_pkt[4], dvap_send_pkt[5], dvap_send_pkt[6], dvap_send_pkt[7], dvap_send_pkt[8], dvap_send_pkt[9], dvap_send_pkt[10], dvap_send_pkt[11], dvap_send_pkt[12], dvap_send_pkt[13], dvap_send_pkt[14], dvap_send_pkt[15], dvap_send_pkt[16], dvap_send_pkt[17]);
787796 #endif
788- }
789797 }
790798 }
791799 else
--- a/dvmega_utils.c
+++ b/dvmega_utils.c
@@ -159,6 +159,9 @@ void dvmega_read (void)
159159 inet_send_buff[4] = (m_seq >> 8) & 0xff;
160160 inet_send_buff[5] = m_seq & 0xff;
161161 inet_send_buff[7] |= FWD | ZR;
162+ crc = crc_calc (&inet_send_buff[17], 39);
163+ inet_send_buff[56] = (crc >> 8) & 0xff;
164+ inet_send_buff[57] = crc & 0xff;
162165 ret = sendto (in_addr_sock, inet_send_buff, 58, MSG_DONTWAIT,
163166 (struct sockaddr *)&in_addr, sizeof(in_addr));
164167 m_seq++;
@@ -181,6 +184,9 @@ void dvmega_read (void)
181184 m_seq &= 0xffff;
182185 inet_send_buff[4] = (m_seq >> 8) & 0xff;
183186 inet_send_buff[5] = m_seq & 0xff;
187+ crc = crc_calc (&inet_send_buff[17], 39);
188+ inet_send_buff[56] = (crc >> 8) & 0xff;
189+ inet_send_buff[57] = crc & 0xff;
184190 sendto (in_addr_sock, inet_send_buff, 58, MSG_DONTWAIT,
185191 (struct sockaddr *)&in_addr, sizeof(in_addr));
186192 m_seq++;
--- a/inet_read.c
+++ b/inet_read.c
@@ -177,6 +177,8 @@ void inet_read (void)
177177 {
178178 if ((inet_frame_id[0] == 0x00) && (inet_frame_id[1] == 0x00))
179179 {
180+if (recvBuff[7] & GW) syslog (LOG_DEBUG, "GW area:%8.8s rpt2:%8.8s rpt1:%8.8s", area_call, &recvBuff[20], &recvBuff[28]);
181+if (recvBuff[7] & ZR) syslog (LOG_DEBUG, "ZR area:%8.8s rpt2:%8.8s rpt1:%8.8s", area_call, &recvBuff[20], &recvBuff[28]);
180182 if (((recvBuff[7] & ZR) && !memcmp (area_call, &recvBuff[28], 8)) || scan_sw
181183 || ((recvBuff[7] & GW) && !memcmp (area_call, &recvBuff[20], 8)))
182184 {
@@ -208,16 +210,16 @@ void inet_read (void)
208210 short_msg_wrt();
209211 beep_sw = OFF;
210212 send_header_sw = TRUE;
211- }
212- if (!scan_sw)
213- {
214- if (recvBuff[7] & GW) syslog (LOG_NOTICE, "%8.8s from GW", &recvBuff[44]);
215- else if (recvBuff[7] & ZR) syslog (LOG_NOTICE, "%8.8s from ZR", &recvBuff[44]);
216- }
217- else
218- {
219- if (recvBuff[7] & GW) fprintf (status_fd, "%8.8s from GW\n", &recvBuff[44]);
220- else if (recvBuff[7] & ZR) fprintf (status_fd, "%8.8s from ZR\n", &recvBuff[44]);
213+ if (!scan_sw)
214+ {
215+ if (recvBuff[7] & GW) syslog (LOG_NOTICE, "%8.8s from GW", &recvBuff[44]);
216+ else if (recvBuff[7] & ZR) syslog (LOG_NOTICE, "%8.8s from ZR", &recvBuff[44]);
217+ }
218+ else
219+ {
220+ if (recvBuff[7] & GW) fprintf (status_fd, "%8.8s from GW\n", &recvBuff[44]);
221+ else if (recvBuff[7] & ZR) fprintf (status_fd, "%8.8s from ZR\n", &recvBuff[44]);
222+ }
221223 }
222224 }
223225 }
--- a/main.c
+++ b/main.c
@@ -72,6 +72,7 @@ int main(int argc, char *argv[])
7272
7373 FILE *pid_file;
7474 FILE *dmonitor_file;
75+ FILE *model;
7576
7677 ret = nice (-15);
7778 send_sw = FALSE;
@@ -225,9 +226,24 @@ int main(int argc, char *argv[])
225226 sizeof(HOLE_PUNCHD_SERVER));
226227 hole_punch_port = HOLE_PUNCHD_PORT;
227228
228- if (!scan_sw) syslog (LOG_INFO, "Connected to %8.8s (%s:%d) from %8.8s",
229+ model = fopen ("/proc/device-tree/model", "r");
230+ if (model)
231+ {
232+ fgets (pg_path, sizeof(pg_path), model);
233+ fclose (model);
234+ }
235+
236+ if (!scan_sw)
237+ {
238+ syslog (LOG_INFO, "Connected to %8.8s (%s:%d) from %8.8s",
229239 area_call, dest_address, dest_inet_port, connect_call);
230- else fprintf (status_fd, "Connected to %8.8s from %8.8s\n", area_call, connect_call);
240+ syslog (LOG_INFO, "Model : %s", pg_path);
241+ }
242+ else
243+ {
244+ fprintf (status_fd, "Connected to %8.8s from %8.8s\n", area_call, connect_call);
245+ fprintf (status_fd, "Model : %s\n", pg_path);
246+ }
231247 memset (inet_frame_id, 0x00, 2);
232248 frameID = 0;
233249 gettimeofday (&inet_time, NULL);
--- a/rig_read.c
+++ b/rig_read.c
@@ -29,6 +29,7 @@ void rig_not_connect_msg (void);
2929 int dvmega_init (void);
3030 int dvmega_init_recv (void);
3131 int cmd_check (unsigned char cmd[]);
32+unsigned short int crc_calc (char str[], int length);
3233
3334 char init_pkt[] = {0xff, 0xff, 0xff};
3435 char alive[] = {0x02, 0x02, 0xff};
@@ -335,6 +336,7 @@ int rig_read (void)
335336 struct timeval cu_time;
336337 struct timeval t_time;
337338 struct timeval ack_timeout;
339+ unsigned short int crc;
338340
339341 if (FD_ISSET (rig_fd, &read_set))
340342 {
@@ -440,6 +442,9 @@ int rig_read (void)
440442 inet_send_buff[4] = (m_seq >> 8) & 0xff;
441443 inet_send_buff[5] = m_seq & 0xff;
442444 inet_send_buff[7] |= FWD | ZR;
445+ crc = crc_calc (&inet_send_buff[17], 39);
446+ inet_send_buff[56] = (crc >> 8) & 0xff;
447+ inet_send_buff[57] = crc & 0xff;
443448 ret = sendto (in_addr_sock, inet_send_buff, 58, MSG_DONTWAIT,
444449 (struct sockaddr *)&in_addr, sizeof(in_addr));
445450 m_seq++;
@@ -464,6 +469,9 @@ int rig_read (void)
464469 m_seq &= 0xffff;
465470 inet_send_buff[4] = (m_seq >> 8) & 0xff;
466471 inet_send_buff[5] = m_seq & 0xff;
472+ crc = crc_calc (&inet_send_buff[17], 39);
473+ inet_send_buff[56] = (crc >> 8) & 0xff;
474+ inet_send_buff[57] = crc & 0xff;
467475 sendto (in_addr_sock, inet_send_buff, 58, MSG_DONTWAIT,
468476 (struct sockaddr *)&in_addr, sizeof(in_addr));
469477 m_seq++;