MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / Write_Command

Method Write_Command

libraries/AP_Logger/LogFile.cpp:274–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272#endif
273
274void AP_Logger::Write_Command(const mavlink_command_int_t &packet,
275 uint8_t source_system,
276 uint8_t source_component,
277 const MAV_RESULT result,
278 bool was_command_long)
279{
280 const struct log_MAVLink_Command pkt{
281 LOG_PACKET_HEADER_INIT(LOG_MAVLINK_COMMAND_MSG),
282 time_us : AP_HAL::micros64(),
283 target_system : packet.target_system,
284 target_component: packet.target_component,
285 source_system : source_system,
286 source_component: source_component,
287 frame : packet.frame,
288 command : packet.command,
289 param1 : packet.param1,
290 param2 : packet.param2,
291 param3 : packet.param3,
292 param4 : packet.param4,
293 x : packet.x,
294 y : packet.y,
295 z : packet.z,
296 result : (uint8_t)result,
297 was_command_long:was_command_long,
298 };
299 return WriteBlock(&pkt, sizeof(pkt));
300}
301
302bool AP_Logger_Backend::Write_Mission_Cmd(const AP_Mission &mission,
303 const AP_Mission::Mission_Command &cmd,

Callers 2

handle_command_longMethod · 0.80
handle_command_intMethod · 0.80

Calls 1

micros64Function · 0.50

Tested by

no test coverage detected