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

Method readAvailableBytes

src/cinder/Serial.cpp:293–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291}
292
293size_t Serial::readAvailableBytes( void *data, size_t maximumBytes )
294{
295#if defined( CINDER_MAC ) || defined( CINDER_LINUX )
296 long bytesRead = ::read( mImpl->mFd, data, maximumBytes );
297#elif defined( CINDER_MSW )
298 ::DWORD bytesRead = 0;
299 if( ! ::ReadFile( mImpl->mDeviceHandle, data, static_cast<DWORD>( maximumBytes ), &bytesRead, 0 ) )
300 throw SerialExcReadFailure();
301#endif
302
303 if( bytesRead < 0 )
304 bytesRead = 0;
305
306 return (size_t)bytesRead;
307}
308
309void Serial::writeByte( uint8_t data )
310{

Callers

nothing calls this directly

Calls 1

readFunction · 0.50

Tested by

no test coverage detected