Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
6af9a170
Commit
6af9a170
authored
Apr 27, 2015
by
dogmaphobic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More Android work...
parent
db135056
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
148 additions
and
175 deletions
+148
-175
UsbDeviceJNI.java
android/src/org/qgroundcontrol/qgchelper/UsbDeviceJNI.java
+2
-2
qserialport_android.cpp
libs/qtandroidserialport/src/qserialport_android.cpp
+134
-171
qserialportinfo_android.cpp
libs/qtandroidserialport/src/qserialportinfo_android.cpp
+6
-0
QGCApplication.cc
src/QGCApplication.cc
+2
-0
QGCFileDialog.cc
src/QGCFileDialog.cc
+2
-2
MainWindow.cc
src/ui/MainWindow.cc
+2
-0
No files found.
android/src/org/qgroundcontrol/qgchelper/UsbDeviceJNI.java
View file @
6af9a170
...
...
@@ -60,6 +60,7 @@ public class UsbDeviceJNI extends QtActivity
// USED TO DETECT WHEN A DEVICE HAS BEEN UNPLUGGED
private
BroadcastReceiver
m_UsbReceiver
=
null
;
private
final
static
ExecutorService
m_Executor
=
Executors
.
newSingleThreadExecutor
();
private
static
final
String
TAG
=
"QGC_UsbDeviceJNI"
;
private
final
static
UsbIoManager
.
Listener
m_Listener
=
new
UsbIoManager
.
Listener
()
...
...
@@ -67,6 +68,7 @@ public class UsbDeviceJNI extends QtActivity
@Override
public
void
onRunError
(
Exception
eA
,
int
userDataA
)
{
Log
.
e
(
TAG
,
"onRunError Exception"
);
nativeDeviceException
(
userDataA
,
eA
.
getMessage
());
}
...
...
@@ -77,7 +79,6 @@ public class UsbDeviceJNI extends QtActivity
}
};
private
static
final
String
TAG
=
"QGC_UsbDeviceJNI"
;
// NATIVE C++ FUNCTION THAT WILL BE CALLED IF THE DEVICE IS UNPLUGGED
private
static
native
void
nativeDeviceHasDisconnected
(
int
userDataA
);
...
...
@@ -120,7 +121,6 @@ public class UsbDeviceJNI extends QtActivity
return
true
;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// List all available devices that are not already open. It returns the serial port info
...
...
libs/qtandroidserialport/src/qserialport_android.cpp
View file @
6af9a170
This diff is collapsed.
Click to expand it.
libs/qtandroidserialport/src/qserialportinfo_android.cpp
View file @
6af9a170
...
...
@@ -48,6 +48,8 @@ QT_BEGIN_NAMESPACE
static
const
char
V_jniClassName
[]
{
"org/qgroundcontrol/qgchelper/UsbDeviceJNI"
};
static
const
char
V_TAG
[]
{
"QGC_QSerialPortInfo"
};
extern
void
cleanJavaException
();
QList
<
QSerialPortInfo
>
availablePortsByFiltersOfDevices
(
bool
&
ok
)
{
QList
<
QSerialPortInfo
>
serialPortInfoList
;
...
...
@@ -117,22 +119,26 @@ QList<qint32> QSerialPortInfo::standardBaudRates()
bool
QSerialPortInfo
::
isBusy
()
const
{
QAndroidJniObject
jstrL
=
QAndroidJniObject
::
fromString
(
d_ptr
->
portName
);
cleanJavaException
();
jboolean
resultL
=
QAndroidJniObject
::
callStaticMethod
<
jboolean
>
(
V_jniClassName
,
"isDeviceNameOpen"
,
"(Ljava/lang/String;)Z"
,
jstrL
.
object
<
jstring
>
());
cleanJavaException
();
return
resultL
;
}
bool
QSerialPortInfo
::
isValid
()
const
{
QAndroidJniObject
jstrL
=
QAndroidJniObject
::
fromString
(
d_ptr
->
portName
);
cleanJavaException
();
jboolean
resultL
=
QAndroidJniObject
::
callStaticMethod
<
jboolean
>
(
V_jniClassName
,
"isDeviceNameValid"
,
"(Ljava/lang/String;)Z"
,
jstrL
.
object
<
jstring
>
());
cleanJavaException
();
return
resultL
;
}
...
...
src/QGCApplication.cc
View file @
6af9a170
...
...
@@ -104,7 +104,9 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting) :
_app
=
this
;
// This prevents usage of QQuickWidget to fail since it doesn't support native widget siblings
#ifndef __android__
setAttribute
(
Qt
::
AA_DontCreateNativeWidgetSiblings
);
#endif
#ifdef QT_DEBUG
// First thing we want to do is set up the qtlogging.ini file. If it doesn't already exist we copy
...
...
src/QGCFileDialog.cc
View file @
6af9a170
...
...
@@ -217,10 +217,10 @@ void QGCFileDialog::_validate(Options& options)
Q_ASSERT
(
qgcApp
());
Q_ASSERT_X
(
QThread
::
currentThread
()
==
qgcApp
()
->
thread
(),
"Threading issue"
,
"QGCFileDialog can only be called from main thread"
);
#ifndef __android__
// On OSX native dialog can hang so we always use Qt dialogs
options
|=
DontUseNativeDialog
;
#endif
if
(
MainWindow
::
instance
())
{
MainWindow
::
instance
()
->
hideSplashScreen
();
}
...
...
src/ui/MainWindow.cc
View file @
6af9a170
...
...
@@ -183,8 +183,10 @@ MainWindow::MainWindow(QSplashScreen* splashScreen)
// Qt 4 on Ubuntu does place the native menubar correctly so on Linux we revert back to in-window menu bar.
// TODO: Check that this is still necessary on Qt5 on Ubuntu
#ifdef Q_OS_LINUX
#ifndef __android__
menuBar
()
->
setNativeMenuBar
(
false
);
#endif
#endif
#ifdef UNITTEST_BUILD
QAction
*
qmlTestAction
=
new
QAction
(
"Test QML palette and controls"
,
NULL
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment