MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / serial_set_rts

Method serial_set_rts

serial_port/serial_port.cpp:663–708  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

661}
662
663void serial_port::serial_set_rts(bool rts)
664{
665 /*-----------------------------------------------------*\
666 | Windows-specific code path for serial set RTS |
667 \*-----------------------------------------------------*/
668#ifdef _WIN32
669 if(rts)
670 {
671 EscapeCommFunction(file_descriptor, SETRTS);
672 }
673 else
674 {
675 EscapeCommFunction(file_descriptor, CLRRTS);
676 }
677#endif
678
679 /*-----------------------------------------------------*\
680 | Linux-specific code path for serial set RTS |
681 \*-----------------------------------------------------*/
682#ifdef __linux__
683 const int RTSFLAG = TIOCM_RTS;
684 if(rts)
685 {
686 ioctl(file_descriptor, TIOCMBIS, &RTSFLAG);
687 }
688 else
689 {
690 ioctl(file_descriptor, TIOCMBIC, &RTSFLAG);
691 }
692#endif
693
694 /*-----------------------------------------------------*\
695 | MacOS-specific code path for serial set RTS |
696 \*-----------------------------------------------------*/
697#ifdef __APPLE__
698 const int RTSFLAG = TIOCM_RTS;
699 if(rts)
700 {
701 ioctl(file_descriptor, TIOCMBIS, &RTSFLAG);
702 }
703 else
704 {
705 ioctl(file_descriptor, TIOCMBIC, &RTSFLAG);
706 }
707#endif
708}

Callers 1

RGBController_DMXMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected