New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ring_buf #79
Labels
Comments
感谢反馈 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
描述bug
当read的数量大于ring_buf当前的数值是会有bug
重现步骤
//初始化
port1 = new CSerialPort;
port1->init( "COM2" , 256000 );
port1->setOperateMode(AsynchronousOperate);
port1->setReadBufferSize(1024);
port1->setReadIntervalTimeout(0);
port1->open();
//自己的额外的接收线程
static void* port1_across_impl(void* args)
{
uint8_t buf[1024];
int read_cnt;
int write_cnt;
int writed_cnt;
while(1)
{
read_cnt = port1->readData( buf , 12 );
if( read_cnt != 0 )
{
std::cout<<read_cnt<<std::endl;
}
}
pthread_exit(NULL);
}
//外围设备向port1发送"12341241234132421342314\r\n"之后便没有后续发送了,但是readData函数仍然返回12,断点查看 ibuffer.hpp中的read方法发现m_head一直在增长
运行环境信息:
The text was updated successfully, but these errors were encountered: