---------------------------------------------------------*\ | serial_break | \*---------------------------------------------------------*/
| 629 | | serial_break | |
| 630 | \*---------------------------------------------------------*/ |
| 631 | void serial_port::serial_break() |
| 632 | { |
| 633 | /*-----------------------------------------------------*\ |
| 634 | | Windows-specific code path for serial break | |
| 635 | \*-----------------------------------------------------*/ |
| 636 | #ifdef _WIN32 |
| 637 | SetCommBreak(file_descriptor); |
| 638 | Sleep(1); |
| 639 | ClearCommBreak(file_descriptor); |
| 640 | #endif |
| 641 | |
| 642 | /*-----------------------------------------------------*\ |
| 643 | | Linux-specific code path for serial break | |
| 644 | \*-----------------------------------------------------*/ |
| 645 | #ifdef __linux__ |
| 646 | //Send break for at least 1 ms |
| 647 | ioctl(file_descriptor, TIOCSBRK); |
| 648 | usleep(1000); |
| 649 | ioctl(file_descriptor, TIOCCBRK); |
| 650 | #endif |
| 651 | |
| 652 | /*-----------------------------------------------------*\ |
| 653 | | MacOS-specific code path for serial break | |
| 654 | \*-----------------------------------------------------*/ |
| 655 | #ifdef __APPLE__ |
| 656 | //Send break for at least 1 ms |
| 657 | ioctl(file_descriptor, TIOCSBRK); |
| 658 | usleep(1000); |
| 659 | ioctl(file_descriptor, TIOCCBRK); |
| 660 | #endif |
| 661 | } |
| 662 | |
| 663 | void serial_port::serial_set_rts(bool rts) |
| 664 | { |
no test coverage detected