Enumerations | Functions

serial_ctrl_win.c File Reference

シリアル通信 (Windows 実装) More...

#include "serial_ctrl.h"
#include "serial_errno.h"
#include "ring_buffer.h"
#include <stdio.h>
Include dependency graph for serial_ctrl_win.c:

Enumerations

enum  { False = 0, True }

Functions

void serial_initialize (serial_t *serial)
int serial_connect (serial_t *serial, const char *device, long baudrate)
 接続
void serial_disconnect (serial_t *serial)
 切断
int serial_isConnected (const serial_t *serial)
 接続中かを返す
int serial_setBaudrate (serial_t *serial, long baudrate)
 ボーレートの変更
int serial_send (serial_t *serial, const char *data, int data_size)
 送信
int serial_recv (serial_t *serial, char *data, int data_size_max, int timeout)
 受信
void serial_ungetc (serial_t *serial, char ch)
 受信した1文字を書き戻す
void serial_clear (serial_t *serial)
 送受信バッファを破棄

Detailed Description

シリアル通信 (Windows 実装)

Serial Communication Interface 制御

Author:
Satofumi KAMIMURA
Id:
serial_ctrl_win.c 1559 2009-12-01 13:13:08Z satofumi

Enumeration Type Documentation

anonymous enum
Enumerator:
False 
True 

Function Documentation

void serial_clear ( serial_t serial  ) 

送受信バッファを破棄

Here is the caller graph for this function:

int serial_connect ( serial_t serial,
const char *  device,
long  baudrate 
)

接続

Parameters:
[in,out] serial シリアル制御の構造体
[in] device 接続デバイス
[in] baudrate 接続ボーレート
Return values:
0 正常
< 0 エラー

Here is the call graph for this function:

Here is the caller graph for this function:

void serial_disconnect ( serial_t serial  ) 

切断

Parameters:
[in,out] serial シリアル制御の構造体

Here is the caller graph for this function:

void serial_initialize ( serial_t serial  ) 

Here is the call graph for this function:

Here is the caller graph for this function:

int serial_isConnected ( const serial_t serial  ) 

接続中かを返す

Parameters:
[in] serial シリアル制御の構造体
Return values:
1 接続中
0 切断中

Here is the caller graph for this function:

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

受信

Parameters:
[in,out] serial シリアル制御の構造体
[in] data 受信データ格納バッファ
[in] data_size_max 受信バッファの最大サイズ
[in] timeout タイムアウト [msec]
Return values:
>= 0 受信サイズ
< 0 エラー

Here is the call graph for this function:

Here is the caller graph for this function:

int serial_send ( serial_t serial,
const char *  data,
int  data_size 
)

送信

Parameters:
[in,out] serial シリアル制御の構造体
[in] data 送信データ
[in] data_size 送信サイズ
Return values:
>= 0 送信サイズ
< 0 エラー

Here is the call graph for this function:

Here is the caller graph for this function:

int serial_setBaudrate ( serial_t serial,
long  baudrate 
)

ボーレートの変更

Parameters:
[in,out] serial シリアル制御の構造体
[in] baudrate ボーレート
Return values:
0 正常
< 0 エラー

Here is the caller graph for this function:

void serial_ungetc ( serial_t serial,
char  ch 
)

受信した1文字を書き戻す

Parameters:
[in,out] serial シリアル制御の構造体
[in] ch 書き戻す1文字
Attention:
読み出しを行わずに、連続して書き戻してはならない

Here is the caller graph for this function: