-
-
Notifications
You must be signed in to change notification settings - Fork 512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
examples: Add example on how to use mavsdk_server lib #2473
Conversation
mavsdk_server_init(&mavsdk_server); | ||
mavsdk_server_run(mavsdk_server, argv[1], 50051); | ||
|
||
mavsdk_server_destroy(mavsdk_server); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't you mavsdk_server_stop
before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mavsdk_server_stop
is done in the signal handler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But then shouldn't you call mavsdk_server_attach()
before? Maybe I'm misremembering it, but here it feels like it will destroy as soon as the autopilot is detected and mavsdk_server_run
returns 🤔
return 1; | ||
} | ||
|
||
signal(SIGUSR1, signal_handler); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is SIGUSR1
triggered? I thought it would have to come programmatically, but in this example nothing sends it 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I should change it to the signal you get with Ctrl+C and catch that nicely.
This just shows how to use the C API to instantiate the gRPC server.
143d107
to
c18538b
Compare
Quality Gate passedIssues Measures |
CI is unrelated, merging. |
This just shows how to use the C API to instantiate the gRPC server.