Skip to content
Snippets Groups Projects
  1. Nov 28, 2018
  2. Nov 26, 2018
  3. Nov 24, 2018
    • Mara Bos's avatar
      3c660acc
    • Mara Bos's avatar
      Add dynamic modules on Posix. · d13836eb
      Mara Bos authored
      You can now add `DYNAMIC` as an option to `px4_add_module`, which will
      cause that module to no longer be compiled into the px4 executable, but
      instead produce a separate shared library file, which can be loaded and
      executed with the new `dyn` command:
      
          pxh> dyn ./hello.px4mod start
      
      This will load the shared object file `hello.px4mod` if it wasn't
      already loaded, and execute its main function with the given arguments.
      d13836eb
  4. Nov 23, 2018
    • Mara Bos's avatar
      Always use FILE* for standard output. · e9fb17c5
      Mara Bos authored
      The threads running commands for clients through the Posix daemon used
      to write to a char buffer through snprintf (etc.) which was then written
      directly to the file descriptor, whereas in the other case printf
      (etc.) was used to write to stdout (FILE*). Both versions used some
      macro's and repeated code to have the same output.
      
      This change unifies these two cases by using a FILE* in both cases. The
      (line) buffering is done by the standard C library's implementation
      (just like with stdout), and px4_log.c now uses the same code in all
      cases (using fprintf, etc.) for printing (colored) output.
      e9fb17c5
  5. Nov 21, 2018
  6. Nov 16, 2018
  7. Nov 14, 2018
  8. Nov 13, 2018
    • Mara Bos's avatar
      Use unix sockets instead of pipes for posix daemon. (#10766) · 9594ebf7
      Mara Bos authored
      Unlike pipes, unix sockets provide bi-directional
      communication with each connected client.
      
      - No need to generate a unique uuid per client anymore.
      
      - The client doesn't have to create its own pipe anymore.
      
      - Since there is no risk of multiple client's writes getting mixed up,
        messages don't need to fit in a single write anymore, removing the
        limit on command length.
      
      - Since the server can detect a connection closing, the client no longer
        needs to handle signals. When the client is killed, the connection is
        automatically closed, which will cause the server to kill the related
        px4 thread.
        Since this does not rely on handling signals and the client sending an
        additional message, this is much more reliable.
      
      - Client is no longer a singleton.
      
      - The protocol is simplified. Standard output is directly written to the
        socket back to the client, without wrapping it in any protocol
        message.
      
      - Because of the simple protocol, one could now even use netcat to run a
        px4 command:
      
          $ echo hello | netcat -UN /tmp/px4-sock-0
      
      Also removes a few race conditions.
      9594ebf7
  9. Nov 10, 2018
  10. Oct 27, 2018
    • Mara Bos's avatar
      Fix many format strings. · 10c20b38
      Mara Bos authored
      Fixes these invalid format strings:
      - A `%d` for a pointer (replaced it by `%p`)
      - A 0x%08x (and a 0x%0x8!) for a pointer (replaced by %p)
      - 2 cases of `%d` for a `ssize_t` (replaced it by `%zi`)
      - 1 case of a %u for an `int` (replaced by %i)
      - 3 cases of %d for a `long` (replaced by %ld)
      - 19 cases of `%d`, `%i`, `%u` or `%lu` for a `size_t` (replaced it by `%zu`)
      - An unused formatting argument (removed it)
      - A missing `%d` (added it)
      - A missing `%s` (added it)
      - 2 cases of `%llu` for a `uint64_t` (replaced it by `"%" PRIu64`)
      - 6 cases of giving a string directly as format string (replaced it by `("%s", string)`)
      - 2 cases of %*-s, which should probably have been %-*s.
        (Looks like NuttX accepts (the invalid) %*-s, but other platforms don't.)
      - A %04x for a `uint32_t` (replaced by "%04" PRIx32)
      10c20b38
  11. Oct 20, 2018
  12. Oct 15, 2018
  13. Oct 09, 2018
  14. Oct 03, 2018
  15. Sep 27, 2018
    • Beat Küng's avatar
      posix shell: use /bin/sh instead of bash · b972651a
      Beat Küng authored
      This uses the systems default shell:
      - Ubuntu: dash
      - Fedora: bash
      
      Since bash is invoked via /bin/sh, it operates in POSIX mode:
        https://tiswww.case.edu/php/chet/bash/POSIX
      
      - remove '# Ignore the expand_aliases command in zshell.'
        Not needed because the shell operates in POSIX mode
      - [[ is bashism -> use [
      - autostart_files=( $autostart_file_match )
        is not supported in dash, so use 'ls'
      - shellcheck runs the dash flavor, since dash is a minimalistic shell.
      
      Tested on dash & bash.
      b972651a
  16. Sep 26, 2018
Loading