Browse Source

qshell: rename qshell sequence fields so they can be parsed on fastrtpsgen

sbg
TSC21 6 years ago committed by Nuno Marques
parent
commit
f6a5c7cca9
  1. 2
      msg/qshell_req.msg
  2. 2
      msg/qshell_retval.msg
  3. 4
      src/drivers/qshell/posix/qshell.cpp
  4. 2
      src/drivers/qshell/qurt/qshell.cpp

2
msg/qshell_req.msg

@ -2,4 +2,4 @@ uint64 timestamp # time since system start (microseconds) @@ -2,4 +2,4 @@ uint64 timestamp # time since system start (microseconds)
char[100] cmd
uint32 MAX_STRLEN = 100
uint32 strlen
uint32 sequence
uint32 request_sequence

2
msg/qshell_retval.msg

@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
uint64 timestamp # time since system start (microseconds)
int32 return_value
uint32 sequence
uint32 return_sequence

4
src/drivers/qshell/posix/qshell.cpp

@ -101,7 +101,7 @@ int QShell::_send_cmd(std::vector<std::string> &argList) @@ -101,7 +101,7 @@ int QShell::_send_cmd(std::vector<std::string> &argList)
qshell_req.strlen = cmd.size();
strcpy((char *)qshell_req.cmd, cmd.c_str());
qshell_req.sequence = _current_sequence;
qshell_req.request_sequence = _current_sequence;
int instance;
orb_publish_auto(ORB_ID(qshell_req), &_pub_qshell_req, &qshell_req, &instance, ORB_PRIO_DEFAULT);
@ -131,7 +131,7 @@ int QShell::_wait_for_retval() @@ -131,7 +131,7 @@ int QShell::_wait_for_retval()
struct qshell_retval_s retval;
orb_copy(ORB_ID(qshell_retval), _sub_qshell_retval, &retval);
if (retval.sequence != _current_sequence) {
if (retval.return_sequence != _current_sequence) {
PX4_WARN("Ignoring return value with wrong sequence");
} else {

2
src/drivers/qshell/qurt/qshell.cpp

@ -116,7 +116,7 @@ int QShell::main() @@ -116,7 +116,7 @@ int QShell::main()
struct qshell_retval_s retval;
retval.return_value = run_cmd(appargs);
retval.sequence = m_qshell_req.sequence;
retval.return_sequence = m_qshell_req.request_sequence;
if (retval.return_value) {
PX4_ERR("Failed to execute command: %s", m_qshell_req.cmd);

Loading…
Cancel
Save