MCPcopy Create free account
hub / github.com/cinder/Cinder / getNumBytesAvailable

Method getNumBytesAvailable

src/cinder/Serial.cpp:352–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350}
351
352size_t Serial::getNumBytesAvailable() const
353{
354 int result;
355
356#if defined( CINDER_MAC ) || defined( CINDER_LINUX )
357 ::ioctl( mImpl->mFd, FIONREAD, &result );
358#elif defined( CINDER_MSW )
359 ::COMSTAT status;
360 ::DWORD error;
361 if( ! ::ClearCommError( mImpl->mDeviceHandle, &error, &status ) )
362 throw SerialExc( "Serial failure upon attempt to retrieve information on device handle" );
363 else
364 result = status.cbInQue;
365#endif
366
367 return result;
368}
369
370void Serial::flush( bool input, bool output )
371{

Callers 1

setupMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected