VirtualBox

Changeset 6087 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Dec 15, 2007 5:02:19 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
26786
Message:

Change Char interface according to the comments int hte header

Location:
trunk/src/VBox/Devices/Serial
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Serial/DevSerial.cpp

    r6073 r6087  
    421421}
    422422
    423 static DECLCALLBACK(int) serialNotifyStatusLinesChanged(PPDMICHARPORT pInterface, PDMICHARSTATUSLINES newStatusLines)
     423static DECLCALLBACK(int) serialNotifyStatusLinesChanged(PPDMICHARPORT pInterface, uint32_t newStatusLines)
    424424{
    425425    SerialState *pData = PDMICHARPORT_2_SERIALSTATE(pInterface);
  • trunk/src/VBox/Devices/Serial/DrvChar.cpp

    r6027 r6087  
    271271 * @returns VBox status code
    272272 * @param pInterface        Pointer to the interface structure.
    273  * @param RequestToSend     Set to 1 if this control line should be made active.
    274  * @param DataTerminalReady Set to 1 if this control line should be made active.
    275  */
    276 static DECLCALLBACK(int) drvCharSetModemLines(PPDMICHAR pInterface, unsigned RequestToSend, unsigned DataTerminalReady)
     273 * @param RequestToSend     Set to true if this control line should be made active.
     274 * @param DataTerminalReady Set to true if this control line should be made active.
     275 */
     276static DECLCALLBACK(int) drvCharSetModemLines(PPDMICHAR pInterface, bool RequestToSend, bool DataTerminalReady)
    277277{
    278278    /* Nothing to do here. */
  • trunk/src/VBox/Devices/Serial/DrvHostSerial.cpp

    r6016 r6087  
    5151 */
    5252#ifndef TIOCM_LOOP
    53 # define TIOCM_LOOP     0x8000
     53# define TIOCM_LOOP 0x8000
    5454#endif
    5555
     
    690690#endif
    691691
     692    if (pThread->enmState == PDMTHREADSTATE_INITIALIZING)
     693        return VINF_SUCCESS;
     694
    692695    while (pThread->enmState == PDMTHREADSTATE_RUNNING)
    693696    {
    694         PDMICHARSTATUSLINES newStatusLine = 0;
     697        uint32_t newStatusLine = 0;
    695698
    696699#if defined(RT_OS_LINUX)
     
    769772 * @returns VBox status code
    770773 * @param pInterface        Pointer to the interface structure.
    771  * @param RequestToSend     Set to 1 if this control line should be made active.
    772  * @param DataTerminalReady Set to 1 if this control line should be made active.
    773  */
    774 static DECLCALLBACK(int) drvHostSerialSetModemLines(PPDMICHAR pInterface, unsigned RequestToSend, unsigned DataTerminalReady)
    775 {
     774 * @param RequestToSend     Set to true if this control line should be made active.
     775 * @param DataTerminalReady Set to true if this control line should be made active.
     776 */
     777static DECLCALLBACK(int) drvHostSerialSetModemLines(PPDMICHAR pInterface, bool RequestToSend, bool DataTerminalReady)
     778{
     779    PDRVHOSTSERIAL pData = PDMICHAR_2_DRVHOSTSERIAL(pInterface);
     780
    776781#ifdef RT_OS_LINUX
    777     PDRVHOSTSERIAL pData = PDMICHAR_2_DRVHOSTSERIAL(pInterface);
    778     int modemState = 0;
     782    int modemStateSet = 0;
     783    int modemStateClear = 0;
    779784
    780785    if (RequestToSend)
    781     {
    782         modemState |= TIOCM_RTS;
    783     }
     786        modemStateSet |= TIOCM_RTS;
     787    else
     788        modemStateClear |= TIOCM_RTS;
    784789
    785790    if (DataTerminalReady)
    786     {
    787         modemState |= TIOCM_DTR;
    788     }
    789 
    790     ioctl(pData->DeviceFile, TIOCMBIS, &modemState);
     791        modemStateSet |= TIOCM_DTR;
     792    else
     793        modemStateClear |= TIOCM_DTR;
     794
     795    if (modemStateSet)
     796        ioctl(pData->DeviceFile, TIOCMBIS, &modemStateSet);
     797
     798    if (modemStateClear)
     799        ioctl(pData->DeviceFile, TIOCMBIC, &modemStateClear);
     800#elif defined(RT_OS_WINDOWS)
     801    if (RequestToSend)
     802        EscapeCommFunction(pData->hDeviceFile, SETRTS);
     803    else
     804        EscapeCommFunction(pData->hDeviceFIle, CLRRTS);
     805
     806    if (DataTerminalReady)
     807        EscapeCommFunction(pData->hDeviceFile, SETDTR);
     808    else
     809        EscapeCommFunction(pData->hDeviceFIle, CLRDTR);
    791810#endif
    792811
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette