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
9c47ceb4
Commit
9c47ceb4
authored
May 21, 2019
by
Matej Frančeškin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix: AGS crashes when Taisync is attached for the first time
parent
4d55d0c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
9 deletions
+5
-9
QGCActivity.java
android/src/org/mavlink/qgroundcontrol/QGCActivity.java
+2
-6
TaiSync.java
android/src/org/mavlink/qgroundcontrol/TaiSync.java
+3
-3
No files found.
android/src/org/mavlink/qgroundcontrol/QGCActivity.java
View file @
9c47ceb4
...
...
@@ -72,7 +72,6 @@ public class QGCActivity extends QtActivity
private
static
HashMap
<
Integer
,
Integer
>
_userDataHashByDeviceId
;
private
static
final
String
TAG
=
"QGC_QGCActivity"
;
private
static
PowerManager
.
WakeLock
_wakeLock
;
// private static final String ACTION_USB_PERMISSION = "com.android.example.USB_PERMISSION";
private
static
final
String
ACTION_USB_PERMISSION
=
"org.mavlink.qgroundcontrol.action.USB_PERMISSION"
;
private
static
PendingIntent
_usbPermissionIntent
=
null
;
private
TaiSync
taiSync
=
null
;
...
...
@@ -110,7 +109,7 @@ public class QGCActivity extends QtActivity
if
(
accessory
!=
null
&&
intent
.
getBooleanExtra
(
UsbManager
.
EXTRA_PERMISSION_GRANTED
,
false
))
{
openAccessory
(
accessory
);
}
}
else
if
(
UsbManager
.
ACTION_USB_ACCESSORY_DETACHED
.
equals
(
action
))
{
}
else
if
(
UsbManager
.
ACTION_USB_ACCESSORY_DETACHED
.
equals
(
action
))
{
UsbAccessory
accessory
=
intent
.
getParcelableExtra
(
UsbManager
.
EXTRA_ACCESSORY
);
if
(
accessory
!=
null
)
{
closeAccessory
(
accessory
);
...
...
@@ -726,7 +725,7 @@ public class QGCActivity extends QtActivity
new
Thread
(
new
Runnable
()
{
public
void
run
()
{
synchronized
(
openAccessoryLock
)
{
Log
.
i
(
TAG
,
"probeAccessories"
);
//
Log.i(TAG, "probeAccessories");
UsbAccessory
[]
accessories
=
_usbManager
.
getAccessoryList
();
if
(
accessories
!=
null
)
{
for
(
UsbAccessory
usbAccessory
:
accessories
)
{
...
...
@@ -735,9 +734,6 @@ public class QGCActivity extends QtActivity
}
if
(
_usbManager
.
hasPermission
(
usbAccessory
))
{
openAccessory
(
usbAccessory
);
}
else
{
Log
.
i
(
TAG
,
"requestPermission"
);
_usbManager
.
requestPermission
(
usbAccessory
,
pendingIntent
);
}
}
}
...
...
android/src/org/mavlink/qgroundcontrol/TaiSync.java
View file @
9c47ceb4
...
...
@@ -115,13 +115,13 @@ public class TaiSync
if
(
mBytes
[
3
]
==
PROTOCOL_VERSION
)
{
vMaj
=
mBytes
[
19
];
Log
.
i
(
"QGC_TaiSync"
,
"Got protocol version message vMaj = "
+
mBytes
[
19
]);
//
Log.i("QGC_TaiSync", "Got protocol version message vMaj = " + mBytes[19]);
sendTaiSyncMessage
(
PROTOCOL_VERSION
,
0
,
null
,
0
);
}
else
if
(
mBytes
[
3
]
==
PROTOCOL_CHANNEL
)
{
int
dPort
=
((
mBytes
[
4
]
&
0xff
)<<
24
)
|
((
mBytes
[
5
]&
0xff
)
<<
16
)
|
((
mBytes
[
6
]&
0xff
)
<<
8
)
|
(
mBytes
[
7
]
&
0xff
);
int
dLength
=
((
mBytes
[
8
]
&
0xff
)<<
24
)
|
((
mBytes
[
9
]&
0xff
)
<<
16
)
|
((
mBytes
[
10
]&
0xff
)
<<
8
)
|
(
mBytes
[
11
]
&
0xff
);
Log
.
i
(
"QGC_TaiSync"
,
"Read 2 port = "
+
dPort
+
" length = "
+
dLength
);
//
Log.i("QGC_TaiSync", "Read 2 port = " + dPort + " length = " + dLength);
sendTaiSyncMessage
(
PROTOCOL_CHANNEL
,
dPort
,
null
,
0
);
}
else
if
(
mBytes
[
3
]
==
PROTOCOL_DATA
)
{
...
...
@@ -220,7 +220,7 @@ public class TaiSync
byte
[]
lA
=
new
byte
[
4
];
int
len
=
HEADER_SIZE
+
dataLen
;
Log
.
i
(
"QGC_TaiSync"
,
"Sending to "
+
dataPort
+
" length = "
+
len
);
//
Log.i("QGC_TaiSync", "Sending to " + dataPort + " length = " + len);
byte
[]
buffer
=
new
byte
[
len
];
for
(
int
i
=
3
;
i
>=
0
;
i
--)
{
...
...
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