• 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

Revisiond52f5d843f98a4fb120f697e2a305d126674a747 (tree)
Time2020-10-15 01:37:43
AuthorSatoshi Yasuda <7m3tjz@jarl...>
CommiterSatoshi Yasuda

Log Message

modified: dmonitor_utils.c
modified: dvap.c
modified: inet_read.c
modified: main.c
modified: send_msg.c

Change Summary

Incremental Difference

--- a/dmonitor_utils.c
+++ b/dmonitor_utils.c
@@ -394,9 +394,9 @@ int send_rig (void)
394394 rig_write (17, send_buff);
395395 if (send_buff[3] & 0x40)
396396 {
397- //#ifdef _DEBUG
397+ #ifdef _DEBUG
398398 syslog (LOG_INFO, "Fifo_cnt (last frame) %d", Fifo_cnt);
399- //#endif
399+ #endif
400400 if (Fifo_cnt < fifo_hold)
401401 {
402402 rig_send_sw = FALSE;
@@ -720,7 +720,6 @@ void dmonitor_close (void)
720720 (struct sockaddr *)&in_addr, sizeof(in_addr));
721721 }
722722
723-#if 0
724723 void jitter_buff_init(void)
725724 {
726725 int n;
@@ -739,8 +738,6 @@ void jitter_buff_init(void)
739738
740739 void jitter_put (unsigned char buff[])
741740 {
742-
743-//syslog (LOG_DEBUG, "jitter put %2.2x %2.2x", buff[0], buff[1]);
744741 //if (rig_last_frame_send) return;
745742 jitter_wr_pnt = buff[0] & 0x1f;
746743 if (jitter_wr_pnt > 20) return;
@@ -762,16 +759,14 @@ void jitter_putFifo (void)
762759 int k, n;
763760 int jitter_n;
764761
765-//syslog (LOG_DEBUG, "debug 100 %2.2x %2.2x", jitter_wr_pnt, jitter_rd_pnt);
762+ if (jitter_buff[jitter_wr_pnt][0] == 0xff) return;
766763 if ((jitter_buff[jitter_wr_pnt][0] != 0xff) && (jitter_buff[jitter_wr_pnt][0] & 0x40))
767764 {
768765 #ifdef _DEBUG_JITTER
769766 syslog(LOG_DEBUG, "last freame in jitter");
770767 #endif
771-syslog (LOG_DEBUG, "200 %2.2x %2.2x", jitter_wr_pnt, jitter_rd_pnt);
772768 while (jitter_wr_pnt != jitter_rd_pnt)
773769 {
774-syslog (LOG_DEBUG, "210 %2.2x %2.2x", jitter_wr_pnt, jitter_rd_pnt);
775770 if (jitter_buff[jitter_rd_pnt][0] == 0xff)
776771 {
777772 jitter_buff[jitter_rd_pnt][0] = jitter_rd_pnt;
@@ -787,17 +782,16 @@ syslog (LOG_DEBUG, "210 %2.2x %2.2x", jitter_wr_pnt, jitter_rd_pnt);
787782 }
788783 putFifo (13, &jitter_buff[jitter_wr_pnt][0]);
789784 jitter_buff[jitter_wr_pnt][0] = 0xff;
790- jitter_rd_pnt++;
791- jitter_wr_pnt = jitter_rd_pnt;
785+ //jitter_rd_pnt++;
786+ //jitter_wr_pnt = jitter_rd_pnt;
792787 if (jitter_rd_pnt > 20) jitter_rd_pnt = 0;
793788 digitalWrite (INET_LED, 0);
794789 digitalWrite (RIG_LED, 0);
795790 rig_last_frame_send = TRUE;
796791 return;
797792 }
798- while ((jitter_buff[jitter_rd_pnt][0] != 0xff) && !(jitter_buff[jitter_rd_pnt][0] & 0x40))
793+ while (jitter_buff[jitter_rd_pnt][0] != 0xff)
799794 {
800-syslog (LOG_DEBUG, "jitter putFifo %d", jitter_rd_pnt);
801795 putFifo (13, &jitter_buff[jitter_rd_pnt][0]);
802796 jitter_buff[jitter_rd_pnt][0] = 0xff;
803797 if (jitter_rd_pnt == 0) memcpy (&jitter_buff[jitter_rd_pnt][1], NullVoice, 12);
@@ -806,7 +800,6 @@ syslog (LOG_DEBUG, "jitter putFifo %d", jitter_rd_pnt);
806800 jitter_rd_pnt++;
807801 if (jitter_rd_pnt > 20) jitter_rd_pnt = 0;
808802 jitter_wr_cnt--;
809- if (jitter_wr_cnt < 0) jitter_wr_cnt = 0;
810803 }
811804 #ifdef _DEBUG_JITTER
812805 syslog (LOG_INFO, "debug %d %d", jitter_wr_pnt, jitter_rd_pnt);
@@ -820,7 +813,6 @@ syslog (LOG_DEBUG, "jitter putFifo %d", jitter_rd_pnt);
820813 if (((jitter_wr_pnt + 1) != jitter_rd_pnt) && ((jitter_wr_pnt + 1) != (jitter_rd_pnt + 21)))
821814 {
822815 k = jitter_wr_pnt;
823-syslog (LOG_DEBUG, "debug 100 %d", jitter_rd_pnt);
824816 while (k != jitter_rd_pnt)
825817 {
826818 if (jitter_buff[k][0] != 0xff)
@@ -832,7 +824,6 @@ syslog (LOG_DEBUG, "debug 100 %d", jitter_rd_pnt);
832824 k--;
833825 if (k < 0) k = 20;
834826 }
835-syslog (LOG_DEBUG, "debug 110 %d", jitter_rd_pnt);
836827 #ifdef _DEBUG_JITTER
837828 syslog (LOG_INFO, "n:%d\n", n);
838829 #endif
@@ -844,7 +835,6 @@ syslog (LOG_DEBUG, "debug 110 %d", jitter_rd_pnt);
844835 {
845836 if (jitter_buff[jitter_n][0] == 0xff) inet_read_drop_cnt++;
846837 jitter_buff[jitter_n][0] = jitter_n;
847-syslog (LOG_DEBUG, "test %d %d", jitter_n, jitter_wr_pnt);
848838 putFifo (13, &jitter_buff[jitter_n][0]);
849839 jitter_buff[jitter_n][0] = 0xff;
850840 if (jitter_n == 0) memcpy (&jitter_buff[jitter_n][1], NullVoice, 12);
@@ -854,9 +844,7 @@ syslog (LOG_DEBUG, "test %d %d", jitter_n, jitter_wr_pnt);
854844 }
855845 //jitter_wr_cnt = 0;
856846 }
857-syslog (LOG_DEBUG, "debug 120 %d", jitter_rd_pnt);
858847 }
859-#endif
860848
861849 void drop_rate_print (void)
862850 {
@@ -943,118 +931,3 @@ int ja_check (unsigned char callsign[])
943931 return FALSE;
944932 }
945933
946-void jitter_buff_init(void)
947-{
948- int n;
949-
950- jitter_rd_pnt = 0;
951- jitter_wr_cnt = 0;
952-
953- for (n = 0 ; n < 21 ; n++)
954- {
955- jitter_buff[n][0] = 0xff;
956- if (n == 0) memcpy (&jitter_buff[n][1], NullVoice, 12);
957- else memcpy (&jitter_buff[n][1], NullVoice1, 12);
958- }
959-}
960-
961-void jitter_put (unsigned char buff[])
962-{
963- jitter_wr_pnt = buff[0] & 0x1f;
964- if (jitter_wr_pnt > 20) return;
965- if (jitter_wr_pnt)
966- memcpy (&jitter_buff[jitter_wr_pnt][0], buff, 13);
967- else
968- memcpy (&jitter_buff[jitter_wr_pnt][0], buff, 10);
969- jitter_wr_cnt++;
970- if (jitter_wr_cnt < 0) jitter_wr_cnt = 0;
971- #ifdef _DEBUG_JITTER
972- syslog (LOG_INFO, "jitter put %d %d", jitter_wr_pnt, jitter_wr_cnt);
973- #endif
974- jitter_putFifo();
975-}
976-
977-void jitter_putFifo (void)
978-{
979- int k, n;
980-
981- if ((jitter_buff[jitter_wr_pnt][0] != 0xff) && (jitter_buff[jitter_wr_pnt][0] & 0x40))
982- {
983- #ifdef _DEBUG_JITTER
984- syslog(LOG_DEBUG, "last freame in jitter");
985- #endif
986- while (jitter_wr_pnt != jitter_rd_pnt)
987- {
988- if (jitter_buff[jitter_rd_pnt][0] == 0xff)
989- {
990- jitter_buff[jitter_rd_pnt][0] = jitter_rd_pnt;
991- inet_read_drop_cnt++;
992- syslog (LOG_INFO, "packet loss (drop) %2.2x", jitter_rd_pnt);
993- }
994- putFifo (13, &jitter_buff[jitter_rd_pnt][0]);
995- jitter_buff[jitter_rd_pnt][0] = 0xff;
996- if (jitter_rd_pnt == 0) memcpy (&jitter_buff[jitter_rd_pnt][1], NullVoice, 12);
997- else memcpy (&jitter_buff[jitter_rd_pnt][1], NullVoice1, 12);
998- jitter_rd_pnt++;
999- if (jitter_rd_pnt > 20) jitter_rd_pnt = 0;
1000- }
1001- putFifo (13, &jitter_buff[jitter_wr_pnt][0]);
1002- jitter_buff[jitter_wr_pnt][0] = 0xff;
1003- jitter_rd_pnt = 0;
1004- digitalWrite (INET_LED, 0);
1005- digitalWrite (RIG_LED, 0);
1006- return;
1007- }
1008- while (jitter_buff[jitter_rd_pnt][0] != 0xff)
1009- {
1010- putFifo (13, &jitter_buff[jitter_rd_pnt][0]);
1011- jitter_buff[jitter_rd_pnt][0] = 0xff;
1012- if (jitter_rd_pnt == 0) memcpy (&jitter_buff[jitter_rd_pnt][1], NullVoice, 12);
1013- else memcpy (&jitter_buff[jitter_rd_pnt][1], NullVoice1, 12);
1014- jitter_rd_pnt++;
1015- if (jitter_rd_pnt > 20) jitter_rd_pnt = 0;
1016- jitter_wr_cnt--;
1017- }
1018- #ifdef _DEBUG_JITTER
1019- syslog (LOG_INFO, "debug %d %d", jitter_wr_pnt, jitter_rd_pnt);
1020- syslog (LOG_INFO, "%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 %2.2x %2.2x %2.2x",
1021- jitter_buff[0][0], jitter_buff[1][0],jitter_buff[2][0],jitter_buff[3][0],jitter_buff[4][0],
1022- jitter_buff[5][0],jitter_buff[6][0],jitter_buff[7][0],jitter_buff[8][0],jitter_buff[8][0],jitter_buff[10][0],
1023- jitter_buff[11][0], jitter_buff[12][0],jitter_buff[13][0],jitter_buff[14][0],jitter_buff[15][0],
1024- jitter_buff[16][0],jitter_buff[17][0],jitter_buff[18][0],jitter_buff[19][0],jitter_buff[20][0]);
1025- #endif
1026- n = 0;
1027- if (((jitter_wr_pnt + 1) != jitter_rd_pnt) && ((jitter_wr_pnt + 1) != (jitter_rd_pnt + 21)))
1028- {
1029- k = jitter_wr_pnt;
1030- while (k != jitter_rd_pnt)
1031- {
1032- if (jitter_buff[k][0] != 0xff)
1033- {
1034- n++;
1035- }
1036- else
1037- break;
1038- k--;
1039- if (k < 0) k = 20;
1040- }
1041- #ifdef _DEBUG_JITTER
1042- syslog (LOG_INFO, "n:%d\n", n);
1043- #endif
1044- }
1045- if (n > 4)
1046- {
1047- while (jitter_rd_pnt != jitter_wr_pnt)
1048- {
1049- if (jitter_buff[jitter_rd_pnt][0] == 0xff) inet_read_drop_cnt++;
1050- jitter_buff[jitter_rd_pnt][0] = jitter_rd_pnt;
1051- putFifo (13, &jitter_buff[jitter_rd_pnt][0]);
1052- jitter_buff[jitter_rd_pnt][0] = 0xff;
1053- if (jitter_rd_pnt == 0) memcpy (&jitter_buff[jitter_rd_pnt][1], NullVoice, 12);
1054- else memcpy (&jitter_buff[jitter_rd_pnt][1], NullVoice1, 12);
1055- jitter_rd_pnt++;
1056- if (jitter_rd_pnt > 20) jitter_rd_pnt = 0;
1057- }
1058- jitter_wr_cnt = 0;
1059- }
1060-}
--- a/dvap.c
+++ b/dvap.c
@@ -744,19 +744,19 @@ 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;
751751 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]);
752-//#ifdef _DEBUG_DVAP_SEND
752+#ifdef _DEBUG_DVAP_SEND
753753 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",
754754 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]);
755755 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",
756756 dvap_send_pkt[16],dvap_send_pkt[17],dvap_send_pkt[18],dvap_send_pkt[19], dvap_send_pkt[20],dvap_send_pkt[21],dvap_send_pkt[22], dvap_send_pkt[23],dvap_send_pkt[24],dvap_send_pkt[25], dvap_send_pkt[26],dvap_send_pkt[27],dvap_send_pkt[28], dvap_send_pkt[29],dvap_send_pkt[30],dvap_send_pkt[31]);
757757 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",
758758 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]);
759-//#endif
759+#endif
760760 }
761761 }
762762 else if (length == 17)
@@ -769,22 +769,23 @@ syslog (LOG_DEBUG, "%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x
769769 time(&dvap_keep_alive);
770770 dvap_send_pkt[0] = 0x12;
771771 dvap_send_pkt[1] = 0xc0;
772- memcpy (&dvap_send_pkt[5], &buff[3], 13);
773- if ((dvap_send_pkt[5] & 0x40) ||
772+ dvap_send_pkt[4] = buff[3];
773+ memcpy (&dvap_send_pkt[6], &buff[4], 12);
774+ if ((dvap_send_pkt[4] & 0x40) ||
774775 (!memcmp (&dvap_send_pkt[6], &lastframe[3], 3) && !memcmp (&dvap_send_pkt[15], lastframe, 3)))
775776 {
776777 dvap_send_pkt[5] |= 0x40;
777778 send_header_sw = FALSE;
778779 }
779780 ret = write (fd, dvap_send_pkt, 18);
780- //dvap_send_pkt[5]++;
781- dvap_send_pkt[4]++;
781+ dvap_send_pkt[5]++;
782+ //dvap_send_pkt[4]++;
782783 //if (dvap_send_pkt[4] == 21) dvap_send_pkt[4] = 0;
783784 dvap_first_voice_pkt = FALSE;
784-//#ifdef _DEBUG_DVAP_SEND
785+#ifdef _DEBUG_DVAP_SEND
785786 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",
786787 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]);
787-//#endif
788+#endif
788789 }
789790 }
790791 }
--- a/inet_read.c
+++ b/inet_read.c
@@ -223,7 +223,6 @@ void inet_read (void)
223223 {
224224 if (send_header_sw && !memcmp (&inet_frame_id, &recvBuff[14], 2) && (inet_frame_id[0] != 0x00) && (inet_frame_id[1] != 0x00))
225225 {
226-//syslog (LOG_DEBUG, "pkt seq:%2.2x %2.2x", recvBuff[16], recvBuff[17]);
227226 #ifdef _SPECIFICATIO_CHECK
228227 if (!memcmp (&recvBuff[14], voice_packet_save, 15))
229228 syslog (LOG_INFO, "Dup. packet (maybe loop) from %2.2x %2.2x %2.2x",
--- a/main.c
+++ b/main.c
@@ -362,7 +362,7 @@ top:
362362 else if (rig_type == DVMEGA) dvmega_read();
363363 }
364364 }
365- if (Fifo_cnt) jitter_putFifo();
365+ jitter_putFifo();
366366 rig ();
367367 if ((cur_time - hole_punch_send_time) >= hole_punch_send_interval)
368368 {
@@ -398,7 +398,6 @@ top:
398398 send_keep_alive();
399399 }
400400 }
401-syslog (LOG_DEBUG, "Fifo_cnt %d", Fifo_cnt);
402401 if(rig_send_sw)
403402 {
404403 if (rig_type == NODE)
--- a/send_msg.c
+++ b/send_msg.c
@@ -37,7 +37,6 @@ void send_msg (unsigned char string[], unsigned char my2[])
3737 int n;
3838 time_t ctime;
3939
40-syslog (LOG_DEBUG, "msg_send");
4140 time (&ctime);
4241 if ((ctime - msg_send_set_time) >= 2)
4342 {