| 2837 | ----------------------------------------------------------*/ |
| 2838 | |
| 2839 | int tcsendbreak(int fd, int duration) |
| 2840 | { |
| 2841 | struct termios_list *index; |
| 2842 | COMSTAT Stat; |
| 2843 | |
| 2844 | ENTER("tcsendbreak"); |
| 2845 | |
| 2846 | index = win32_serial_find_port(fd); |
| 2847 | |
| 2848 | if (!index) |
| 2849 | { |
| 2850 | LEAVE("tcdrain"); |
| 2851 | return -1; |
| 2852 | } |
| 2853 | |
| 2854 | if (duration <= 0) { duration = 1; } |
| 2855 | |
| 2856 | if (!SetCommBreak(index->hComm)) |
| 2857 | { |
| 2858 | ClearErrors(index, &Stat); |
| 2859 | } |
| 2860 | |
| 2861 | /* 0.25 seconds == 250000 usec */ |
| 2862 | hl_usleep(duration * 250000); |
| 2863 | |
| 2864 | if (!ClearCommBreak(index->hComm)) |
| 2865 | { |
| 2866 | ClearErrors(index, &Stat); |
| 2867 | } |
| 2868 | |
| 2869 | LEAVE("tcsendbreak"); |
| 2870 | return 1; |
| 2871 | } |
| 2872 | |
| 2873 | /*---------------------------------------------------------- |
| 2874 | tcdrain() |
nothing calls this directly
no test coverage detected