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

Function ClearErrors

lib/termios.c:583–651  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

581----------------------------------------------------------*/
582
583static int ClearErrors(struct termios_list *index, COMSTAT *Stat)
584{
585 unsigned long ErrCode;
586 int ret;
587
588 ret = ClearCommError(index->hComm, &ErrCode, Stat);
589
590 if (ret == 0)
591 {
592 YACK();
593 return (ret);
594 }
595
596#ifdef DEBUG_ERRORS
597
598 if (ErrCode)
599 {
600 printf("%i frame %i %i overrun %li %i parity %u %i brk %i %i\n",
601 (int) ErrCode,
602 (int) ErrCode & CE_FRAME,
603 index->sis->frame,
604 (int)(ErrCode & CE_OVERRUN) | (ErrCode & CE_RXOVER),
605 index->sis->overrun,
606 (int) ErrCode & CE_RXPARITY,
607 index->sis->parity,
608 (int) ErrCode & CE_BREAK,
609 index->sis->brk
610 );
611 }
612
613#endif /* DEBUG_ERRORS */
614
615 if (ErrCode & CE_FRAME)
616 {
617 index->sis->frame++;
618 ErrCode &= ~CE_FRAME;
619 }
620
621#ifdef LIFE_IS_GOOD
622 FIXME OVERRUN is spewing
623
624 if (ErrCode & CE_OVERRUN)
625 {
626 index->sis->overrun++;
627 ErrCode &= ~CE_OVERRUN;
628 }
629 /* should this be here? */
630 else if (ErrCode & CE_RXOVER)
631 {
632 index->sis->overrun++;
633 ErrCode &= ~CE_OVERRUN;
634 }
635
636#endif /* LIFE_IS_GOOD */
637
638 if (ErrCode & CE_RXPARITY)
639 {
640 index->sis->parity++;

Callers 4

win32_serial_readFunction · 0.85
tcsendbreakFunction · 0.85
win32_serial_ioctlFunction · 0.85
win32_serial_selectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected