nav_server.cpp 769 B

12345678910111213141516171819202122232425
  1. //
  2. // Created by zx on 23-7-15.
  3. //
  4. #include "nav_server.h"
  5. ::grpc::Status NavServer::Start(::grpc::ServerContext* context,
  6. const ::NavMessage::NavCmd* request, ::NavMessage::NavResponse* response){
  7. std::cout << "server received StartCmd: " << request->key() << std::endl;
  8. if(navigator_!= nullptr){
  9. navigator_->Start(*request,*response);
  10. }
  11. return ::grpc::Status::OK;
  12. }
  13. ::grpc::Status NavServer::Cancel(::grpc::ServerContext* context,
  14. const ::NavMessage::NavCmd* request, ::NavMessage::NavResponse* response){
  15. std::cout << "server received Cancel Cmd: " << request->key() << std::endl;
  16. if(navigator_!= nullptr){
  17. navigator_->Cancel(*request,*response);
  18. }
  19. return ::grpc::Status::OK;
  20. }