码迷,mamicode.com
首页 > 其他好文 > 详细

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

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

标签:des   style   color   io   cti   ar   amp   size   

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,因为读到的字节长度在参数中

标签:des   style   color   io   cti   ar   amp   size   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!