Functions

serial_utils.c File Reference

シリアル送受信の補助 More...

#include "serial_utils.h"
#include "serial_ctrl.h"
#include <stdio.h>
#include <ctype.h>
Include dependency graph for serial_utils.c:

Functions

int serial_isLF (const char ch)
 改行コードかを返す
void serial_skip (serial_t *serial, int total_timeout, int each_timeout)
 受信データを読み飛ばす
int serial_getLine (serial_t *serial, char *data, int data_size_max, int timeout)
 改行までの読みだし

Detailed Description

シリアル送受信の補助

Author:
Satofumi KAMIMURA
Id:
serial_utils.c 1308 2009-09-16 07:35:45Z satofumi

Function Documentation

int serial_getLine ( serial_t serial,
char *  data,
int  data_size_max,
int  timeout 
)

改行までの読みだし

文字列終端に '\0' を付加して返す

Parameters:
[in,out] serial シリアル制御の構造体
[in] data 受信データ格納バッファ
[in] data_size_max 受信バッファの最大サイズ
[in] timeout タイムアウト [msec]
Returns:
受信文字数

Here is the call graph for this function:

Here is the caller graph for this function:

int serial_isLF ( const char  ch  ) 

改行コードかを返す

Return values:
true LF, CR のとき
false 上記以外のとき

Here is the caller graph for this function:

void serial_skip ( serial_t serial,
int  total_timeout,
int  each_timeout 
)

受信データを読み飛ばす

ConnectionInterface::clear() とは、タイムアウト時間を指定して読み飛ばせる点が異なる

Parameters:
[in,out] serial シリアル制御の構造体
[in] total_timeout タイムアウト時間の上限 [msec]
[in] each_timeout 受信データ間におけるタイムアウト時間の上限 [msec]

Here is the call graph for this function:

Here is the caller graph for this function: