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
28272aa6
Commit
28272aa6
authored
Jan 17, 2019
by
Matej Frančeškin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change synchronization object
parent
f90b91fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
TaiSync.java
android/src/org/mavlink/qgroundcontrol/TaiSync.java
+10
-8
No files found.
android/src/org/mavlink/qgroundcontrol/TaiSync.java
View file @
28272aa6
...
...
@@ -32,6 +32,7 @@ public class TaiSync
private
static
final
int
TAISYNC_SETTINGS_PORT
=
8200
;
private
static
final
int
TAISYNC_TELEMETRY_PORT
=
8400
;
private
Object
runLock
;
private
boolean
running
=
false
;
private
DatagramSocket
udpSocket
=
null
;
private
Socket
tcpSettingsSocket
=
null
;
...
...
@@ -49,12 +50,13 @@ public class TaiSync
public
TaiSync
()
{
runLock
=
new
Object
();
mThreadPool
=
Executors
.
newFixedThreadPool
(
3
);
}
public
boolean
isRunning
()
{
synchronized
(
this
)
{
synchronized
(
runLock
)
{
return
running
;
}
}
...
...
@@ -63,7 +65,7 @@ public class TaiSync
{
// Log.i("QGC_TaiSync", "Open");
synchronized
(
this
)
{
synchronized
(
runLock
)
{
if
(
running
)
{
return
;
}
...
...
@@ -100,7 +102,7 @@ public class TaiSync
try
{
while
(
bytesRead
>=
0
)
{
synchronized
(
this
)
{
synchronized
(
runLock
)
{
if
(!
running
)
{
break
;
}
...
...
@@ -161,7 +163,7 @@ public class TaiSync
try
{
while
(
true
)
{
synchronized
(
this
)
{
synchronized
(
runLock
)
{
if
(!
running
)
{
break
;
}
...
...
@@ -190,7 +192,7 @@ public class TaiSync
try
{
while
(
true
)
{
synchronized
(
this
)
{
synchronized
(
runLock
)
{
if
(!
running
)
{
break
;
}
...
...
@@ -209,7 +211,7 @@ public class TaiSync
}
}
});
}
}
private
void
sendTaiSyncMessage
(
byte
protocol
,
int
dataPort
,
byte
[]
data
,
int
dataLen
)
throws
IOException
{
...
...
@@ -239,7 +241,7 @@ public class TaiSync
System
.
arraycopy
(
data
,
0
,
buffer
,
header
.
length
,
dataLen
);
}
synchronized
(
this
)
{
synchronized
(
runLock
)
{
mFileOutputStream
.
write
(
buffer
);
}
}
...
...
@@ -247,7 +249,7 @@ public class TaiSync
public
void
close
()
{
// Log.i("QGC_TaiSync", "Close");
synchronized
(
this
)
{
synchronized
(
runLock
)
{
running
=
false
;
}
try
{
...
...
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