• 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

Revision3153d0ee6c0962b7726e5ec8c2faef68a0ec06e2 (tree)
Time2020-10-15 13:53:58
AuthorSatoshi Yasuda <7m3tjz@jarl...>
CommiterSatoshi Yasuda

Log Message

modified: debian/changelog
modified: dmonitor_utils.c
modified: dvap.c
modified: inet_read.c
modified: main.c
modified: send_node.c

Change Summary

Incremental Difference

--- a/debian/changelog
+++ b/debian/changelog
@@ -3,7 +3,7 @@ dmonitor (01.60) unstable; urgency=low
33 * update Closes: (#120)
44 * BUG fixed for node adapter routine
55
6- -- Satoshi Yasuda <7m3tjz@jarl.com> Sun, 11 Oct 2020 13:05:00 +0900
6+ -- Satoshi Yasuda <7m3tjz@jarl.com> Thu, 15 Oct 2020 13:40:00 +0900
77
88 dmonitor (01.59) unstable; urgency=low
99
--- a/dmonitor_utils.c
+++ b/dmonitor_utils.c
@@ -2,7 +2,7 @@
22 #include "init.h"
33
44 void rig_write (int length, char buff[]);
5-int getFifo (char pkt[]);
5+int getFifo (unsigned char pkt[]);
66 void LastFrameSend (void);
77 void rig_led_onoff(void);
88 void inet_led_onoff(void);
@@ -364,7 +364,8 @@ int send_rig (void)
364364 if (rig_type == NODE)
365365 {
366366 length = check_getFifo();
367- if (!node_space_check (length)) return TRUE;
367+ if (length = 42) if (!node_space_check (95)) return TRUE;
368+ if (!node_space_check (12)) return TRUE;
368369 }
369370
370371 length = getFifo (&send_buff[3]);
@@ -461,7 +462,7 @@ int check_getFifo (void)
461462 return tmp->length;
462463 }
463464
464-int getFifo (char pkt[])
465+int getFifo (unsigned char pkt[])
465466 {
466467 struct FifoPkt *tmp;
467468 int len;
@@ -486,7 +487,6 @@ int getFifo (char pkt[])
486487 void putFifo (int len, unsigned char pkt[])
487488 {
488489 struct FifoPkt *ret;
489-//syslog(LOG_DEBUG, "putFifo %d %2.2x %2.2x %2.2x", len, pkt[0], pkt[1], pkt[2]);
490490 #ifdef _DEBUG
491491 syslog (LOG_INFO, "putFifo len:%d %2.2x", len, pkt[0]);
492492 #endif
@@ -784,10 +784,11 @@ void jitter_putFifo (void)
784784 jitter_buff[jitter_wr_pnt][0] = 0xff;
785785 //jitter_rd_pnt++;
786786 //jitter_wr_pnt = jitter_rd_pnt;
787- if (jitter_rd_pnt > 20) jitter_rd_pnt = 0;
787+ //if (jitter_rd_pnt > 20) jitter_rd_pnt = 0;
788788 digitalWrite (INET_LED, 0);
789789 digitalWrite (RIG_LED, 0);
790790 rig_last_frame_send = TRUE;
791+ //memset (inet_frame_id, 0x00, 2);
791792 return;
792793 }
793794 while (jitter_buff[jitter_rd_pnt][0] != 0xff)
--- a/dvap.c
+++ b/dvap.c
@@ -744,7 +744,7 @@ void dvap_write (int fd, unsigned char buff[], int length)
744744 dvap_send_pkt[6] &= 0x07;
745745 ret = write (fd, dvap_send_pkt, 47);
746746 //dvap_send_pkt[4] = 0x00;
747- dvap_send_pkt[5]++;
747+ //dvap_send_pkt[5]++;
748748
749749 send_header_sw = TRUE;
750750 dvap_first_voice_pkt = TRUE;
@@ -761,9 +761,8 @@ syslog (LOG_DEBUG, "%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x
761761 }
762762 else if (length == 17)
763763 {
764- if (send_header_sw)
764+ //if (send_header_sw)
765765 {
766-
767766 if (!dvap_first_voice_pkt || !memcmp (&buff[13], resync , 3))
768767 {
769768 time(&dvap_keep_alive);
@@ -774,7 +773,7 @@ syslog (LOG_DEBUG, "%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x
774773 if ((dvap_send_pkt[4] & 0x40) ||
775774 (!memcmp (&dvap_send_pkt[6], &lastframe[3], 3) && !memcmp (&dvap_send_pkt[15], lastframe, 3)))
776775 {
777- dvap_send_pkt[5] |= 0x40;
776+ dvap_send_pkt[4] |= 0x40;
778777 send_header_sw = FALSE;
779778 }
780779 ret = write (fd, dvap_send_pkt, 18);
--- a/inet_read.c
+++ b/inet_read.c
@@ -12,6 +12,7 @@ void dstar_data (unsigned char string[], int inet);
1212 void dstar_alt_header (unsigned char string[], int inet);
1313 void short_msg_wrt (void);
1414 void jitter_buff_init (void);
15+int getFifo(char pkt[]);
1516
1617 char dummy_frame_1[12] = {
1718 0x73, 0x44, 0x1a, 0x72, 0x31, 0x3c, 0xa7, 0x53, 0x02, 0x55, 0x55, 0x55};
@@ -70,7 +71,7 @@ void inet_read (void)
7071 int length;
7172 int k;
7273 long int t_sub;
73- char buff[28];
74+ char buff[42];
7475 struct hostent *host;
7576 struct timeval time_sub;
7677 int rate;
@@ -143,7 +144,6 @@ void inet_read (void)
143144 }
144145
145146 if (memcmp (recvBuff, "DSTR", 4)) return;
146-
147147 #ifdef _DEBUG_INET
148148 syslog (LOG_DEBUG, "inet read %d", length);
149149 #endif
@@ -180,6 +180,8 @@ void inet_read (void)
180180 if (((recvBuff[7] & ZR) && !memcmp (area_call, &recvBuff[28], 8)) || scan_sw
181181 || ((recvBuff[7] & GW) && !memcmp (area_call, &recvBuff[20], 8)))
182182 {
183+ while (getFifo(buff)) ;
184+ jitter_buff_init();
183185 memcpy (inet_frame_id, &recvBuff[14], 2);
184186 memcpy (inet_frame_id_save, &recvBuff[14], 2);
185187 send_buff[0] = 0x29;
@@ -403,6 +405,7 @@ void inet_read (void)
403405 rig_last_frame_send = TRUE;
404406 drop_rate_print();
405407 rig_send_check();
408+ send_header_sw = FALSE;
406409 }
407410 }
408411 }
--- a/main.c
+++ b/main.c
@@ -155,7 +155,7 @@ int main(int argc, char *argv[])
155155 if (length <= 0 ) return -1;
156156 pg_path[length] = 0x00;
157157 if (ETagGen (pg_path, MD5_dmonitor) < 0) return 5;
158- memcpy (MD5_dmonitor, "5ebe211107266a57b1af14a7fdcd8480", 32);
158+ //memcpy (MD5_dmonitor, "5ebe211107266a57b1af14a7fdcd8480", 32);
159159
160160 Rp = malloc (sizeof (struct FifoPkt) - 1024);
161161 Wp = Rp;
@@ -279,7 +279,6 @@ int main(int argc, char *argv[])
279279 connected_table_clean();
280280 error_msg_clean();
281281
282- //rig_buff_pnt = 0;
283282 rig_last_frame_send = TRUE;
284283
285284 jitter_buff_init();
@@ -357,8 +356,7 @@ top:
357356 }
358357 if (FD_ISSET (rig_fd, &read_set))
359358 {
360- if (rig_type == ICOM) rig_read();
361- else if (rig_type == DVAP) dvap_read();
359+ if (rig_type == DVAP) dvap_read();
362360 else if (rig_type == DVMEGA) dvmega_read();
363361 }
364362 }
@@ -400,39 +398,24 @@ top:
400398 }
401399 if(rig_send_sw)
402400 {
403- if (rig_type == NODE)
401+ gettimeofday (&c_time, NULL);
402+ timeradd (&rig_send_time, &rig_send_time_20mSec, &temp_time);
403+ if (timercmp (&c_time, &temp_time, >))
404404 {
405- if (node_space_check (15))
405+ if (send_rig())
406406 {
407- if (!send_rig())
408- {
409- syslog (LOG_INFO, "Empty of the jitter buffer");
410- LastFrameSend();
411- }
407+ rig_send_time.tv_sec = temp_time.tv_sec;
408+ rig_send_time.tv_usec = temp_time.tv_usec;
412409 }
413- }
414- else
415- {
416- gettimeofday (&c_time, NULL);
417- timeradd (&rig_send_time, &rig_send_time_20mSec, &temp_time);
418- if (timercmp (&c_time, &temp_time, >))
410+ else
419411 {
420- if (send_rig())
421- {
422- rig_send_time.tv_sec = temp_time.tv_sec;
423- rig_send_time.tv_usec = temp_time.tv_usec;
424- }
425- else
426- {
427- syslog (LOG_INFO, "Empty of the jitter buffer");
428- LastFrameSend();
429- }
412+ syslog (LOG_INFO, "Empty of the jitter buffer");
413+ LastFrameSend();
430414 }
431415 }
432416 }
433417 if ((inet_frame_id[0] != 0xff) || (inet_frame_id[1] != 0xff))
434418 {
435-//syslog (LOG_DEBUG, "%2.2x %2.2x", inet_frame_id[0], inet_frame_id[1]);
436419 if ((inet_frame_id[0] != 0x00) || (inet_frame_id[1] != 0x00))
437420 {
438421 gettimeofday (&c_time, NULL);
@@ -441,10 +424,10 @@ top:
441424 {
442425 syslog (LOG_INFO, "insert dummy_last_frame");
443426 dummy_last_frame();
444- //#ifdef _SPECIFICATION_CHECK
427+ #ifdef _SPECIFICATION_CHECK
445428 timersub (&c_time, &inet_recv_time, &temp_time);
446429 syslog (LOG_INFO, "long interval %ld.%03ld Sec.", temp_time.tv_sec, temp_time.tv_usec/1000);
447- //#endif
430+ #endif
448431 gettimeofday (&inet_recv_time, NULL);
449432 }
450433 }
--- a/send_node.c
+++ b/send_node.c
@@ -27,14 +27,6 @@ void node_header_send (unsigned char header[])
2727 header[1] = 0x00;
2828 header[2] = 0x00;
2929 usb_control_msg(udev, 0x40, SET_FLAGS, 0, 0, header, 3, 100);
30-#if 0
31- usb_control_msg(udev, 0xc0, GET_REMAINSPACE, 0, 0, (char *)&len ,1, 100);
32- while (len < 95)
33- {
34- usleep (2000);
35- usb_control_msg(udev, 0xc0, GET_REMAINSPACE, 0, 0, (char *)&len ,1, 100);
36- }
37-#endif
3830 usb_control_msg(udev, 0x40, SET_PTT, ON, 0, NULL, 0, 100);
3931 }
4032
@@ -47,22 +39,7 @@ void node_voice_send (unsigned char voice[])
4739 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",
4840 voice[0], voice[1], voice[2], voice[3], voice[4], voice[5], voice[6], voice[7], voice[8], voice[9], voice[10], voice[11]);
4941 #endif
50-#if 0
51- usb_control_msg(udev, 0xc0, GET_REMAINSPACE, 0, 0, (char *)&len ,1, 100);
52- while (len < 12)
53- {
54- usleep (2000);
55- usb_control_msg(udev, 0xc0, GET_REMAINSPACE, 0, 0, (char *)&len ,1, 100);
56- }
57-#endif
5842 ret = usb_control_msg(udev, 0x40, PUT_DATA, 0, 0, voice, 12, 100);
59-#if 0
60- while (ret < 0)
61- {
62- usleep (200);
63- ret = usb_control_msg(udev, 0x40, PUT_DATA, 0, 0, voice, 12, 100);
64- }
65-#endif
6643 }
6744
6845 void node_last_send (unsigned char voice[])
@@ -71,22 +48,7 @@ void node_last_send (unsigned char voice[])
7148 unsigned char len;
7249
7350 memcpy (&voice[9], lastframe, 6);
74-#if 0
75- usb_control_msg(udev, 0xc0, GET_REMAINSPACE, 0, 0, (char *)&len ,1, 100);
76- while (len < 15)
77- {
78- usleep (2000);
79- usb_control_msg(udev, 0xc0, GET_REMAINSPACE, 0, 0, (char *)&len ,1, 100);
80- }
81-#endif
8251 ret = usb_control_msg(udev, 0x40, PUT_DATA, 0, 0, voice, 15, 100);
83-#if 0
84- while (ret < 0)
85- {
86- usleep (200);
87- ret = usb_control_msg(udev, 0x40, PUT_DATA, 0, 0, voice, 15, 100);
88- }
89-#endif
9052 /* PTT OFF */
9153 ret = usb_control_msg(udev, 0x40, SET_PTT, OFF, 0, NULL, 0, 100);
9254 frameID = 0;