| 368 | } |
| 369 | |
| 370 | void Serial::flush( bool input, bool output ) |
| 371 | { |
| 372 | #if defined( CINDER_MAC ) || defined( CINDER_LINUX ) |
| 373 | int queue; |
| 374 | if( input && output ) |
| 375 | queue = TCIOFLUSH; |
| 376 | else if( input ) |
| 377 | queue = TCIFLUSH; |
| 378 | else if( output ) |
| 379 | queue = TCOFLUSH; |
| 380 | else |
| 381 | return; |
| 382 | |
| 383 | ::tcflush( mImpl->mFd, queue ); |
| 384 | #elif defined( CINDER_MSW ) |
| 385 | ::DWORD flags = 0; |
| 386 | flags |= ( input ) ? PURGE_RXCLEAR : 0; |
| 387 | flags |= ( output ) ? PURGE_TXCLEAR : 0; |
| 388 | |
| 389 | if( input || output ) |
| 390 | ::PurgeComm( mImpl->mDeviceHandle, flags ); |
| 391 | #endif |
| 392 | } |
| 393 | |
| 394 | } // namespace cinder |
no outgoing calls
no test coverage detected