comparison rvinterf/lowlevel/rvifmain.c @ 253:6f078c4a5506

rvinterf and friends converted to use libserial
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 21 Sep 2017 23:45:05 +0000
parents 7168f63fc3b8
children a626f0ef542a
comparison
equal deleted inserted replaced
252:d27a89068280 253:6f078c4a5506
14 #include "../include/pktmux.h" 14 #include "../include/pktmux.h"
15 #include "../include/localsock.h" 15 #include "../include/localsock.h"
16 #include "client.h" 16 #include "client.h"
17 17
18 extern int target_fd, listener; 18 extern int target_fd, listener;
19 extern char *baudrate_name;
20 extern char *extlcd_program; 19 extern char *extlcd_program;
21 extern u_char extlcd_invert; 20 extern u_char extlcd_invert;
22 21
23 extern u_char rxpkt[]; 22 extern u_char rxpkt[];
24 extern size_t rxpkt_len; 23 extern size_t rxpkt_len;
33 int max_fd; 32 int max_fd;
34 33
35 char *socket_pathname = "/tmp/rvinterf_socket"; 34 char *socket_pathname = "/tmp/rvinterf_socket";
36 35
37 int wakeup_after_sec = 7; 36 int wakeup_after_sec = 7;
37
38 static char *baudrate = "115200";
38 39
39 static char keepalive_msg[] = 40 static char keepalive_msg[] =
40 "Received keepalive query, responding with keepalive answer"; 41 "Received keepalive query, responding with keepalive answer";
41 static u_char keepalive_answer[2] = {RVT_KEEPALIVE_HEADER, 'A'}; 42 static u_char keepalive_answer[2] = {RVT_KEEPALIVE_HEADER, 'A'};
42 43
56 /* FALL THRU */ 57 /* FALL THRU */
57 case 'n': 58 case 'n':
58 no_output++; 59 no_output++;
59 continue; 60 continue;
60 case 'B': 61 case 'B':
61 baudrate_name = optarg; 62 baudrate = optarg;
62 continue; 63 continue;
63 case 'd': 64 case 'd':
64 target_fd = atoi(optarg); 65 target_fd = atoi(optarg);
65 continue; 66 continue;
66 case 'l': 67 case 'l':
88 exit(1); 89 exit(1);
89 } 90 }
90 if (target_fd <= 0) { 91 if (target_fd <= 0) {
91 if (argc - optind != 1) 92 if (argc - optind != 1)
92 goto usage; 93 goto usage;
93 open_target_serial(argv[optind]); 94 open_serial_port(argv[optind]);
95 set_fixed_baudrate(baudrate);
94 } 96 }
95 max_fd = target_fd; 97 max_fd = target_fd;
96 if (extlcd_program) 98 if (extlcd_program)
97 open_extlcd_pipe(); 99 open_extlcd_pipe();
98 100