Skip to content
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

backend: improve backend api and initialization #357

Merged
merged 1 commit into from
Apr 10, 2018

Conversation

JonasVautherin
Copy link
Collaborator

This PR adds a callback notifying when the gRPC server is started to the backend C api. This is necessary when the frontend starts the backend on the phone, because it needs to wait for the gRPC server to be started before it can initiate a connection.

Copy link
Collaborator

@julianoes julianoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one comment

@@ -2,7 +2,7 @@
extern "C" {
#endif

__attribute__((visibility("default"))) int runBackend(int mavlink_listen_port);
__attribute__((visibility("default"))) void runBackend(int mavlink_listen_port, void (*onServerStarted)(void*), void *context);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing #pragma once in this file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Thanks!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fixed.

@JonasVautherin JonasVautherin merged commit 829b973 into develop Apr 10, 2018
@JonasVautherin JonasVautherin deleted the notify-backend-started branch April 10, 2018 09:33
dronecore::backend::ConnectionInitiator<dronecore::DroneCore> _connection_initiator;
std::unique_ptr<grpc::Server> _server;
private:
DroneCore _dc;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not reference ? I don't know, I'm just asking.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, because backend.cpp is actually the one owning the object. It has to be created somewhere, right? :-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants