Most of the systemcmds tests run in the posix build. The UART tests
fail for me as I do not have a UART connected.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
In nuttx the mode parameter to open is not required but in Linux,
and per the POSIX spec, mode is required if the O_CREAT flag is
passed.
The mode flags are different for NuttX and Linux so a new set of
PX4 defines was added:
PX4_O_MODE_777 - read, write, execute for user, group and other
PX4_O_MODE_666 - read, and write for user, group and other
PX4_O_MODE_600 - read, and write for user
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
QuRT doesn't support unlink and does not provide getpid().
The DSPAL layer provides access to usleep so an implementation is
no longer needed.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
The existing orb_advert_t use thoughout the code sometimes tries
to treat it as a file descriptor and there are checks for < 0
and ::close calls on orb_advert_t types which is an invalid use
of an object pointer, which is what orb_advert_t really is.
Initially I had changed the -1 initializations to 0 but it was
suggested that this should be nullptr. That was a good recommendation
but the definition of orb_advert_t had to change to void * because
you cannot initialize a uintptr_t as nullptr.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
The calls to orb_advertise were being mishandled throughout the code.
There were ::close() calls on memory pointers, there were checks
against < 0 when it is a pointer to a object and values larger than
0x7ffffffff are valid. Some places orb_advert_t variables were
being initialized as 0 other places as -1.
The orb_advert_t type was changed to uintptr_t so the pointer value
would not be wrapped as a negative number. This was causing a failure
on ARM.
Tests for < 0 were changed to == 0 since a null pointer is the valid
representation for error, or uninitialized.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
In QuRT, this is a long but the variable was being printed with "%d"
Need to cast variable as long and use "%ld"
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
QuRT does not have a filesystem, so creating a virtual filesystem
that could be implemented as an in-memory file or a remote file
over fastRPC.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Moved the generated topic_listener.cpp to the Build tree so it is
cleaned when make clean is called.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
The posix build would complain that toipc_listener.cpp did not exist
and there was no rule to create it.
The required rule was added to src/systemcmds/topic_listener/module.mk
The script generate_listener.py is run from the Build tree and needs to
access $(PX4_BASE)/msgs so $(PX4_BASE) is now passed as an argument to
generate_listener.py
Signed-off-by: Mark Charlebois <charlebm@gmail.com>