Changeset 641
- Timestamp:
- 01/31/07 22:00:56 (6 years ago)
- File:
-
- 1 edited
-
trunk/src/target/gsm/src/gsmd/gsmd.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/target/gsm/src/gsmd/gsmd.c
r546 r641 102 102 }; 103 103 104 static int set_baudrate(int fd, int baudrate )104 static int set_baudrate(int fd, int baudrate, int hwflow) 105 105 { 106 106 int i; … … 127 127 return i; 128 128 129 if (hwflow) 130 ti.c_cflag |= CRTSCTS; 131 else 132 ti.c_cflag &= ~CRTSCTS; 133 129 134 return tcsetattr(fd, 0, &ti); 130 135 } … … 147 152 { "speed", 1, NULL, 's' }, 148 153 { "logfile", 1, NULL, 'l' }, 154 { "hwflow", 0, NULL, 'F' }, 149 155 { "leak-report", 0, NULL, 'L' }, 150 156 { 0, 0, 0, 0 } … … 161 167 "\t-p dev\t--device dev\tSpecify serial device to be used\n" 162 168 "\t-s spd\t--speed spd\tSpecify speed in bps (9600,38400,115200,...)\n" 169 "\t-F\t--hwflow\tHardware Flow Control (RTS/CTS)\n" 170 "\t-L\t--leak-report\tLeak Report of talloc memory allocator\n" 163 171 "\t-l file\t--logfile file\tSpecify a logfile to log to\n" 164 172 ); … … 185 193 int daemonize = 0; 186 194 int bps = 115200; 195 int hwflow = 0; 187 196 char *device = "/dev/ttyUSB0"; 188 197 char *logfile = "syslog"; … … 196 205 197 206 /*FIXME: parse commandline, set daemonize, device, ... */ 198 while ((argch = getopt_long(argc, argv, " VLdhp:s:l:", opts, NULL)) != -1) {207 while ((argch = getopt_long(argc, argv, "FVLdhp:s:l:", opts, NULL)) != -1) { 199 208 switch (argch) { 200 209 case 'V': … … 203 212 case 'L': 204 213 talloc_enable_leak_report_full(); 214 break; 215 case 'F': 216 hwflow = 1; 205 217 break; 206 218 case 'd': … … 235 247 } 236 248 237 if (set_baudrate(fd, bps ) < 0) {249 if (set_baudrate(fd, bps, hwflow) < 0) { 238 250 fprintf(stderr, "can't set baudrate\n"); 239 251 exit(1);
Note: See TracChangeset
for help on using the changeset viewer.
