forked from mavlink/qgroundcontrol
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
12 changed files
with
137 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
** Copyright (C) 2011 Sergey Belyashov <[email protected]> | ||
** Copyright (C) 2012 Laszlo Papp <[email protected]> | ||
** Copyright (C) 2012 Andre Hartmann <[email protected]> | ||
** Contact: http://www.qt-project.org/legal | ||
** Contact: http://www.qt.io/licensing/ | ||
** | ||
** This file is part of the QtSerialPort module of the Qt Toolkit. | ||
** | ||
|
@@ -13,9 +13,9 @@ | |
** Licensees holding valid commercial Qt licenses may use this file in | ||
** accordance with the commercial license agreement provided with the | ||
** Software or, alternatively, in accordance with the terms contained in | ||
** a written agreement between you and Digia. For licensing terms and | ||
** conditions see http://qt.digia.com/licensing. For further information | ||
** use the contact form at http://qt.digia.com/contact-us. | ||
** a written agreement between you and The Qt Company. For licensing terms | ||
** and conditions see http://www.qt.io/terms-conditions. For further | ||
** information use the contact form at http://www.qt.io/contact-us. | ||
** | ||
** GNU Lesser General Public License Usage | ||
** Alternatively, this file may be used under the terms of the GNU Lesser | ||
|
@@ -26,8 +26,8 @@ | |
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and | ||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | ||
** | ||
** In addition, as a special exception, Digia gives you certain additional | ||
** rights. These rights are described in the Digia Qt LGPL Exception | ||
** As a special exception, The Qt Company gives you certain additional | ||
** rights. These rights are described in The Qt Company LGPL Exception | ||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | ||
** | ||
** $QT_END_LICENSE$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
** | ||
** Copyright (C) 2012 Denis Shienkov <[email protected]> | ||
** Copyright (C) 2013 Laszlo Papp <[email protected]> | ||
** Contact: http://www.qt-project.org/legal | ||
** Contact: http://www.qt.io/licensing/ | ||
** | ||
** This file is part of the QtSerialPort module of the Qt Toolkit. | ||
** | ||
|
@@ -11,9 +11,9 @@ | |
** Licensees holding valid commercial Qt licenses may use this file in | ||
** accordance with the commercial license agreement provided with the | ||
** Software or, alternatively, in accordance with the terms contained in | ||
** a written agreement between you and Digia. For licensing terms and | ||
** conditions see http://qt.digia.com/licensing. For further information | ||
** use the contact form at http://qt.digia.com/contact-us. | ||
** a written agreement between you and The Qt Company. For licensing terms | ||
** and conditions see http://www.qt.io/terms-conditions. For further | ||
** information use the contact form at http://www.qt.io/contact-us. | ||
** | ||
** GNU Lesser General Public License Usage | ||
** Alternatively, this file may be used under the terms of the GNU Lesser | ||
|
@@ -24,8 +24,8 @@ | |
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and | ||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | ||
** | ||
** In addition, as a special exception, Digia gives you certain additional | ||
** rights. These rights are described in the Digia Qt LGPL Exception | ||
** As a special exception, The Qt Company gives you certain additional | ||
** rights. These rights are described in The Qt Company LGPL Exception | ||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | ||
** | ||
** $QT_END_LICENSE$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,40 +3,32 @@ | |
** Copyright (C) 2012 Denis Shienkov <[email protected]> | ||
** Copyright (C) 2012 Laszlo Papp <[email protected]> | ||
** Copyright (C) 2012 Andre Hartmann <[email protected]> | ||
** Contact: http://www.qt-project.org/legal | ||
** Contact: http://www.qt.io/licensing/ | ||
** | ||
** This file is part of the QtSerialPort module of the Qt Toolkit. | ||
** | ||
** $QT_BEGIN_LICENSE:LGPL$ | ||
** $QT_BEGIN_LICENSE:LGPL21$ | ||
** Commercial License Usage | ||
** Licensees holding valid commercial Qt licenses may use this file in | ||
** accordance with the commercial license agreement provided with the | ||
** Software or, alternatively, in accordance with the terms contained in | ||
** a written agreement between you and Digia. For licensing terms and | ||
** conditions see http://qt.digia.com/licensing. For further information | ||
** use the contact form at http://qt.digia.com/contact-us. | ||
** a written agreement between you and The Qt Company. For licensing terms | ||
** and conditions see http://www.qt.io/terms-conditions. For further | ||
** information use the contact form at http://www.qt.io/contact-us. | ||
** | ||
** GNU Lesser General Public License Usage | ||
** Alternatively, this file may be used under the terms of the GNU Lesser | ||
** General Public License version 2.1 as published by the Free Software | ||
** Foundation and appearing in the file LICENSE.LGPL included in the | ||
** packaging of this file. Please review the following information to | ||
** ensure the GNU Lesser General Public License version 2.1 requirements | ||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | ||
** General Public License version 2.1 or version 3 as published by the Free | ||
** Software Foundation and appearing in the file LICENSE.LGPLv21 and | ||
** LICENSE.LGPLv3 included in the packaging of this file. Please review the | ||
** following information to ensure the GNU Lesser General Public License | ||
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and | ||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | ||
** | ||
** In addition, as a special exception, Digia gives you certain additional | ||
** rights. These rights are described in the Digia Qt LGPL Exception | ||
** As a special exception, The Qt Company gives you certain additional | ||
** rights. These rights are described in The Qt Company LGPL Exception | ||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | ||
** | ||
** GNU General Public License Usage | ||
** Alternatively, this file may be used under the terms of the GNU | ||
** General Public License version 3.0 as published by the Free Software | ||
** Foundation and appearing in the file LICENSE.GPL included in the | ||
** packaging of this file. Please review the following information to | ||
** ensure the GNU General Public License version 3.0 requirements will be | ||
** met: http://www.gnu.org/copyleft/gpl.html. | ||
** | ||
** | ||
** $QT_END_LICENSE$ | ||
** | ||
****************************************************************************/ | ||
|
@@ -119,29 +111,6 @@ bool QSerialPortPrivate::open(QIODevice::OpenMode mode) | |
rwMode = mode; | ||
__android_log_print(ANDROID_LOG_INFO, V_TAG, "Opening %s", systemLocation.toLatin1().data()); | ||
|
||
QAndroidJniObject jnameL = QAndroidJniObject::fromString(systemLocation); | ||
deviceId = QAndroidJniObject::callStaticMethod<jint>( | ||
V_jniClassName, | ||
"open", | ||
"(Ljava/lang/String;I)I", | ||
jnameL.object<jstring>(), | ||
(jint)this); | ||
|
||
isReadStopped = false; | ||
|
||
if (deviceId == BAD_PORT) | ||
{ | ||
__android_log_print(ANDROID_LOG_ERROR, V_TAG, "Error opening %s", systemLocation.toLatin1().data()); | ||
q_ptr->setError(QSerialPort::DeviceNotFoundError); | ||
return false; | ||
} | ||
|
||
descriptor = QAndroidJniObject::callStaticMethod<jint>( | ||
V_jniClassName, | ||
"getDeviceHandle", | ||
"(I)I", | ||
deviceId); | ||
|
||
if (!hasRegisteredFunctions) | ||
{ | ||
// REGISTER THE C++ FUNCTION WITH JNI | ||
|
@@ -155,7 +124,7 @@ bool QSerialPortPrivate::open(QIODevice::OpenMode mode) | |
|
||
QAndroidJniObject javaClassL(V_jniClassName); | ||
jclass objectClassL = envL->GetObjectClass(javaClassL.object<jobject>()); | ||
jint valL = envL->RegisterNatives(objectClassL, methodsL, sizeof(methodsL) / sizeof(methodsL[0])); | ||
jint valL = envL->RegisterNatives(objectClassL, methodsL, sizeof(methodsL) / sizeof(JNINativeMethod)); | ||
envL->DeleteLocalRef(objectClassL); | ||
hasRegisteredFunctions = true; | ||
|
||
|
@@ -169,6 +138,29 @@ bool QSerialPortPrivate::open(QIODevice::OpenMode mode) | |
} | ||
} | ||
|
||
QAndroidJniObject jnameL = QAndroidJniObject::fromString(systemLocation); | ||
deviceId = QAndroidJniObject::callStaticMethod<jint>( | ||
V_jniClassName, | ||
"open", | ||
"(Ljava/lang/String;I)I", | ||
jnameL.object<jstring>(), | ||
(jint)this); | ||
|
||
isReadStopped = false; | ||
|
||
if (deviceId == BAD_PORT) | ||
{ | ||
__android_log_print(ANDROID_LOG_ERROR, V_TAG, "Error opening %s", systemLocation.toLatin1().data()); | ||
q_ptr->setError(QSerialPort::DeviceNotFoundError); | ||
return false; | ||
} | ||
|
||
descriptor = QAndroidJniObject::callStaticMethod<jint>( | ||
V_jniClassName, | ||
"getDeviceHandle", | ||
"(I)I", | ||
deviceId); | ||
|
||
if (rwMode == QIODevice::WriteOnly) | ||
stopReadThread(); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
** Copyright (C) 2011-2012 Denis Shienkov <[email protected]> | ||
** Copyright (C) 2011 Sergey Belyashov <[email protected]> | ||
** Copyright (C) 2012 Laszlo Papp <[email protected]> | ||
** Contact: http://www.qt-project.org/legal | ||
** Contact: http://www.qt.io/licensing/ | ||
** | ||
** This file is part of the QtSerialPort module of the Qt Toolkit. | ||
** | ||
|
@@ -12,9 +12,9 @@ | |
** Licensees holding valid commercial Qt licenses may use this file in | ||
** accordance with the commercial license agreement provided with the | ||
** Software or, alternatively, in accordance with the terms contained in | ||
** a written agreement between you and Digia. For licensing terms and | ||
** conditions see http://qt.digia.com/licensing. For further information | ||
** use the contact form at http://qt.digia.com/contact-us. | ||
** a written agreement between you and The Qt Company. For licensing terms | ||
** and conditions see http://www.qt.io/terms-conditions. For further | ||
** information use the contact form at http://www.qt.io/contact-us. | ||
** | ||
** GNU Lesser General Public License Usage | ||
** Alternatively, this file may be used under the terms of the GNU Lesser | ||
|
@@ -25,8 +25,8 @@ | |
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and | ||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | ||
** | ||
** In addition, as a special exception, Digia gives you certain additional | ||
** rights. These rights are described in the Digia Qt LGPL Exception | ||
** As a special exception, The Qt Company gives you certain additional | ||
** rights. These rights are described in The Qt Company LGPL Exception | ||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | ||
** | ||
** $QT_END_LICENSE$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
** Copyright (C) 2011-2012 Denis Shienkov <[email protected]> | ||
** Copyright (C) 2011 Sergey Belyashov <[email protected]> | ||
** Copyright (C) 2012 Laszlo Papp <[email protected]> | ||
** Contact: http://www.qt-project.org/legal | ||
** Contact: http://www.qt.io/licensing/ | ||
** | ||
** This file is part of the QtSerialPort module of the Qt Toolkit. | ||
** | ||
|
@@ -12,9 +12,9 @@ | |
** Licensees holding valid commercial Qt licenses may use this file in | ||
** accordance with the commercial license agreement provided with the | ||
** Software or, alternatively, in accordance with the terms contained in | ||
** a written agreement between you and Digia. For licensing terms and | ||
** conditions see http://qt.digia.com/licensing. For further information | ||
** use the contact form at http://qt.digia.com/contact-us. | ||
** a written agreement between you and The Qt Company. For licensing terms | ||
** and conditions see http://www.qt.io/terms-conditions. For further | ||
** information use the contact form at http://www.qt.io/contact-us. | ||
** | ||
** GNU Lesser General Public License Usage | ||
** Alternatively, this file may be used under the terms of the GNU Lesser | ||
|
@@ -25,8 +25,8 @@ | |
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and | ||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | ||
** | ||
** In addition, as a special exception, Digia gives you certain additional | ||
** rights. These rights are described in the Digia Qt LGPL Exception | ||
** As a special exception, The Qt Company gives you certain additional | ||
** rights. These rights are described in The Qt Company LGPL Exception | ||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | ||
** | ||
** $QT_END_LICENSE$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
** | ||
** Copyright (C) 2012 Denis Shienkov <[email protected]> | ||
** Copyright (C) 2012 Laszlo Papp <[email protected]> | ||
** Contact: http://www.qt-project.org/legal | ||
** Contact: http://www.qt.io/licensing/ | ||
** | ||
** This file is part of the QtSerialPort module of the Qt Toolkit. | ||
** | ||
|
@@ -11,9 +11,9 @@ | |
** Licensees holding valid commercial Qt licenses may use this file in | ||
** accordance with the commercial license agreement provided with the | ||
** Software or, alternatively, in accordance with the terms contained in | ||
** a written agreement between you and Digia. For licensing terms and | ||
** conditions see http://qt.digia.com/licensing. For further information | ||
** use the contact form at http://qt.digia.com/contact-us. | ||
** a written agreement between you and The Qt Company. For licensing terms | ||
** and conditions see http://www.qt.io/terms-conditions. For further | ||
** information use the contact form at http://www.qt.io/contact-us. | ||
** | ||
** GNU Lesser General Public License Usage | ||
** Alternatively, this file may be used under the terms of the GNU Lesser | ||
|
@@ -24,8 +24,8 @@ | |
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and | ||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | ||
** | ||
** In addition, as a special exception, Digia gives you certain additional | ||
** rights. These rights are described in the Digia Qt LGPL Exception | ||
** As a special exception, The Qt Company gives you certain additional | ||
** rights. These rights are described in The Qt Company LGPL Exception | ||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | ||
** | ||
** $QT_END_LICENSE$ | ||
|
Oops, something went wrong.