| 79 | } |
| 80 | |
| 81 | Source::Device::Device( |
| 82 | const std::string &name, |
| 83 | const std::string &host, |
| 84 | uint16_t port, |
| 85 | const std::string &user, |
| 86 | const std::string &password) |
| 87 | { |
| 88 | SoapySDRKwargs args; |
| 89 | std::string label; |
| 90 | |
| 91 | memset(&args, 0, sizeof(SoapySDRKwargs)); |
| 92 | |
| 93 | label = name + " on " + host + ":" + std::to_string(port); |
| 94 | |
| 95 | SoapySDRKwargs_set(&args, "label", label.c_str()); |
| 96 | SoapySDRKwargs_set(&args, "driver", "tcp"); |
| 97 | SoapySDRKwargs_set(&args, "host", host.c_str()); |
| 98 | SoapySDRKwargs_set(&args, "port", std::to_string(port).c_str()); |
| 99 | SoapySDRKwargs_set(&args, "user", user.c_str()); |
| 100 | SoapySDRKwargs_set(&args, "password", password.c_str()); |
| 101 | |
| 102 | SU_ATTEMPT( |
| 103 | this->owned = suscan_source_device_new( |
| 104 | SUSCAN_SOURCE_REMOTE_INTERFACE, |
| 105 | &args)); |
| 106 | |
| 107 | SoapySDRKwargs_clear(&args); |
| 108 | |
| 109 | this->setDevice(this->owned, 0); |
| 110 | } |
| 111 | |
| 112 | Source::Device::Device(Source::Device &&rv) |
| 113 | { |