voxl-send-command exit status implementation request
-
Super super low priority but I noticed that voxl-send-command doesn't output a return code. Even on an error can look like a success since echo will return exit status 0. This is particularly frustrating when an error does actually occur.
Here is a fix below:
if [ -p "/run/mpa/${1}/control" ]; then _CONTROL_FILE="/run/mpa/${1}/control" shift echo "$@" >> "$_CONTROL_FILE" echo "Successfully sent command to ${_CONTROL_FILE}" exit 0 elif [ -p "${1}/control" ]; then _CONTROL_FILE="${1}/control" shift echo "$@" >> "$_CONTROL_FILE" echo "Successfully sent command to ${_CONTROL_FILE}" exit 0 else echo "Unable to find valid pipe that accepts control commands at: ${1}" exit 1 fiWould love to see an update here!
Also side note: Let me know if this is the proper channel so submit code issues like these.
-
Super super low priority but I noticed that voxl-send-command doesn't output a return code. Even on an error can look like a success since echo will return exit status 0. This is particularly frustrating when an error does actually occur.
Here is a fix below:
if [ -p "/run/mpa/${1}/control" ]; then _CONTROL_FILE="/run/mpa/${1}/control" shift echo "$@" >> "$_CONTROL_FILE" echo "Successfully sent command to ${_CONTROL_FILE}" exit 0 elif [ -p "${1}/control" ]; then _CONTROL_FILE="${1}/control" shift echo "$@" >> "$_CONTROL_FILE" echo "Successfully sent command to ${_CONTROL_FILE}" exit 0 else echo "Unable to find valid pipe that accepts control commands at: ${1}" exit 1 fiWould love to see an update here!
Also side note: Let me know if this is the proper channel so submit code issues like these.
@jameskuesel Feel free to make the change and submit a PR
-
@jameskuesel Feel free to make the change and submit a PR
Sorry my bad! Done!
-
Sorry my bad! Done!
@jameskuesel Thanks! Merged
Reading along? Create a free ModalAI Forum account to join in.
With an account you can reply, ask your own question, get an email when a ModalAI engineer answers, and mark the reply that solved it. Your place in each thread is saved between visits.
Questions about VOXL, Flight Core, ESCs and ModalAI drones are answered here by the engineers who build them.
Register Login