FT_SetTimeouts函数的用法

介绍FT_SetTimeouts函数的用法、参数、返回值、注意事项、适用的操作系统环境、调用代码示例等。

null

支持的操作系统

Linux

Mac OS X 10.4 以上版本

Windows 2000 以上版本

Windows CE 4.2以上版本

概述

FT_SetTimeouts函数设置读写操作的超时时间。

定义

FT_STATUS FT_SetTimeouts (FT_HANDLE ftHandle, DWORD dwReadTimeout, DWORD dwWriteTimeout)

参数说明

ftHandle—设备句柄。

dwReadTimeout — 读操作超时,毫秒;

dwWriteTimeout — 写操作超时,毫秒;

返回值

成功则返回FT_OK,如果失败则根据错误返回特定错误码(FT_*).

备注

暂无。

代码示例

FT_HANDLE ftHandle;
FT_STATUS ftStatus;
ftStatus = FT_Open(0, &ftHandle);
if(ftStatus != FT_OK) {
// FT_Open failed
return;
}
// Set read timeout of 5sec, write timeout of 1sec
ftStatus = FT_SetTimeouts(ftHandle, 5000, 1000);
if (ftStatus == FT_OK) {
// FT_SetTimeouts OK
}
else {
// FT_SetTimeouts failed
}
FT_Close(ftHandle);

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容