シリアル用の補助関数 More...
#include "urg_c/urg_serial_utils.h"
#include <dirent.h>
#include <sys/stat.h>
#include <string.h>
#include <stdio.h>
Go to the source code of this file.
Enumerations | |
enum | { MAX_PORTS = 16, DEVICE_NAME_SIZE = 255 } |
Functions | |
static void | check_base_name (const char *dir_name, const char *file_name) |
int | urg_serial_find_port (void) |
シリアルポートを検索する | |
int | urg_serial_is_urg_port (int index) |
ポートが URG かどうか | |
const char * | urg_serial_port_name (int index) |
検索したシリアルポート名を返す | |
Variables | |
static char | found_ports [MAX_PORTS][DEVICE_NAME_SIZE] |
static int | found_ports_size = 0 |
static const char * | search_base_names [] |
static const char * | search_dir_names [] |
シリアル用の補助関数
Definition in file urg_serial_utils_linux.c.
anonymous enum |
Definition at line 17 of file urg_serial_utils_linux.c.
static void check_base_name | ( | const char * | dir_name, |
const char * | file_name | ||
) | [static] |
Definition at line 37 of file urg_serial_utils_linux.c.
int urg_serial_find_port | ( | void | ) |
シリアルポートを検索する
Definition at line 53 of file urg_serial_utils_linux.c.
int urg_serial_is_urg_port | ( | int | index | ) |
ポートが URG かどうか
1 | URG のポート |
0 | 不明 |
<0 | エラー |
Definition at line 85 of file urg_serial_utils_linux.c.
const char* urg_serial_port_name | ( | int | index | ) |
検索したシリアルポート名を返す
Definition at line 75 of file urg_serial_utils_linux.c.
char found_ports[MAX_PORTS][DEVICE_NAME_SIZE] [static] |
Definition at line 23 of file urg_serial_utils_linux.c.
int found_ports_size = 0 [static] |
Definition at line 24 of file urg_serial_utils_linux.c.
const char* search_base_names[] [static] |
{ "ttyACM", "ttyUSB", "tty.usbmodem", }
Definition at line 30 of file urg_serial_utils_linux.c.
const char* search_dir_names[] [static] |
{ "/dev", "/dev/usb", }
Definition at line 26 of file urg_serial_utils_linux.c.