首页 > 其他 > 详细

cyg_io_read返回值是0,因为读到的字节长度在参数中

时间:2014-07-29 12:19:16      阅读:382      评论:0      收藏:0      [点我收藏+]

len = cyg_io_read(ser_handle1, ucMasterRTURcvBuftmp, &len);//

len等于0,cyg_io_read读到的字节数在参数中的红色的len,而不是前面的len

cyg_io_read函数的说明中有:

Syntax:
Cyg_ErrNo
cyg_io_read(
 cyg_io_handle_t handle,
 void *buf,
 cyg_uint32 *len
 );
Parameters:        handle—handle to the device.
buf—pointer to the buffer to store the data.
len—pointer to the size of data to receive. When the function returns, this parameter con-
tains the actual size of data received.
Description:       Receive data from the device speci?ed by the handle parameter. If ENOERR is returned,
the write operation completed successfully. The actual number of bytes read is returned in
the len parameter.

cyg_io_read返回值是0,因为读到的字节长度在参数中,布布扣,bubuko.com

cyg_io_read返回值是0,因为读到的字节长度在参数中

原文:http://www.cnblogs.com/flying06/p/3874683.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!