6 changed files with 54 additions and 1 deletions
@ -0,0 +1,8 @@ |
|||||||
|
#!/bin/sh |
||||||
|
# PX4 commands need the 'px4-' prefix in bash. |
||||||
|
# (px4-alias.sh is expected to be in the PATH) |
||||||
|
. px4-alias.sh |
||||||
|
|
||||||
|
dyn ./platforms__posix__tests__dyn_hello.px4mod PASSED |
||||||
|
|
||||||
|
shutdown |
@ -0,0 +1,8 @@ |
|||||||
|
px4_add_module( |
||||||
|
MODULE platforms__posix__tests__dyn_hello |
||||||
|
MAIN hello |
||||||
|
SRCS |
||||||
|
hello.cpp |
||||||
|
DEPENDS |
||||||
|
DYNAMIC |
||||||
|
) |
@ -0,0 +1,16 @@ |
|||||||
|
#include <px4_log.h> |
||||||
|
#include <px4_app.h> |
||||||
|
|
||||||
|
extern "C" __EXPORT int hello_main(int argc, char *argv[]); |
||||||
|
int hello_main(int argc, char *argv[]) |
||||||
|
{ |
||||||
|
PX4_INFO("Hello, I am a dynamically loaded module."); |
||||||
|
|
||||||
|
PX4_INFO("Argv:"); |
||||||
|
|
||||||
|
for (int i = 0; i < argc; ++i) { |
||||||
|
PX4_INFO(" %d: %s", i, argv[i]); |
||||||
|
} |
||||||
|
|
||||||
|
return 0; |
||||||
|
} |
Loading…
Reference in new issue