| 927 | } |
| 928 | |
| 929 | Status GetDriverInfo(ServerContext*, const GetDriverInfoRequest* request, |
| 930 | GetDriverInfoResponse* response) override { |
| 931 | std::lock_guard<std::recursive_mutex> lock(mutex_); |
| 932 | |
| 933 | if (request->driver_name().length() == 0) { |
| 934 | return return_with_error(response, EINVAL, |
| 935 | "Argument must be a name in str"); |
| 936 | } |
| 937 | |
| 938 | const auto& it = |
| 939 | PortBuilder::all_port_builders().find(request->driver_name()); |
| 940 | if (it == PortBuilder::all_port_builders().end()) { |
| 941 | return return_with_error(response, ENOENT, "No driver '%s' found", |
| 942 | request->driver_name().c_str()); |
| 943 | } |
| 944 | |
| 945 | #if 0 |
| 946 | for (int i = 0; i < MAX_COMMANDS; i++) { |
| 947 | if (!drv->commands[i].cmd) |
| 948 | break; |
| 949 | response->add_commands(drv->commands[i].cmd); |
| 950 | } |
| 951 | #endif |
| 952 | response->set_name(it->second.class_name()); |
| 953 | response->set_help(it->second.help_text()); |
| 954 | |
| 955 | return Status::OK; |
| 956 | } |
| 957 | |
| 958 | Status ResetPorts(ServerContext*, const EmptyRequest*, |
| 959 | EmptyResponse* response) override { |
nothing calls this directly
no test coverage detected