• 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

Revisionf737eff28eeba5c73d0c0698281fe8107285d37c (tree)
Zeit2022-07-28 15:42:02
AutorSatoshi Yasuda <7m3tjz;jarl.com>
CommiterSatoshi Yasuda

Log Message

modified: dstatus.h
modified: dstatus_utils.c
modified: extern_dstatus.h
modified: read_config.c
modified: repeater.c
modified: status_send.c
modified: trust_read.c

Ändern Zusammenfassung

Diff

--- a/config.h
+++ b/config.h
@@ -84,7 +84,7 @@
8484 #define PACKAGE_NAME "rpi-dstatus"
8585
8686 /* Define to the full name and version of this package. */
87-#define PACKAGE_STRING "rpi-dstatus 00.06"
87+#define PACKAGE_STRING "rpi-dstatus 00.07"
8888
8989 /* Define to the one symbol short name of this package. */
9090 #define PACKAGE_TARNAME "rpi-dstatus"
@@ -93,13 +93,13 @@
9393 #define PACKAGE_URL ""
9494
9595 /* Define to the version of this package. */
96-#define PACKAGE_VERSION "00.06"
96+#define PACKAGE_VERSION "00.07"
9797
9898 /* Define to 1 if you have the ANSI C header files. */
9999 #define STDC_HEADERS 1
100100
101101 /* Version number of package */
102-#define VERSION "00.06"
102+#define VERSION "00.07"
103103
104104 /* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
105105 <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
--- a/dstatus.h
+++ b/dstatus.h
@@ -42,6 +42,11 @@
4242 #define R_PTTOFF "16"
4343 #define R_UPDATE "17"
4444
45+#define GW_ON 0x80
46+#define ZR_ON 0x40
47+#define FWD_ON 0x04
48+#define XCHANGE 0xi08
49+
4550 #include <stdint.h>
4651 #include <string.h>
4752 #include <ctype.h>
@@ -79,6 +84,12 @@ struct ModuleTable
7984 int HeaderCnt;
8085 int rpt_save_length;
8186 int lost_cnt;
87+ long int gw_dv_in_cnt;
88+ long int gw_dv_out_cnt;
89+ long int zr_dv_in_cnt;
90+ long int zr_dv_out_cnt;
91+ long int fwd_dv_in_cnt;
92+ long int fwd_dv_out_cnt;
8293 unsigned char RadioLat[8];
8394 unsigned char RadioLong[9];
8495 unsigned char RadioCall[8];
@@ -142,7 +153,7 @@ fd_set read_set;
142153 fd_set fd_save;
143154
144155
145-struct ModuleTable *module_pnt, *module_last;
156+struct ModuleTable *module_pnt;
146157
147158 unsigned char dtmf_c, dtmf_c_save;
148159 unsigned char dtmf_c_save1, dtmf_c_save2;
--- a/dstatus_utils.c
+++ b/dstatus_utils.c
@@ -63,7 +63,7 @@ void module_pass_check (void)
6363 }
6464 }
6565
66-struct ModuleTable *module_check (char call[], char flag)
66+struct ModuleTable *module_check (char call[])
6767 {
6868
6969 struct ModuleTable *pnt;
@@ -73,21 +73,21 @@ struct ModuleTable *module_check (char call[], char flag)
7373
7474 while (pnt)
7575 {
76- if (!memcmp (call, pnt->ModuleName, 8) && (flag == pnt->rs_flag)) return pnt;
76+ if (!memcmp (call, pnt->ModuleName, 8)) return pnt;
7777 pnt = pnt->f_chain;
7878 }
7979 return NULL;
8080 }
8181
8282
83-struct ModuleTable *module_check_ex (char FrameID[], char flag)
83+struct ModuleTable *module_check_ex (char FrameID[])
8484 {
8585 struct ModuleTable *pnt;
8686
8787 pnt = module_pnt;
8888 while (pnt)
8989 {
90- if (!memcmp (FrameID, pnt->FrameID, 2) && (flag == pnt->rs_flag)) return pnt;
90+ if (!memcmp (FrameID, pnt->FrameID, 2)) return pnt;
9191 pnt = pnt->f_chain;
9292 }
9393 return NULL;
--- a/extern_dstatus.h
+++ b/extern_dstatus.h
@@ -36,6 +36,11 @@
3636 #define R_PTTOFF "16"
3737 #define R_UPDATE "17"
3838
39+#define GW_ON 0x80
40+#define ZR_ON 0x40
41+#define FWD_ON 0x04
42+#define XCHANGE 0x08
43+
3944 #include <stdint.h>
4045 #include <string.h>
4146 #include <ctype.h>
@@ -73,6 +78,12 @@ struct ModuleTable
7378 int HeaderCnt;
7479 int rpt_save_length;
7580 int lost_cnt;
81+ long int gw_dv_in_cnt;
82+ long int gw_dv_out_cnt;
83+ long int zr_dv_in_cnt;
84+ long int zr_dv_out_cnt;
85+ long int fwd_dv_in_cnt;
86+ long int fwd_dv_out_cnt;
7687 unsigned char RadioLat[8];
7788 unsigned char RadioLong[9];
7889 unsigned char RadioCall[8];
@@ -136,7 +147,7 @@ extern fd_set read_set;
136147 extern fd_set fd_save;
137148
138149
139-extern struct ModuleTable *module_pnt, *module_last;
150+extern struct ModuleTable *module_pnt;
140151
141152 extern unsigned char dtmf_c, dtmf_c_save;
142153 extern unsigned char dtmf_c_save1, dtmf_c_save2;
--- a/read_config.c
+++ b/read_config.c
@@ -111,23 +111,3 @@ int read_config(int argc, char **argv)
111111
112112 }
113113
114-void module_init(struct ModuleTable *module, char Module[], char flag)
115-{
116- module->AccessTime = 0;
117- memcpy (module->ModuleName, Module, 8);
118- memset (module->mycall, 0x20, 8);
119- memset (module->mycall_ex, 0x20, 4);
120- memset (module->rptcall, 0x20, 8);
121- module->aprs_msg_pnt = 0;
122- module->packet_cnt = 0;
123- module->HeaderCnt = 0;
124- module->RadioVoicePacketCnt = 0;
125- module->f_chain = NULL;
126- module->SendSeq = 0;
127- module->rpt_save_length = 0;
128- module->recv_time.tv_sec = 0;
129- module->recv_time.tv_usec = 0;
130- module->lost_cnt = 0;
131- module->rs_flag = flag;
132-}
133-
--- a/repeater.c
+++ b/repeater.c
@@ -65,7 +65,7 @@ int repeater_mon(void)
6565 length = recvfrom(rpt_mon_sd, &mon_buff, sizeof(mon_buff), 0, (struct sockaddr *)&in_sock, &len_in_sock);
6666 if (length < 0) {
6767 time(&atime);
68- fprintf (log_file, "%24.24s Repeater data Reciv. error\n", ctime(&atime));
68+ fprintf (log_file, "%24.24s Repeater data Reciv. (forward port) error\n", ctime(&atime));
6969 return FALSE; // end
7070 }
7171 if (!memcmp(mon_buff.d_packet.id, "DSTR", 4) && (mon_buff.d_packet.sr == 's'))
@@ -92,6 +92,9 @@ int repeater_mon(void)
9292 time_21ms.tv_usec = 21000;
9393 timeradd (&cur_time, &time_21ms, &m_pnt->recv_time);
9494 m_pnt->lost_cnt = 0;
95+ if (mon_buff.mon_buffer[7] & GW_ON) m_pnt->gw_dv_in_cnt++;
96+ else if (mon_buff.mon_buffer[7] & ZR_ON) m_pnt->zr_dv_in_cnt++;
97+ else if (mon_buff.mon_buffer[7] & FWD_ON) m_pnt->fwd_dv_in_cnt++;
9598 }
9699 }
97100 else if (length == 29) // voice packet ICOM
@@ -107,6 +110,9 @@ int repeater_mon(void)
107110 time_21ms.tv_usec = 21000;
108111 timeradd (&cur_time, &time_21ms, &m_pnt->recv_time);
109112 m_pnt->lost_cnt = 0;
113+ if (mon_buff.mon_buffer[7] & GW_ON) m_pnt->gw_dv_in_cnt++;
114+ else if (mon_buff.mon_buffer[7] & ZR_ON) m_pnt->zr_dv_in_cnt++;
115+ else if (mon_buff.mon_buffer[7] & FWD_ON) m_pnt->fwd_dv_in_cnt++;
110116 }
111117 }
112118 else if (length == 32) // Last Frame ICOM
--- a/status_send.c
+++ b/status_send.c
@@ -128,7 +128,7 @@ void status_send_ptton(struct ModuleTable *pnt)
128128
129129 memcpy (&pnt->STATUS_Frm.StatusID, "DSTRST", 6);
130130 memcpy (&pnt->STATUS_Frm.Type, "05", 2);
131- if (pnt->rs_flag == 'R') memcpy (&pnt->STATUS_Frm.Type, "15", 2);
131+ //if (pnt->rs_flag == 'R') memcpy (&pnt->STATUS_Frm.Type, "15", 2);
132132 memcpy (&pnt->STATUS_Frm.body.status.RPT2Call, &pnt->rpt_save.body.header.rpt2, 36);
133133 memset (&pnt->STATUS_Frm.ip_addr, 0x00, 16);
134134 #if __WORDSIZE == 64
@@ -176,7 +176,7 @@ void status_send_pttoff (struct ModuleTable *pnt)
176176
177177 memcpy (&pnt->STATUS_Frm.StatusID, "DSTRST", 6);
178178 memcpy (&pnt->STATUS_Frm.Type, "06", 2);
179- if (pnt->rs_flag == 'R') memcpy (&pnt->STATUS_Frm.Type, "16", 2);
179+ //if (pnt->rs_flag == 'R') memcpy (&pnt->STATUS_Frm.Type, "16", 2);
180180 memset (&pnt->STATUS_Frm.ip_addr, 0x00, 16);
181181 #if __WORDSIZE == 64
182182 time (&pnt->STATUS_Frm.EntryUpdateTime);
@@ -225,7 +225,7 @@ void status_send_update (struct ModuleTable *pnt)
225225 memcpy (&pnt->STATUS_Frm_Save, &pnt->STATUS_Frm.body, 64);
226226 memcpy (&pnt->STATUS_Frm.StatusID, "DSTRST", 6);
227227 memcpy (&pnt->STATUS_Frm.Type, "07", 2);
228- if (pnt->rs_flag == 'R') memcpy (&pnt->STATUS_Frm.Type, "17", 2);
228+ //if (pnt->rs_flag == 'R') memcpy (&pnt->STATUS_Frm.Type, "17", 2);
229229 memset (&pnt->STATUS_Frm.ip_addr, 0x00, 16);
230230 #if __WORDSIZE == 64
231231 time (&pnt->STATUS_Frm.EntryUpdateTime);
--- a/trust_read.c
+++ b/trust_read.c
@@ -14,7 +14,6 @@ void trust_read(void)
1414 len = recv (trust_sd, buff, 64, 0);
1515 if (len == 40)
1616 {
17- buff[3] &= 0x0f;
1817 if (!memcmp (buff, ack, 5))
1918 {
2019 if (buff[15] == 0x20) buff[15] = 'A';
@@ -57,3 +56,29 @@ void trust_read(void)
5756 }
5857 }
5958
59+void module_init(struct ModuleTable *module, char Module[], char flag)
60+{
61+ module->AccessTime = 0;
62+ memcpy (module->ModuleName, Module, 8);
63+ memset (module->mycall, 0x20, 8);
64+ memset (module->mycall_ex, 0x20, 4);
65+ memset (module->rptcall, 0x20, 8);
66+ module->aprs_msg_pnt = 0;
67+ module->packet_cnt = 0;
68+ module->HeaderCnt = 0;
69+ module->RadioVoicePacketCnt = 0;
70+ module->f_chain = NULL;
71+ module->SendSeq = 0;
72+ module->rpt_save_length = 0;
73+ module->recv_time.tv_sec = 0;
74+ module->recv_time.tv_usec = 0;
75+ module->lost_cnt = 0;
76+ module->rs_flag = flag;
77+ module->gw_dv_in_cnt = 0;
78+ module->gw_dv_out_cnt = 0;
79+ module->zr_dv_in_cnt = 0;
80+ module->zr_dv_out_cnt = 0;
81+ module->fwd_dv_in_cnt = 0;
82+ module->fwd_dv_out_cnt = 0;
83+}
84+