• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Révision4d209d5779c01ab532e0adee564085b32a27f9cc (tree)
l'heure2020-10-05 22:58:41
AuteurSatoshi Yasuda <7m3tjz@jarl...>
CommiterSatoshi Yasuda

Message de Log

modified: dmonitor.h
modified: main.c
modified: repeater_mon.c
modified: repeater_mon.h
modified: repeater_mon_light.c
modified: repeater_scan.c
modified: rpt_conn.c
modified: rpt_conn.h

Change Summary

Modification

--- a/dmonitor.h
+++ b/dmonitor.h
@@ -52,7 +52,7 @@
5252 #define BUFF_HOLD "/var/www/buff_hold.txt"
5353 #define DVAP_CONF "/var/www/dvap.conf"
5454 #define DVMEGA_CONF "/var/www/dvmega.conf"
55-#define NODE_CONF "/var/www/node.conf"
55+#define NODE_CONF "/var/www/node.conf"
5656 #define RIG_DEVICE "/dev/dstar"
5757 #define DMONITOR_FILE "/var/www/dmonitor.conf"
5858 #define IDxxPlus_SPEED B38400
--- a/main.c
+++ b/main.c
@@ -123,6 +123,7 @@ int main(int argc, char *argv[])
123123 if (!memcmp (recvBuff, "NONE", 4)) lcd_type = NODE;
124124 else if (!memcmp (recvBuff, "G20x4", 5)) lcd_type = LCD_20x4;
125125 else if (!memcmp (recvBuff, "G16x2", 5)) lcd_type = LCD_16x2;
126+
126127 }
127128 fclose (dmonitor_file);
128129 }
--- a/repeater_mon.c
+++ b/repeater_mon.c
@@ -294,7 +294,9 @@ void main(int argc, char** argv)
294294 addr.sin_addr.s_addr = *(unsigned int *)host->h_addr_list[0];
295295 }
296296
297- connect_fd = fopen (ConnectCALL, "r");
297+ connect_fd = fopen (DMONITOR_FILE, "r");
298+ fgets (ConnectCall, 10, connect_fd); // skip 2 lines
299+ fgets (ConnectCall, 10, connect_fd);
298300 fgets (ConnectCall, 10, connect_fd);
299301 fclose (connect_fd);
300302
--- a/repeater_mon.h
+++ b/repeater_mon.h
@@ -26,7 +26,7 @@
2626 #define SCAN_HTML_TEMP "/var/tmp/repeater_scan.temp"
2727 #define CONN_TEMP "/var/tmp/repeater_conn.tmp"
2828 #define CONN_TXT "/var/tmp/repeater_conn.txt"
29-#define ConnectCALL "/var/www/ConnectCall"
29+#define DMONITOR_FILE "/var/www/dmonitor.conf"
3030
3131 int sig_term;
3232
--- a/repeater_mon_light.c
+++ b/repeater_mon_light.c
@@ -129,7 +129,9 @@ void main(int argc, char** argv)
129129 addr.sin_addr.s_addr = *(unsigned int *)host->h_addr_list[0];
130130 }
131131
132- connect_fd = fopen (ConnectCALL, "r");
132+ connect_fd = fopen (DMONITOR_FILE, "r");
133+ fgets (ConnectCall, 10, connect_fd); // skip 2 lines
134+ fgets (ConnectCall, 10, connect_fd);
133135 fgets (ConnectCall, 10, connect_fd);
134136 fclose (connect_fd);
135137
--- a/repeater_scan.c
+++ b/repeater_scan.c
@@ -211,8 +211,10 @@ int main(int argc, char** argv)
211211 handler_init();
212212
213213 ret = daemon (0, 0);
214- call_fd = fopen (ConnectCALL, "r");
215- ret = fread (connect_call, 8, 1, call_fd);
214+ call_fd = fopen (DMONITOR_FILE, "r");
215+ fgets (tmp_call, sizeof(tmp_call), call_fd); // skip 2 lines
216+ fgets (tmp_call, sizeof(tmp_call), call_fd);
217+ fgets (connect_call, 8, call_fd);
216218 fclose (call_fd);
217219 while (1)
218220 {
--- a/rpt_conn.c
+++ b/rpt_conn.c
@@ -73,13 +73,11 @@ void main(void)
7373 if (!memcmp (recvBuff, "NONE", 4)) lcd_type = NODE;
7474 else if (!memcmp (recvBuff, "G20x4", 5)) lcd_type = LCD_20x4;
7575 else if (!memcmp (recvBuff, "G16x2", 5)) lcd_type = LCD_16x2;
76+ fgets (ConnectCall, sizeof (ConnectCall), dmonitor_file);
7677 }
7778 fclose (dmonitor_file);
7879 }
7980
80- connCall_fd = fopen (CONNECT_CALL, "r");
81- fgets (ConnectCall, sizeof(ConnectCall), connCall_fd);
82- fclose (connCall_fd);
8381 sig_term = FALSE;
8482 reboot_sw = FALSE;
8583 shutdown_sw = FALSE;
@@ -111,25 +109,30 @@ scan_loop:
111109 rig_reset();
112110 while (1)
113111 {
112+ time (&cur_time);
114113 if (lcd_type == LCD_20x4)
115114 {
116115 lcdPosition (lcd, 16, 0);
117116 }
118- if (lcd_type == LCD_16x2)
117+ else if (lcd_type == LCD_16x2)
119118 {
120- lcdPosition (lcd, 13, 0);
119+ lcdPosition (lcd, 12, 0);
121120 }
122121 if (lcd_type != NODE)
123122 {
124- if (scan_sw)
125- {
126- memcpy (temp, "scan", 4);
127- }
128- else
129- {
130- memcpy (temp, "rptc", 4);
123+ if (cur_time %2) memset (temp, 0x20, 4);
124+ else
125+ {
126+ if (scan_sw)
127+ {
128+ memcpy (temp, "scan", 4);
129+ }
130+ else
131+ {
132+ memcpy (temp, "rptc", 4);
133+ }
131134 }
132- temp[5] = 0x00;
135+ temp[4] = 0x00;
133136 lcdPuts (lcd, temp);
134137 }
135138 memcpy (&read_set, &fd_save, sizeof(fd_set));
@@ -190,39 +193,63 @@ skip:
190193 }
191194 if (!memcmp (connect_call, "STATUS", 6))
192195 {
196+ if (lcd_type == LCD_20x4) lcdPosition (lcd, 0, 3);
193197 memcpy (msg_temp, "RPT CONN RUNNING ", 20);
194198 memcpy (mycall2, "RPTC", 4);
195199 flag1 = 0x00;
196200 send_msg_sw = TRUE;
197201 memset (connect_call, 0x00, 8);
198202 scan_sw = FALSE;
203+ if (lcd_type == LCD_20x4)
204+ {
205+ msg_temp[20] = 0x00;
206+ lcdPuts (lcd, msg_temp);
207+ }
199208 }
200209 if (!memcmp (connect_call, "UNLINK", 6) || !memcmp (connect_call, "DISCON", 6))
201210 {
211+ if (lcd_type == LCD_20x4) lcdPosition (lcd, 0, 3);
202212 memcpy (msg_temp, "NOT UNLINK RPTC RUN", 20);
203213 memcpy (mycall2, "RPTC", 4);
204214 flag1 = 0x00;
205215 send_msg_sw = TRUE;
206216 memset (connect_call, 0x00, 8);
207217 scan_sw = FALSE;
218+ if (lcd_type == LCD_20x4)
219+ {
220+ msg_temp[20] = 0x00;
221+ lcdPuts (lcd, msg_temp);
222+ }
208223 }
209224 if (!memcmp (connect_call, "REBOOT", 6))
210225 {
226+ if (lcd_type == LCD_20x4) lcdPosition (lcd, 0, 3);
211227 memcpy (msg_temp, "RASPI REBOOT ", 20);
212228 memcpy (mycall2, "RPTC", 4);
213229 flag1 = 0x00;
214230 send_msg_sw = TRUE;
215231 memset (connect_call, 0x00, 8);
216232 reboot_sw = TRUE;
233+ if (lcd_type == LCD_20x4)
234+ {
235+ msg_temp[20] = 0x00;
236+ lcdPuts (lcd, msg_temp);
237+ }
217238 }
218239 if (!memcmp (connect_call, "SHUTDOWN", 6))
219240 {
241+ if (lcd_type == LCD_20x4) lcdPosition (lcd, 0, 3);
220242 memcpy (msg_temp, "RASPI SHUTDOWN ", 20);
221243 memcpy (mycall2, "RPTC", 4);
222244 flag1 = 0x00;
223245 send_msg_sw = TRUE;
224246 memset (connect_call, 0x00, 8);
225247 shutdown_sw = TRUE;
248+ if (lcd_type == LCD_20x4)
249+ {
250+ msg_temp[20] = 0x00;
251+ lcdPuts (lcd, msg_temp);
252+ }
226253 }
227254 if (!memcmp (connect_call, "SCAN", 4))
228255 {
--- a/rpt_conn.h
+++ b/rpt_conn.h
@@ -42,7 +42,7 @@
4242 #define DVMEGA_CONF "/var/www/dvmega.conf"
4343 #define NODE_CONF "/var/www/node.conf"
4444 #define RIG_DEVICE "/dev/dstar"
45-#define DMONITOR_FILE "/var/www/dmonitor.type"
45+#define DMONITOR_FILE "/var/www/dmonitor.conf"
4646 #define CONNECT_CALL "/var/www/ConnectCall"
4747 #define IDxxPlus_SPEED B38400
4848 #define DVAP_SPEED B230400
@@ -232,7 +232,6 @@ union
232232 } usb;
233233
234234 /* LCD */
235-/* LCD */
236235 #define NONE 0
237236 #define LCD_20x4 1
238237 #define LCD_16x2 2