| #pragma once | |
| #include "math_service.rpc.pb.h" | |
| #include "pw_log/log.h" | |
| #include "pw_status/status.h" | |
| class MathService final | |
| : public rpc::math::pw_rpc::nanopb::MathService::Service<MathService> { | |
| public: | |
| pw::Status Add(const rpc_math_AddRequest& request, | |
| rpc_math_AddResponse& response) { | |
| PW_LOG_INFO("Server received Add: %d + %d", static_cast<int>(request.a), static_cast<int>(request.b)); | |
| response.result = request.a + request.b; | |
| return pw::OkStatus(); | |
| } | |
| }; |