FreeCalypso > hg > fc-rfcal-tools
comparison cmu200/main.c @ 0:bd62be88259d
initial import of rfcal code and docs from freecalypso-tools repository
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 20 May 2017 18:49:35 +0000 |
parents | |
children | 6d7079a81e8b |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:bd62be88259d |
---|---|
1 /* | |
2 * This module contains the main() function for fc-cmu200d. | |
3 */ | |
4 | |
5 #include <stdio.h> | |
6 #include <stdlib.h> | |
7 | |
8 int target_fd; | |
9 | |
10 static char default_socket_pathname[] = "/tmp/fc_rftest_socket"; | |
11 | |
12 char *bind_socket_pathname; | |
13 | |
14 main(argc, argv) | |
15 char **argv; | |
16 { | |
17 if (argc < 3 || argc > 4) { | |
18 fprintf(stderr, | |
19 "usage: %s serial-port baud [socket-pathname]\n", | |
20 argv[0]); | |
21 exit(1); | |
22 } | |
23 open_target_serial(argv[1], argv[2]); | |
24 set_serial_nonblock(0); | |
25 init_cmu200(); | |
26 if (argc > 3) | |
27 bind_socket_pathname = argv[3]; | |
28 else | |
29 bind_socket_pathname = default_socket_pathname; | |
30 create_listener_socket(); | |
31 for (;;) { | |
32 get_socket_connection(); | |
33 handle_session(); | |
34 } | |
35 } |