Exemple #1
0
/*!
    \property QSerialPort::requestToSend
    \brief the state (high or low) of the line signal RTS

    If the setting is successful, returns true; otherwise returns false.
    If the flag is true then the RTS signal is set to high; otherwise low.

    \sa pinoutSignals()
*/
bool QSerialPort::setRequestToSend(bool set)
{
    Q_D(QSerialPort);

    bool retval = d->setRequestToSend(set);
    if (retval && (d->requestToSend != set)) {
        d->requestToSend = set;
        emit requestToSendChanged(set);
    }

    return retval;
}
/*!
    \property QSerialPort::requestToSend
    \brief the state (high or low) of the line signal RTS

    Returns true on success, false otherwise.
    If the flag is true then the RTS signal is set to high; otherwise low.

    \note The serial port has to be open before trying to set or get this
    property; otherwise false is returned and the error code is set to
    NotOpenError.

    \sa pinoutSignals()
*/
bool QSerialPort::setRequestToSend(bool set)
{
    Q_D(QSerialPort);

    if (!isOpen()) {
        setError(QSerialPort::NotOpenError);
        qWarning("%s: device not open", Q_FUNC_INFO);
        return false;
    }

    const bool requestToSend = isRequestToSend();
    const bool retval = d->setRequestToSend(set);
    if (retval && (requestToSend != set))
        emit requestToSendChanged(set);

    return retval;
}
Exemple #3
0
/*!
    \property QSerialPort::requestToSend
    \brief the state (high or low) of the line signal RTS

    Returns true on success, false otherwise.
    If the flag is true then the RTS signal is set to high; otherwise low.

    \note The serial port has to be open before trying to set or get this
    property; otherwise false is returned and the error code is set to
    NotOpenError.

    \sa pinoutSignals()
*/
bool QSerialPort::setRequestToSend(bool set)
{
    Q_D(QSerialPort);

    if (!isOpen()) {
        d->setError(QSerialPortErrorInfo(QSerialPort::NotOpenError));
        qWarning("%s: device not open", Q_FUNC_INFO);
        return false;
    }

    if (d->flowControl == QSerialPort::HardwareControl) {
        d->setError(QSerialPortErrorInfo(QSerialPort::UnsupportedOperationError));
        return false;
    }

    const bool requestToSend = isRequestToSend();
    const bool retval = d->setRequestToSend(set);
    if (retval && (requestToSend != set))
        emit requestToSendChanged(set);

    return retval;
}