MCPcopy Create free account
hub / github.com/Hamlib/Hamlib / tcsendbreak

Function tcsendbreak

lib/termios.c:2839–2871  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2837----------------------------------------------------------*/
2838
2839int 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/*----------------------------------------------------------
2874tcdrain()

Callers

nothing calls this directly

Calls 3

win32_serial_find_portFunction · 0.85
ClearErrorsFunction · 0.85
hl_usleepFunction · 0.85

Tested by

no test coverage detected