• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

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

Commit MetaInfo

Revision5b09efd1c1a9757b110a84bea4c82ca71d71a469 (tree)
Zeit2020-10-08 07:27:36
AutorSatoshi Yasuda <7m3tjz@jarl...>
CommiterSatoshi Yasuda

Log Message

modified: debian/install
modified: debian/rules
modified: dmonitor.h
modified: dmonitor_cmd.c
modified: dmonitor_utils.c
modified: main.c
modified: node_utils.c
modified: rpt_conn.c
modified: rpt_conn.h
modified: rpt_conn_rig.c

Ändern Zusammenfassung

Diff

--- a/debian/install
+++ b/debian/install
@@ -21,8 +21,6 @@ Update /var/www/cgi-bin
2121 Shutdown /var/www/cgi-bin
2222 Reboot /var/www/cgi-bin
2323 update_log /var/www/cgi-bin
24-CallStore /var/www/cgi-bin
25-RegistCall /var/www/cgi-bin
2624 redirect /var/www/cgi-bin
2725 simple_redirect /var/www/cgi-bin
2826 init_cmd /var/www/cgi-bin
--- a/debian/rules
+++ b/debian/rules
@@ -54,8 +54,6 @@ override_dh_prep:
5454 cp /var/www/cgi-bin/Shutdown debian/tmp/
5555 cp /var/www/cgi-bin/Reboot debian/tmp/
5656 cp /var/www/cgi-bin/update_log debian/tmp/
57- cp /var/www/cgi-bin/CallStore debian/tmp/
58- cp /var/www/cgi-bin/RegistCall debian/tmp/
5957 cp /var/www/cgi-bin/redirect debian/tmp/
6058 cp /var/www/cgi-bin/simple_redirect debian/tmp/
6159 cp /var/www/cgi-bin/init_cmd debian/tmp/
--- a/dmonitor.h
+++ b/dmonitor.h
@@ -289,3 +289,4 @@ int scan_stop_sw;
289289
290290 int lcd_type;
291291 int lcd;
292+time_t lcd_time_save;
--- a/dmonitor_cmd.c
+++ b/dmonitor_cmd.c
@@ -1,6 +1,19 @@
11 #include "dmonitor.h"
22
33
4+void lcd_write (void)
5+{
6+ if (lcd_type == LCD_20x4)
7+ {
8+ lcdPosition (lcd, 0, 3);
9+ msg_temp [20] = 0x00;
10+ lcdPuts (lcd, msg_temp);
11+ }
12+ else if (lcd_type == LCD_16x2)
13+ {
14+ }
15+}
16+
417 int cmd_check (unsigned char cmd[])
518 {
619
@@ -9,73 +22,48 @@ int cmd_check (unsigned char cmd[])
922 {
1023 fprintf (status_fd, "%8.8s from Rig\n", cmd);
1124 }
12- if (lcd_type == LCD_20x4) lcdPosition (lcd, 0, 3);
1325 if (!memcmp (cmd, "DISCON", 6) || !memcmp (cmd, "UNLINK", 6))
1426 {
1527 sprintf (msg_temp, "UNLINK FROM %8.8s", area_call);
1628 memcpy (mycall2, "UNLK", 4);
1729 send_msg_sw = TRUE;
1830 sig_term = TRUE;
19- if (lcd_type == LCD_20x4)
20- {
21- msg_temp[20] = 0x00;
22- lcdPuts (lcd, msg_temp);
23- }
31+ lcd_write();
2432 return FALSE;
2533 }
2634 if (!memcmp (cmd, "STATUS", 6))
2735 {
28- if (lcd_type == LCD_20x4) lcdPosition (lcd, 0, 3);
2936 sprintf (msg_temp, "LINKED TO %8.8s ", area_call);
3037 memcpy (mycall2, "DMON", 4);
3138 send_msg_sw = TRUE;
32- if (lcd_type == LCD_20x4)
33- {
34- msg_temp[20] = 0x00;
35- lcdPuts (lcd, msg_temp);
36- }
39+ lcd_write ();
3740 return FALSE;
3841 }
3942 if (!memcmp (cmd, "SCAN", 4))
4043 {
41- if (lcd_type == LCD_20x4) lcdPosition (lcd, 0, 3);
4244 memcpy (msg_temp, "EXIT FROM SCAN ", 20);
4345 memcpy (mycall2, "DMON", 4);
4446 send_msg_sw = TRUE;
4547 scan_stop_sw = TRUE;
46- if (lcd_type == LCD_20x4)
47- {
48- msg_temp[20] = 0x00;
49- lcdPuts (lcd, msg_temp);
50- }
48+ lcd_write();
5149 return FALSE;
5250 }
5351 if (!memcmp (cmd, "REBOOT", 6))
5452 {
55- if (lcd_type == LCD_20x4) lcdPosition (lcd, 0, 3);
5653 memcpy (msg_temp, "RASPI REBOOT ", 20);
5754 memcpy (mycall2, "DMON", 4);
5855 send_msg_sw = ON;
5956 reboot_sw = ON;
60- if (lcd_type == LCD_20x4)
61- {
62- msg_temp[20] = 0x00;
63- lcdPuts (lcd, msg_temp);
64- }
57+ lcd_write ();
6558 return FALSE;
6659 }
6760 if (!memcmp (cmd, "SHUTDOWN", 8))
6861 {
69- if (lcd_type == LCD_20x4) lcdPosition (lcd, 0, 3);
7062 memcpy (msg_temp, "RASPI SHUTDOWN ", 20);
7163 memcpy (mycall2, "DMON", 4);
7264 send_msg_sw = ON;
7365 shutdown_sw = ON;
74- if (lcd_type == LCD_20x4)
75- {
76- msg_temp[20] = 0x00;
77- lcdPuts (lcd, msg_temp);
78- }
66+ lcd_write();
7967 return FALSE;
8068 }
8169 if (!memcmp (cmd, "CQCQCQ", 6))
--- a/dmonitor_utils.c
+++ b/dmonitor_utils.c
@@ -12,6 +12,7 @@ void jitter_putFifo (void);
1212 int send_dest_keep_alive(void);
1313 int node_usb_init (void);
1414 void node_close (void);
15+void lcd_write(void);
1516
1617 extern char dummy_frame_1[12];
1718 extern char dummy_frame_2[12];
@@ -593,29 +594,19 @@ void error_msg (char str[])
593594
594595 if (!memcmp (&str[44], "未登録", 9))
595596 {
596- if (lcd_type == LCD_20x4) lcdPosition (lcd, 0, 3);
597597 sprintf (msg_temp, "NOT REGIST %8.8s ", &str[31]);
598598 memcpy (mycall2, "NORG", 4);
599599 send_msg_sw = TRUE;
600600 sig_term = TRUE;
601601 not_clear_error_msg = TRUE;
602- if (lcd_type == LCD_20x4)
603- {
604- msg_temp[20] = 0x00;
605- lcdPuts (lcd, msg_temp);
606- }
602+ lcd_write();
607603 }
608604 if (!memcmp (&str[44], "登録済", 9))
609605 {
610- if (lcd_type == LCD_20x4) lcdPosition (lcd, 0,3);
611606 sprintf (msg_temp, "LINK TO %8.8s ", area_call);
612607 memcpy (mycall2, "LINK", 4);
613608 send_msg_sw = TRUE;
614- if (lcd_type == LCD_20x4)
615- {
616- msg_temp[20] = 0x00;
617- lcdPuts (lcd, msg_temp);
618- }
609+ lcd_write ();
619610 }
620611 }
621612
--- a/main.c
+++ b/main.c
@@ -87,6 +87,7 @@ int main(int argc, char *argv[])
8787 send_msg_sw = FALSE;
8888 beep_sw = OFF;
8989 scan_stop_sw = FALSE;
90+ lcd_time_save = 0;
9091
9192 openlog ("dmonitor", LOG_CONS | LOG_PID, LOG_LOCAL0);
9293
@@ -247,24 +248,24 @@ int main(int argc, char *argv[])
247248 pinMode(INET_LED, OUTPUT);
248249 digitalWrite (RIG_LED, 0);
249250 digitalWrite (INET_LED, 0);
250- lcd_init();
251251 inet_led_sw = 0;
252252 rig_led_sw = 0;
253253 if (lcd_type != NONE)
254254 {
255+ lcd_init();
255256 lcdPosition (lcd, 0, 0);
256257 if (lcd_type == LCD_20x4)
257258 {
258259
259- if (scan_sw) sprintf (temp, "ScnRpt %8.8s scan", area_call);
260- else sprintf (temp, "Rpt %8.8s dmon", area_call);
261- temp[20] = 0x00;
260+ if (scan_sw) sprintf (temp, "ScnRpt %8.8s ", area_call);
261+ else sprintf (temp, "Rpt %8.8s ", area_call);
262+ temp[16] = 0x00;
262263 }
263264 else if (lcd_type == LCD_16x2)
264265 {
265- if (scan_sw) sprintf (temp, "%8.8s scan", area_call);
266- else sprintf (temp, "%8.8s dmon", area_call);
267- temp[16] = 0x00;
266+ if (scan_sw) sprintf (temp, "%8.8s ", area_call);
267+ else sprintf (temp, "%8.8s ", area_call);
268+ temp[12] = 0x00;
268269 }
269270 lcdPuts(lcd, temp);
270271 }
@@ -315,6 +316,25 @@ int main(int argc, char *argv[])
315316 while (1)
316317 {
317318 top:
319+ time (&cur_time);
320+ if ((lcd_type != NONE) && (cur_time != lcd_time_save))
321+ {
322+ if (lcd_type == LCD_20x4) lcdPosition (lcd, 16, 0);
323+ else if (lcd_type == LCD_16x2) lcdPosition (lcd, 12, 0);
324+ if (cur_time % 2)
325+ {
326+ if (scan_sw) lcdPuts (lcd, "SCAN\0");
327+ else lcdPuts (lcd, "DMON\0");
328+ }
329+ else
330+ {
331+ if (scan_sw) lcdPuts (lcd, "scan\0");
332+ else lcdPuts (lcd, "dmon\0");
333+ }
334+ lcd_time_save = cur_time;
335+ }
336+
337+
318338 memcpy (&read_set, &fd_save, sizeof(fd_set));
319339 memcpy (&sigset, &save_sig, sizeof(save_sig));
320340 ret = pselect (FD_SETSIZE, &read_set, (fd_set *)NULL,
@@ -339,7 +359,6 @@ top:
339359 }
340360 jitter_putFifo();
341361 rig ();
342- time (&cur_time);
343362 if ((cur_time - hole_punch_send_time) >= hole_punch_send_interval)
344363 {
345364 if (hole_punch_send_interval == HOLE_PUNCH_SEND_INTERVAL)
--- a/node_utils.c
+++ b/node_utils.c
@@ -2,6 +2,8 @@
22
33 void PICinfo (void);
44 void node_term (void);
5+void header_read_from_node(void);
6+int voice_read_from_node(void);
57
68 void node_close (void)
79 {
--- a/rpt_conn.c
+++ b/rpt_conn.c
@@ -21,6 +21,7 @@ int rpt_conn_scan (void);
2121 void node_close (void);
2222 void lcd_init (void);
2323 void lcdPosition (int handle, int x, int y);
24+void lcd_write (void);
2425
2526 void main(void)
2627 {
@@ -88,6 +89,7 @@ void main(void)
8889 ScanTable_pnt = NULL;
8990 wiringPiSetupGpio();
9091 if (lcd_type != NODE) lcd_init();
92+ lcd_time_save = 0;
9193 loop:
9294 node_VenderID = 0x4d8;
9395 node_ProductID = 0x300;
@@ -110,30 +112,21 @@ scan_loop:
110112 while (1)
111113 {
112114 time (&cur_time);
113- if (lcd_type == LCD_20x4)
115+ if ((lcd_type != NONE) && (cur_time != lcd_time_save))
114116 {
115- lcdPosition (lcd, 16, 0);
116- }
117- else if (lcd_type == LCD_16x2)
118- {
119- lcdPosition (lcd, 12, 0);
120- }
121- if (lcd_type != NODE)
122- {
123- if (cur_time %2) memset (temp, 0x20, 4);
124- else
117+ if (lcd_type == LCD_20x4) lcdPosition (lcd, 16, 0);
118+ else if (lcd_type == LCD_16x2) lcdPosition (lcd, 12, 0);
119+ if (cur_time %2)
125120 {
126- if (scan_sw)
127- {
128- memcpy (temp, "scan", 4);
129- }
130- else
131- {
132- memcpy (temp, "rptc", 4);
133- }
134- }
135- temp[4] = 0x00;
136- lcdPuts (lcd, temp);
121+ if (scan_sw) lcdPuts (lcd, "SCAN\0");
122+ else lcdPuts (lcd, "RPTC\0");
123+ }
124+ else
125+ {
126+ if (scan_sw) lcdPuts (lcd, "scan\0");
127+ else lcdPuts (lcd, "rptc\0");
128+ }
129+ lcd_time_save = cur_time;
137130 }
138131 memcpy (&read_set, &fd_save, sizeof(fd_set));
139132 memcpy (&sigset, &save_sig, sizeof(save_sig));
@@ -193,63 +186,43 @@ skip:
193186 }
194187 if (!memcmp (connect_call, "STATUS", 6))
195188 {
196- if (lcd_type == LCD_20x4) lcdPosition (lcd, 0, 3);
197189 memcpy (msg_temp, "RPT CONN RUNNING ", 20);
198190 memcpy (mycall2, "RPTC", 4);
199191 flag1 = 0x00;
200192 send_msg_sw = TRUE;
201193 memset (connect_call, 0x00, 8);
202194 scan_sw = FALSE;
203- if (lcd_type == LCD_20x4)
204- {
205- msg_temp[20] = 0x00;
206- lcdPuts (lcd, msg_temp);
207- }
195+ lcd_write ();
208196 }
209197 if (!memcmp (connect_call, "UNLINK", 6) || !memcmp (connect_call, "DISCON", 6))
210198 {
211- if (lcd_type == LCD_20x4) lcdPosition (lcd, 0, 3);
212199 memcpy (msg_temp, "NOT UNLINK RPTC RUN", 20);
213200 memcpy (mycall2, "RPTC", 4);
214201 flag1 = 0x00;
215202 send_msg_sw = TRUE;
216203 memset (connect_call, 0x00, 8);
217204 scan_sw = FALSE;
218- if (lcd_type == LCD_20x4)
219- {
220- msg_temp[20] = 0x00;
221- lcdPuts (lcd, msg_temp);
222- }
205+ lcd_write ();
223206 }
224207 if (!memcmp (connect_call, "REBOOT", 6))
225208 {
226- if (lcd_type == LCD_20x4) lcdPosition (lcd, 0, 3);
227209 memcpy (msg_temp, "RASPI REBOOT ", 20);
228210 memcpy (mycall2, "RPTC", 4);
229211 flag1 = 0x00;
230212 send_msg_sw = TRUE;
231213 memset (connect_call, 0x00, 8);
232214 reboot_sw = TRUE;
233- if (lcd_type == LCD_20x4)
234- {
235- msg_temp[20] = 0x00;
236- lcdPuts (lcd, msg_temp);
237- }
215+ lcd_write ();
238216 }
239217 if (!memcmp (connect_call, "SHUTDOWN", 6))
240218 {
241- if (lcd_type == LCD_20x4) lcdPosition (lcd, 0, 3);
242219 memcpy (msg_temp, "RASPI SHUTDOWN ", 20);
243220 memcpy (mycall2, "RPTC", 4);
244221 flag1 = 0x00;
245222 send_msg_sw = TRUE;
246223 memset (connect_call, 0x00, 8);
247224 shutdown_sw = TRUE;
248- if (lcd_type == LCD_20x4)
249- {
250- msg_temp[20] = 0x00;
251- lcdPuts (lcd, msg_temp);
252- }
225+ lcd_write ();
253226 }
254227 if (!memcmp (connect_call, "SCAN", 4))
255228 {
--- a/rpt_conn.h
+++ b/rpt_conn.h
@@ -238,3 +238,4 @@ union
238238
239239 int lcd_type;
240240 int lcd;
241+time_t lcd_time_save;
--- a/rpt_conn_rig.c
+++ b/rpt_conn_rig.c
@@ -15,7 +15,7 @@ void dvap_write (int fd, unsigned char buff[], int length);
1515 int read_dvmega(void);
1616 void send_dvmega_status(void);
1717 void dvmega_write (int fd, unsigned char buff[], int length);
18-void node_write (unsigned char buff[], int length);
18+void node_write (unsigned char buff[], int length);
1919 void dvmega (void);
2020 void node (void);
2121