Changeset 9079 for trunk/src/kernel32/hmcomm.cpp
- Timestamp:
- Aug 21, 2002, 7:23:12 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/hmcomm.cpp
r8844 r9079 1 /* $Id: hmcomm.cpp,v 1.3 7 2002-07-06 09:57:31sandervl Exp $ */1 /* $Id: hmcomm.cpp,v 1.38 2002-08-21 17:23:12 sandervl Exp $ */ 2 2 3 3 /* … … 61 61 static DWORD CommWriteIOHandler(LPASYNCIOREQUEST lpRequest, DWORD *lpdwResult, DWORD *lpdwTimeOut); 62 62 static DWORD CommPollIOHandler(LPASYNCIOREQUEST lpRequest, DWORD *lpdwResult, DWORD *lpdwTimeOut); 63 63 #ifdef DEBUG 64 static char *DebugCommEvent(DWORD dwEvents); 65 static char *DebugModemStatus(DWORD dwModemStatus); 66 #endif 64 67 //****************************************************************************** 65 68 //****************************************************************************** … … 416 419 if(!rc) 417 420 { 421 #ifdef DEBUG 422 if(COMEvt) dprintf(("ASYNC_GETCOMMEVENT %x", COMEvt)); 423 #endif 418 424 dwEvent |= (COMEvt&0x0001)? EV_RXCHAR:0; 419 425 //dwEvent |= (COMEvt&0x0002)? 0:0; … … 421 427 dwEvent |= (COMEvt&0x0008)? EV_CTS:0; 422 428 dwEvent |= (COMEvt&0x0010)? EV_DSR:0; 423 //dwEvent |= (COMEvt&0x0020)? 0:0; DCS = RLSD?429 dwEvent |= (COMEvt&0x0020)? EV_RLSD:0; 424 430 dwEvent |= (COMEvt&0x0040)? EV_BREAK:0; 425 431 dwEvent |= (COMEvt&0x0080)? EV_ERR:0; … … 442 448 } 443 449 if((dwEvent & dwMask)) { 444 dprintf(("CommPollIOHandler: event(s) % x occured", (dwEvent & dwMask)));450 dprintf(("CommPollIOHandler: event(s) %s %x occured", DebugCommEvent((dwEvent & dwMask)), (dwEvent & dwMask))); 445 451 *lpdwResult = (dwEvent & dwMask); 446 452 return ERROR_SUCCESS; … … 689 695 dwEvent |= (COMEvt&0x0008)? EV_CTS:0; 690 696 dwEvent |= (COMEvt&0x0010)? EV_DSR:0; 691 //dwEvent |= (COMEvt&0x0020)? 0:0; DCS = RLSD?697 dwEvent |= (COMEvt&0x0020)? EV_RLSD:0; 692 698 dwEvent |= (COMEvt&0x0040)? EV_BREAK:0; 693 699 dwEvent |= (COMEvt&0x0080)? EV_ERR:0; … … 701 707 if(dwMask == pDevData->dwEventMask) { 702 708 *lpfdwEvtMask = (rc==0) ? (dwEvent & dwMask) : 0; 703 dprintf(("WaitCommEvent returned % x", *lpfdwEvtMask));709 dprintf(("WaitCommEvent returned %s %x", DebugCommEvent(*lpfdwEvtMask), *lpfdwEvtMask)); 704 710 } 705 711 else *lpfdwEvtMask = 0; … … 834 840 dprintf(("HMDeviceCommClass::SetCommMask %x", fdwEvtMask)); 835 841 836 if(fdwEvtMask & (EV_R LSD|EV_RXFLAG)) {837 dprintf(("!WARNING! SetCommMask: unsupported flag s EV_RLSD and/orEV_RXFLAG!!"));838 } 839 840 pDevData->dwEventMask = fdwEvtMask & ~(EV_R LSD|EV_RXFLAG); // Clear the 2 not supported Flags.842 if(fdwEvtMask & (EV_RXFLAG)) { 843 dprintf(("!WARNING! SetCommMask: unsupported flag EV_RXFLAG!!")); 844 } 845 846 pDevData->dwEventMask = fdwEvtMask & ~(EV_RXFLAG); // Clear the not supported Flag. 841 847 return(TRUE); 842 848 } … … 1051 1057 *lpModemStat |= (ucStatus & 0x20)? MS_DSR_ON:0; 1052 1058 *lpModemStat |= (ucStatus & 0x40)? MS_RING_ON:0; 1053 //*lpModemStat |= (ucStatus & 0x80)? MS_RSLD_ON:0;1054 } 1055 1056 dprintf2(("HMDeviceCommClass::GetCommModemStatus -> % x rc=%d", *lpModemStat, rc));1059 *lpModemStat |= (ucStatus & 0x80)? MS_RLSD_ON:0; 1060 } 1061 1062 dprintf2(("HMDeviceCommClass::GetCommModemStatus -> %s %x rc=%d", DebugModemStatus(*lpModemStat), *lpModemStat, rc)); 1057 1063 return(rc==0); 1058 1064 } … … 1584 1590 } 1585 1591 } 1592 #ifdef DEBUG 1593 //****************************************************************************** 1594 //****************************************************************************** 1595 static char *DebugCommEvent(DWORD dwEvents) 1596 { 1597 static char szCommEvents[128]; 1598 1599 szCommEvents[0] = 0; 1600 1601 if(dwEvents & EV_RXCHAR) { 1602 strcat(szCommEvents, "EV_RXCHAR "); 1603 } 1604 if(dwEvents & EV_TXEMPTY) { 1605 strcat(szCommEvents, "EV_TXEMPTY "); 1606 } 1607 if(dwEvents & EV_CTS) { 1608 strcat(szCommEvents, "EV_CTS "); 1609 } 1610 if(dwEvents & EV_DSR) { 1611 strcat(szCommEvents, "EV_DSR "); 1612 } 1613 if(dwEvents & EV_RLSD) { 1614 strcat(szCommEvents, "EV_RLSD "); 1615 } 1616 if(dwEvents & EV_BREAK) { 1617 strcat(szCommEvents, "EV_BREAK "); 1618 } 1619 if(dwEvents & EV_ERR) { 1620 strcat(szCommEvents, "EV_ERR "); 1621 } 1622 if(dwEvents & EV_RING) { 1623 strcat(szCommEvents, "EV_RING "); 1624 } 1625 return szCommEvents; 1626 } 1627 //****************************************************************************** 1628 //****************************************************************************** 1629 static char *DebugModemStatus(DWORD dwModemStatus) 1630 { 1631 static char szModemStatus[128]; 1632 1633 szModemStatus[0] = 0; 1634 1635 if(dwModemStatus & MS_CTS_ON) { 1636 strcat(szModemStatus, "MS_CTS_ON "); 1637 } 1638 if(dwModemStatus & MS_DSR_ON) { 1639 strcat(szModemStatus, "MS_DSR_ON "); 1640 } 1641 if(dwModemStatus & MS_RING_ON) { 1642 strcat(szModemStatus, "MS_RING_ON "); 1643 } 1644 if(dwModemStatus & MS_RLSD_ON) { 1645 strcat(szModemStatus, "MS_RLSD_ON "); 1646 } 1647 return szModemStatus; 1648 } 1649 #endif 1586 1650 //****************************************************************************** 1587 1651 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.