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
7059d63e
Commit
7059d63e
authored
Dec 18, 2018
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Telemetry on iOS.
parent
352c53b1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
4 deletions
+49
-4
TaisyncHandler.h
src/Taisync/TaisyncHandler.h
+5
-4
TaisyncManager.cc
src/Taisync/TaisyncManager.cc
+39
-0
TaisyncManager.h
src/Taisync/TaisyncManager.h
+5
-0
No files found.
src/Taisync/TaisyncHandler.h
View file @
7059d63e
...
...
@@ -15,10 +15,11 @@
#include <QTcpSocket>
#if defined(__ios__) || defined(__android__)
#define TAISYNC_VIDEO_UDP_PORT 5600
#define TAISYNC_VIDEO_TCP_PORT 8000
#define TAISYNC_SETTINGS_PORT 8200
#define TAISYNC_TELEM_PORT 8400
#define TAISYNC_VIDEO_UDP_PORT 5600
#define TAISYNC_VIDEO_TCP_PORT 8000
#define TAISYNC_SETTINGS_PORT 8200
#define TAISYNC_TELEM_PORT 8400
#define TAISYNC_TELEM_TARGET_PORT 14550
#else
#define TAISYNC_SETTINGS_PORT 80
#define TAISYNC_SETTINGS_TARGET "192.168.1.99"
...
...
src/Taisync/TaisyncManager.cc
View file @
7059d63e
...
...
@@ -35,6 +35,11 @@ TaisyncManager::~TaisyncManager()
_taiTelemetery
->
deleteLater
();
_taiTelemetery
=
nullptr
;
}
if
(
_telemetrySocket
)
{
_telemetrySocket
->
close
();
_telemetrySocket
->
deleteLater
();
_telemetrySocket
=
nullptr
;
}
if
(
_taiVideo
)
{
_taiVideo
->
close
();
_taiVideo
->
deleteLater
();
...
...
@@ -69,6 +74,11 @@ TaisyncManager::_setEnabled()
#if defined(__ios__) || defined(__android__)
_taiTelemetery
=
new
TaisyncTelemetry
(
this
);
QObject
::
connect
(
_taiTelemetery
,
&
TaisyncTelemetry
::
bytesReady
,
this
,
&
TaisyncManager
::
_readTelemBytes
);
_telemetrySocket
=
new
QUdpSocket
(
this
);
_telemetrySocket
->
setSocketOption
(
QAbstractSocket
::
SendBufferSizeSocketOption
,
64
*
1024
);
_telemetrySocket
->
setSocketOption
(
QAbstractSocket
::
ReceiveBufferSizeSocketOption
,
64
*
1024
);
QObject
::
connect
(
_telemetrySocket
,
&
QUdpSocket
::
readyRead
,
this
,
&
TaisyncManager
::
_readUDPBytes
);
_telemetrySocket
->
bind
(
QHostAddress
::
LocalHost
,
0
,
QUdpSocket
::
ShareAddress
);
#endif
_workTimer
.
start
(
1000
);
}
else
{
...
...
@@ -130,6 +140,35 @@ TaisyncManager::_setVideoEnabled()
_enableVideo
=
enable
;
}
//-----------------------------------------------------------------------------
#if defined(__ios__) || defined(__android__)
void
TaisyncManager
::
_readTelemBytes
(
QByteArray
bytesIn
)
{
//-- Send telemetry from vehicle to QGC (using normal UDP)
_telemetrySocket
->
writeDatagram
(
bytesIn
,
QHostAddress
::
LocalHost
,
TAISYNC_TELEM_TARGET_PORT
);
}
#endif
//-----------------------------------------------------------------------------
#if defined(__ios__) || defined(__android__)
void
TaisyncManager
::
_readUDPBytes
()
{
if
(
!
_telemetrySocket
||
!
_taiTelemetery
)
{
return
;
}
//-- Read UDP data from QGC
while
(
_telemetrySocket
->
hasPendingDatagrams
())
{
QByteArray
datagram
;
datagram
.
resize
(
static_cast
<
int
>
(
_telemetrySocket
->
pendingDatagramSize
()));
_telemetrySocket
->
readDatagram
(
datagram
.
data
(),
datagram
.
size
());
//-- Send it to vehicle
_taiTelemetery
->
writeBytes
(
datagram
);
}
}
#endif
//-----------------------------------------------------------------------------
void
TaisyncManager
::
_connected
()
...
...
src/Taisync/TaisyncManager.h
View file @
7059d63e
...
...
@@ -59,6 +59,10 @@ private slots:
void
_updateSettings
(
QByteArray
jSonData
);
void
_setEnabled
();
void
_setVideoEnabled
();
#if defined(__ios__) || defined(__android__)
void
_readUDPBytes
();
void
_readTelemBytes
(
QByteArray
bytesIn
);
#endif
private:
...
...
@@ -78,6 +82,7 @@ private:
#if defined(__ios__) || defined(__android__)
TaisyncTelemetry
*
_taiTelemetery
=
nullptr
;
TaisyncVideoReceiver
*
_taiVideo
=
nullptr
;
QUdpSocket
*
_telemetrySocket
=
nullptr
;
#endif
bool
_enableVideo
=
true
;
bool
_enabled
=
true
;
...
...
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