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
f69b38e4
Commit
f69b38e4
authored
Oct 03, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert to pack/encode_chan apis
parent
e7979fd9
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
198 additions
and
171 deletions
+198
-171
APMFirmwarePlugin.cc
src/FirmwarePlugin/APM/APMFirmwarePlugin.cc
+6
-6
APMFirmwarePlugin.h
src/FirmwarePlugin/APM/APMFirmwarePlugin.h
+3
-3
MockLink.cc
src/comm/MockLink.cc
+151
-135
MockLinkFileServer.cc
src/comm/MockLinkFileServer.cc
+8
-7
MockLinkMissionItemHandler.cc
src/comm/MockLinkMissionItemHandler.cc
+30
-20
No files found.
src/FirmwarePlugin/APM/APMFirmwarePlugin.cc
View file @
f69b38e4
...
...
@@ -211,7 +211,7 @@ int APMFirmwarePlugin::manualControlReservedButtonCount(void)
return
-
1
;
}
void
APMFirmwarePlugin
::
_handleParamValue
(
Vehicle
*
vehicle
,
mavlink_message_t
*
message
)
void
APMFirmwarePlugin
::
_handle
Incoming
ParamValue
(
Vehicle
*
vehicle
,
mavlink_message_t
*
message
)
{
Q_UNUSED
(
vehicle
);
...
...
@@ -301,7 +301,7 @@ void APMFirmwarePlugin::_handleOutgoingParamSet(Vehicle* vehicle, LinkInterface*
mavlink_msg_param_set_encode_chan
(
message
->
sysid
,
message
->
compid
,
outgoingLink
->
mavlinkChannel
(),
message
,
&
paramSet
);
}
bool
APMFirmwarePlugin
::
_handleStatusText
(
Vehicle
*
vehicle
,
mavlink_message_t
*
message
)
bool
APMFirmwarePlugin
::
_handle
Incoming
StatusText
(
Vehicle
*
vehicle
,
mavlink_message_t
*
message
)
{
QString
messageText
;
...
...
@@ -410,7 +410,7 @@ bool APMFirmwarePlugin::_handleStatusText(Vehicle* vehicle, mavlink_message_t* m
return
true
;
}
void
APMFirmwarePlugin
::
_handleHeartbeat
(
Vehicle
*
vehicle
,
mavlink_message_t
*
message
)
void
APMFirmwarePlugin
::
_handle
Incoming
Heartbeat
(
Vehicle
*
vehicle
,
mavlink_message_t
*
message
)
{
bool
flying
=
false
;
...
...
@@ -439,12 +439,12 @@ bool APMFirmwarePlugin::adjustIncomingMavlinkMessage(Vehicle* vehicle, mavlink_m
switch
(
message
->
msgid
)
{
case
MAVLINK_MSG_ID_PARAM_VALUE
:
_handleParamValue
(
vehicle
,
message
);
_handle
Incoming
ParamValue
(
vehicle
,
message
);
break
;
case
MAVLINK_MSG_ID_STATUSTEXT
:
return
_handleStatusText
(
vehicle
,
message
);
return
_handle
Incoming
StatusText
(
vehicle
,
message
);
case
MAVLINK_MSG_ID_HEARTBEAT
:
_handleHeartbeat
(
vehicle
,
message
);
_handle
Incoming
Heartbeat
(
vehicle
,
message
);
break
;
}
...
...
src/FirmwarePlugin/APM/APMFirmwarePlugin.h
View file @
f69b38e4
...
...
@@ -114,10 +114,10 @@ private:
static
bool
_isTextSeverityAdjustmentNeeded
(
const
APMFirmwareVersion
&
firmwareVersion
);
void
_setInfoSeverity
(
mavlink_message_t
*
message
)
const
;
QString
_getMessageText
(
mavlink_message_t
*
message
)
const
;
void
_handleParamValue
(
Vehicle
*
vehicle
,
mavlink_message_t
*
message
);
void
_handleIncomingParamValue
(
Vehicle
*
vehicle
,
mavlink_message_t
*
message
);
bool
_handleIncomingStatusText
(
Vehicle
*
vehicle
,
mavlink_message_t
*
message
);
void
_handleIncomingHeartbeat
(
Vehicle
*
vehicle
,
mavlink_message_t
*
message
);
void
_handleOutgoingParamSet
(
Vehicle
*
vehicle
,
LinkInterface
*
outgoingLink
,
mavlink_message_t
*
message
);
bool
_handleStatusText
(
Vehicle
*
vehicle
,
mavlink_message_t
*
message
);
void
_handleHeartbeat
(
Vehicle
*
vehicle
,
mavlink_message_t
*
message
);
void
_soloVideoHandshake
(
Vehicle
*
vehicle
);
bool
_textSeverityAdjustmentNeeded
;
...
...
src/comm/MockLink.cc
View file @
f69b38e4
This diff is collapsed.
Click to expand it.
src/comm/MockLinkFileServer.cc
View file @
f69b38e4
...
...
@@ -365,13 +365,14 @@ void MockLinkFileServer::_sendResponse(uint8_t targetSystemId, uint8_t targetCom
request
->
hdr
.
seqNumber
=
seqNumber
;
mavlink_msg_file_transfer_protocol_pack
(
_systemIdServer
,
// System ID
0
,
// Component ID
&
mavlinkMessage
,
// Mavlink Message to pack into
0
,
// Target network
targetSystemId
,
targetComponentId
,
(
uint8_t
*
)
request
);
// Payload
mavlink_msg_file_transfer_protocol_pack_chan
(
_systemIdServer
,
// System ID
0
,
// Component ID
_mockLink
->
mavlinkChannel
(),
&
mavlinkMessage
,
// Mavlink Message to pack into
0
,
// Target network
targetSystemId
,
targetComponentId
,
(
uint8_t
*
)
request
);
// Payload
_mockLink
->
respondWithMavlinkMessage
(
mavlinkMessage
);
}
...
...
src/comm/MockLinkMissionItemHandler.cc
View file @
f69b38e4
...
...
@@ -96,12 +96,13 @@ void MockLinkMissionItemHandler::_handleMissionRequestList(const mavlink_message
mavlink_message_t
responseMsg
;
mavlink_msg_mission_count_pack
(
_mockLink
->
vehicleId
(),
MAV_COMP_ID_MISSIONPLANNER
,
&
responseMsg
,
// Outgoing message
msg
.
sysid
,
// Target is original sender
msg
.
compid
,
// Target is original sender
itemCount
);
// Number of mission items
mavlink_msg_mission_count_pack_chan
(
_mockLink
->
vehicleId
(),
MAV_COMP_ID_MISSIONPLANNER
,
_mockLink
->
mavlinkChannel
(),
&
responseMsg
,
// Outgoing message
msg
.
sysid
,
// Target is original sender
msg
.
compid
,
// Target is original sender
itemCount
);
// Number of mission items
_mockLink
->
respondWithMavlinkMessage
(
responseMsg
);
}
else
{
qCDebug
(
MockLinkMissionItemHandlerLog
)
<<
"_handleMissionRequestList not responding due to failure mode"
;
...
...
@@ -149,18 +150,19 @@ void MockLinkMissionItemHandler::_handleMissionRequest(const mavlink_message_t&
item
=
_missionItems
[
request
.
seq
];
}
mavlink_msg_mission_item_pack
(
_mockLink
->
vehicleId
(),
MAV_COMP_ID_MISSIONPLANNER
,
&
responseMsg
,
// Outgoing message
msg
.
sysid
,
// Target is original sender
msg
.
compid
,
// Target is original sender
request
.
seq
,
// Index of mission item being sent
item
.
frame
,
item
.
command
,
item
.
current
,
item
.
autocontinue
,
item
.
param1
,
item
.
param2
,
item
.
param3
,
item
.
param4
,
item
.
x
,
item
.
y
,
item
.
z
);
mavlink_msg_mission_item_pack_chan
(
_mockLink
->
vehicleId
(),
MAV_COMP_ID_MISSIONPLANNER
,
_mockLink
->
mavlinkChannel
(),
&
responseMsg
,
// Outgoing message
msg
.
sysid
,
// Target is original sender
msg
.
compid
,
// Target is original sender
request
.
seq
,
// Index of mission item being sent
item
.
frame
,
item
.
command
,
item
.
current
,
item
.
autocontinue
,
item
.
param1
,
item
.
param2
,
item
.
param3
,
item
.
param4
,
item
.
x
,
item
.
y
,
item
.
z
);
_mockLink
->
respondWithMavlinkMessage
(
responseMsg
);
}
}
...
...
@@ -218,7 +220,11 @@ void MockLinkMissionItemHandler::_requestNextMissionItem(int sequenceNumber)
missionRequest
.
target_component
=
_mavlinkProtocol
->
getComponentId
();
missionRequest
.
seq
=
sequenceNumber
;
mavlink_msg_mission_request_encode
(
_mockLink
->
vehicleId
(),
MAV_COMP_ID_MISSIONPLANNER
,
&
message
,
&
missionRequest
);
mavlink_msg_mission_request_encode_chan
(
_mockLink
->
vehicleId
(),
MAV_COMP_ID_MISSIONPLANNER
,
_mockLink
->
mavlinkChannel
(),
&
message
,
&
missionRequest
);
_mockLink
->
respondWithMavlinkMessage
(
message
);
// If response with Mission Item doesn't come before timer fires it's an error
...
...
@@ -238,7 +244,11 @@ void MockLinkMissionItemHandler::_sendAck(MAV_MISSION_RESULT ackType)
missionAck
.
target_component
=
_mavlinkProtocol
->
getComponentId
();
missionAck
.
type
=
ackType
;
mavlink_msg_mission_ack_encode
(
_mockLink
->
vehicleId
(),
MAV_COMP_ID_MISSIONPLANNER
,
&
message
,
&
missionAck
);
mavlink_msg_mission_ack_encode_chan
(
_mockLink
->
vehicleId
(),
MAV_COMP_ID_MISSIONPLANNER
,
_mockLink
->
mavlinkChannel
(),
&
message
,
&
missionAck
);
_mockLink
->
respondWithMavlinkMessage
(
message
);
}
...
...
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