Ignore:
Timestamp:
Aug 21, 2002, 7:23:12 PM (23 years ago)
Author:
sandervl
Message:

EV_RLSD/MS_RLSD_ON status corresponds to OS/2 DCD (data carrier detect) status GetCommModemStatus & GetCommEvent changed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/hmcomm.cpp

    r8844 r9079  
    1 /* $Id: hmcomm.cpp,v 1.37 2002-07-06 09:57:31 sandervl Exp $ */
     1/* $Id: hmcomm.cpp,v 1.38 2002-08-21 17:23:12 sandervl Exp $ */
    22
    33/*
     
    6161static DWORD CommWriteIOHandler(LPASYNCIOREQUEST lpRequest, DWORD *lpdwResult, DWORD *lpdwTimeOut);
    6262static DWORD CommPollIOHandler(LPASYNCIOREQUEST lpRequest, DWORD *lpdwResult, DWORD *lpdwTimeOut);
    63 
     63#ifdef DEBUG
     64static char *DebugCommEvent(DWORD dwEvents);
     65static char *DebugModemStatus(DWORD dwModemStatus);
     66#endif
    6467//******************************************************************************
    6568//******************************************************************************
     
    416419    if(!rc)
    417420    {
     421#ifdef DEBUG
     422        if(COMEvt) dprintf(("ASYNC_GETCOMMEVENT %x", COMEvt));
     423#endif
    418424        dwEvent |= (COMEvt&0x0001)? EV_RXCHAR:0;
    419425        //dwEvent |= (COMEvt&0x0002)? 0:0;
     
    421427        dwEvent |= (COMEvt&0x0008)? EV_CTS:0;
    422428        dwEvent |= (COMEvt&0x0010)? EV_DSR:0;
    423         //dwEvent |= (COMEvt&0x0020)? 0:0; DCS = RLSD?
     429        dwEvent |= (COMEvt&0x0020)? EV_RLSD:0;
    424430        dwEvent |= (COMEvt&0x0040)? EV_BREAK:0;
    425431        dwEvent |= (COMEvt&0x0080)? EV_ERR:0;
     
    442448        }
    443449        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)));
    445451            *lpdwResult = (dwEvent & dwMask);
    446452            return ERROR_SUCCESS;
     
    689695            dwEvent |= (COMEvt&0x0008)? EV_CTS:0;
    690696            dwEvent |= (COMEvt&0x0010)? EV_DSR:0;
    691             //dwEvent |= (COMEvt&0x0020)? 0:0; DCS = RLSD?
     697            dwEvent |= (COMEvt&0x0020)? EV_RLSD:0;
    692698            dwEvent |= (COMEvt&0x0040)? EV_BREAK:0;
    693699            dwEvent |= (COMEvt&0x0080)? EV_ERR:0;
     
    701707    if(dwMask == pDevData->dwEventMask) {
    702708        *lpfdwEvtMask = (rc==0) ? (dwEvent & dwMask) : 0;
    703         dprintf(("WaitCommEvent returned %x", *lpfdwEvtMask));
     709        dprintf(("WaitCommEvent returned %s %x", DebugCommEvent(*lpfdwEvtMask), *lpfdwEvtMask));
    704710    }
    705711    else  *lpfdwEvtMask = 0;
     
    834840  dprintf(("HMDeviceCommClass::SetCommMask %x", fdwEvtMask));
    835841
    836   if(fdwEvtMask & (EV_RLSD|EV_RXFLAG)) {
    837       dprintf(("!WARNING! SetCommMask: unsupported flags EV_RLSD and/or EV_RXFLAG!!"));
    838   }
    839 
    840   pDevData->dwEventMask = fdwEvtMask & ~(EV_RLSD|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.
    841847  return(TRUE);
    842848}
     
    10511057    *lpModemStat |= (ucStatus & 0x20)? MS_DSR_ON:0;
    10521058    *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));
    10571063  return(rc==0);
    10581064}
     
    15841590    }
    15851591}
     1592#ifdef DEBUG
     1593//******************************************************************************
     1594//******************************************************************************
     1595static 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//******************************************************************************
     1629static 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
    15861650//******************************************************************************
    15871651//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.