Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "shill/mm1_modem_proxy.h" |
| 6 | |
| 7 | #include <base/logging.h> |
| 8 | |
| 9 | #include "cellular_error.h" |
| 10 | |
| 11 | using std::string; |
| 12 | |
| 13 | namespace shill { |
| 14 | namespace mm1 { |
| 15 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 16 | ModemProxy::ModemProxy(DBus::Connection *connection, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 17 | const string &path, |
| 18 | const string &service) |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 19 | : proxy_(connection, path, service) {} |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 20 | |
| 21 | ModemProxy::~ModemProxy() {} |
| 22 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 23 | void ModemProxy::set_state_changed_callback( |
| 24 | const ModemStateChangedSignalCallback &callback) { |
| 25 | proxy_.set_state_changed_callback(callback); |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 26 | } |
| 27 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 28 | void ModemProxy::Enable(bool enable, |
| 29 | Error *error, |
| 30 | const ResultCallback &callback, |
| 31 | int timeout) { |
| 32 | VLOG(2) << __func__ << "(" << enable << ", " << timeout << ")"; |
| 33 | scoped_ptr<ResultCallback> cb(new ResultCallback(callback)); |
| 34 | try { |
| 35 | proxy_.Enable(enable, cb.get(), timeout); |
| 36 | cb.release(); |
| 37 | } catch (DBus::Error e) { |
| 38 | if (error) |
| 39 | CellularError::FromDBusError(e, error); |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | void ModemProxy::ListBearers(Error *error, |
| 44 | const DBusPathsCallback &callback, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 45 | int timeout) { |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 46 | scoped_ptr<DBusPathsCallback> cb(new DBusPathsCallback(callback)); |
| 47 | try { |
| 48 | proxy_.ListBearers(cb.get(), timeout); |
| 49 | cb.release(); |
| 50 | } catch (DBus::Error e) { |
| 51 | if (error) |
| 52 | CellularError::FromDBusError(e, error); |
| 53 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 54 | } |
| 55 | |
| 56 | void ModemProxy::CreateBearer( |
| 57 | const DBusPropertiesMap &properties, |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 58 | Error *error, |
| 59 | const DBusPathCallback &callback, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 60 | int timeout) { |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 61 | scoped_ptr<DBusPathCallback> cb(new DBusPathCallback(callback)); |
| 62 | try { |
| 63 | proxy_.CreateBearer(properties, cb.get(), timeout); |
| 64 | cb.release(); |
| 65 | } catch (DBus::Error e) { |
| 66 | if (error) |
| 67 | CellularError::FromDBusError(e, error); |
| 68 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 69 | } |
| 70 | |
| 71 | void ModemProxy::DeleteBearer(const ::DBus::Path &bearer, |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 72 | Error *error, |
| 73 | const ResultCallback &callback, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 74 | int timeout) { |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 75 | scoped_ptr<ResultCallback> cb(new ResultCallback(callback)); |
| 76 | try { |
| 77 | proxy_.DeleteBearer(bearer, cb.get(), timeout); |
| 78 | cb.release(); |
| 79 | } catch (DBus::Error e) { |
| 80 | if (error) |
| 81 | CellularError::FromDBusError(e, error); |
| 82 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 83 | } |
| 84 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 85 | void ModemProxy::Reset(Error *error, |
| 86 | const ResultCallback &callback, |
| 87 | int timeout) { |
| 88 | scoped_ptr<ResultCallback> cb(new ResultCallback(callback)); |
| 89 | try { |
| 90 | proxy_.Reset(cb.get(), timeout); |
| 91 | cb.release(); |
| 92 | } catch (DBus::Error e) { |
| 93 | if (error) |
| 94 | CellularError::FromDBusError(e, error); |
| 95 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 96 | } |
| 97 | |
| 98 | void ModemProxy::FactoryReset(const std::string &code, |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 99 | Error *error, |
| 100 | const ResultCallback &callback, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 101 | int timeout) { |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 102 | scoped_ptr<ResultCallback> cb(new ResultCallback(callback)); |
| 103 | try { |
| 104 | proxy_.FactoryReset(code, cb.get(), timeout); |
| 105 | cb.release(); |
| 106 | } catch (DBus::Error e) { |
| 107 | if (error) |
| 108 | CellularError::FromDBusError(e, error); |
| 109 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 110 | } |
| 111 | |
| 112 | void ModemProxy::SetAllowedModes(const uint32_t &modes, |
| 113 | const uint32_t &preferred, |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 114 | Error *error, |
| 115 | const ResultCallback &callback, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 116 | int timeout) { |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 117 | scoped_ptr<ResultCallback> cb(new ResultCallback(callback)); |
| 118 | try { |
| 119 | proxy_.SetAllowedModes(modes, preferred, cb.get(), timeout); |
| 120 | cb.release(); |
| 121 | } catch (DBus::Error e) { |
| 122 | if (error) |
| 123 | CellularError::FromDBusError(e, error); |
| 124 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 125 | } |
| 126 | |
| 127 | void ModemProxy::SetBands(const std::vector< uint32_t > &bands, |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 128 | Error *error, |
| 129 | const ResultCallback &callback, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 130 | int timeout) { |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 131 | scoped_ptr<ResultCallback> cb(new ResultCallback(callback)); |
| 132 | try { |
| 133 | proxy_.SetBands(bands, cb.get(), timeout); |
| 134 | cb.release(); |
| 135 | } catch (DBus::Error e) { |
| 136 | if (error) |
| 137 | CellularError::FromDBusError(e, error); |
| 138 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 139 | } |
| 140 | |
| 141 | void ModemProxy::Command(const std::string &cmd, |
| 142 | const uint32_t &user_timeout, |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 143 | Error *error, |
| 144 | const StringCallback &callback, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 145 | int timeout) { |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 146 | scoped_ptr<StringCallback> cb(new StringCallback(callback)); |
| 147 | try { |
| 148 | proxy_.Command(cmd, user_timeout, cb.get(), timeout); |
| 149 | cb.release(); |
| 150 | } catch (DBus::Error e) { |
| 151 | if (error) |
| 152 | CellularError::FromDBusError(e, error); |
| 153 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 154 | } |
| 155 | |
| 156 | // Inherited properties from ModemProxyInterface. |
| 157 | const ::DBus::Path ModemProxy::Sim() { |
| 158 | return proxy_.Sim(); |
Jason Glasgow | 90d216d | 2012-04-04 15:57:14 -0400 | [diff] [blame] | 159 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 160 | uint32_t ModemProxy::ModemCapabilities() { |
| 161 | return proxy_.ModemCapabilities(); |
Jason Glasgow | 90d216d | 2012-04-04 15:57:14 -0400 | [diff] [blame] | 162 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 163 | uint32_t ModemProxy::CurrentCapabilities() { |
| 164 | return proxy_.CurrentCapabilities(); |
Jason Glasgow | 90d216d | 2012-04-04 15:57:14 -0400 | [diff] [blame] | 165 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 166 | uint32_t ModemProxy::MaxBearers() { |
| 167 | return proxy_.MaxBearers(); |
Jason Glasgow | 90d216d | 2012-04-04 15:57:14 -0400 | [diff] [blame] | 168 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 169 | uint32_t ModemProxy::MaxActiveBearers() { |
| 170 | return proxy_.MaxActiveBearers(); |
Jason Glasgow | 90d216d | 2012-04-04 15:57:14 -0400 | [diff] [blame] | 171 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 172 | const std::string ModemProxy::Manufacturer() { |
| 173 | return proxy_.Manufacturer(); |
Jason Glasgow | 90d216d | 2012-04-04 15:57:14 -0400 | [diff] [blame] | 174 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 175 | const std::string ModemProxy::Model() { |
| 176 | return proxy_.Model(); |
Jason Glasgow | 90d216d | 2012-04-04 15:57:14 -0400 | [diff] [blame] | 177 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 178 | const std::string ModemProxy::Revision() { |
| 179 | return proxy_.Revision(); |
Jason Glasgow | 90d216d | 2012-04-04 15:57:14 -0400 | [diff] [blame] | 180 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 181 | const std::string ModemProxy::DeviceIdentifier() { |
| 182 | return proxy_.DeviceIdentifier(); |
Jason Glasgow | 90d216d | 2012-04-04 15:57:14 -0400 | [diff] [blame] | 183 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 184 | const std::string ModemProxy::Device() { |
| 185 | return proxy_.Device(); |
Jason Glasgow | 90d216d | 2012-04-04 15:57:14 -0400 | [diff] [blame] | 186 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 187 | const std::string ModemProxy::Driver() { |
| 188 | return proxy_.Driver(); |
Jason Glasgow | 90d216d | 2012-04-04 15:57:14 -0400 | [diff] [blame] | 189 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 190 | const std::string ModemProxy::Plugin() { |
| 191 | return proxy_.Plugin(); |
Jason Glasgow | 90d216d | 2012-04-04 15:57:14 -0400 | [diff] [blame] | 192 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 193 | const std::string ModemProxy::EquipmentIdentifier() { |
| 194 | return proxy_.EquipmentIdentifier(); |
Jason Glasgow | 90d216d | 2012-04-04 15:57:14 -0400 | [diff] [blame] | 195 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 196 | uint32_t ModemProxy::UnlockRequired() { |
| 197 | return proxy_.UnlockRequired(); |
Jason Glasgow | 90d216d | 2012-04-04 15:57:14 -0400 | [diff] [blame] | 198 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 199 | const std::map< uint32_t, uint32_t > ModemProxy::UnlockRetries() { |
| 200 | return proxy_.UnlockRetries(); |
Jason Glasgow | 90d216d | 2012-04-04 15:57:14 -0400 | [diff] [blame] | 201 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 202 | uint32_t ModemProxy::State() { |
| 203 | return proxy_.State(); |
Jason Glasgow | 90d216d | 2012-04-04 15:57:14 -0400 | [diff] [blame] | 204 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 205 | uint32_t ModemProxy::AccessTechnologies() { |
| 206 | return proxy_.AccessTechnologies(); |
Jason Glasgow | 90d216d | 2012-04-04 15:57:14 -0400 | [diff] [blame] | 207 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 208 | const ::DBus::Struct< uint32_t, bool > ModemProxy::SignalQuality() { |
| 209 | return proxy_.SignalQuality(); |
Jason Glasgow | 90d216d | 2012-04-04 15:57:14 -0400 | [diff] [blame] | 210 | } |
| 211 | const std::vector<string> ModemProxy::OwnNumbers() { |
| 212 | return proxy_.OwnNumbers(); |
| 213 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 214 | uint32_t ModemProxy::SupportedModes() { |
| 215 | return proxy_.SupportedModes(); |
Jason Glasgow | 90d216d | 2012-04-04 15:57:14 -0400 | [diff] [blame] | 216 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 217 | uint32_t ModemProxy::AllowedModes() { |
| 218 | return proxy_.AllowedModes(); |
Jason Glasgow | 90d216d | 2012-04-04 15:57:14 -0400 | [diff] [blame] | 219 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 220 | uint32_t ModemProxy::PreferredMode() { |
| 221 | return proxy_.PreferredMode(); |
Jason Glasgow | 90d216d | 2012-04-04 15:57:14 -0400 | [diff] [blame] | 222 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 223 | const std::vector< uint32_t > ModemProxy::SupportedBands() { |
| 224 | return proxy_.SupportedBands(); |
Jason Glasgow | 90d216d | 2012-04-04 15:57:14 -0400 | [diff] [blame] | 225 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 226 | const std::vector< uint32_t > ModemProxy::Bands() { |
| 227 | return proxy_.Bands(); |
Jason Glasgow | 90d216d | 2012-04-04 15:57:14 -0400 | [diff] [blame] | 228 | } |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 229 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 230 | ModemProxy::Proxy::Proxy(DBus::Connection *connection, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 231 | const std::string &path, |
| 232 | const std::string &service) |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 233 | : DBus::ObjectProxy(*connection, path, service.c_str()) {} |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 234 | |
| 235 | ModemProxy::Proxy::~Proxy() {} |
| 236 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 237 | void ModemProxy::Proxy::set_state_changed_callback( |
| 238 | const ModemStateChangedSignalCallback &callback) { |
| 239 | state_changed_callback_ = callback; |
| 240 | } |
| 241 | |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 242 | // Signal callbacks inherited from Proxy |
Nathan Williams | a31e79c | 2012-03-30 15:07:00 -0400 | [diff] [blame] | 243 | void ModemProxy::Proxy::StateChanged(const int32_t &old, |
| 244 | const int32_t &_new, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 245 | const uint32_t &reason) { |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame^] | 246 | if (!state_changed_callback_.is_null()) |
| 247 | state_changed_callback_.Run(old, _new, reason); |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 248 | } |
| 249 | |
| 250 | // Method callbacks inherited from |
| 251 | // org::freedesktop::ModemManager1::ModemProxy |
| 252 | void ModemProxy::Proxy::EnableCallback(const ::DBus::Error& dberror, |
| 253 | void *data) { |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 254 | scoped_ptr<ResultCallback> callback(reinterpret_cast<ResultCallback *>(data)); |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 255 | Error error; |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 256 | CellularError::FromDBusError(dberror, &error); |
| 257 | callback->Run(error); |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 258 | } |
| 259 | |
| 260 | void ModemProxy::Proxy::ListBearersCallback( |
| 261 | const std::vector< ::DBus::Path > &bearers, |
| 262 | const ::DBus::Error& dberror, |
| 263 | void *data) { |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 264 | scoped_ptr<DBusPathsCallback> callback( |
| 265 | reinterpret_cast<DBusPathsCallback *>(data)); |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 266 | Error error; |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 267 | CellularError::FromDBusError(dberror, &error); |
| 268 | callback->Run(bearers, error); |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 269 | } |
| 270 | |
| 271 | void ModemProxy::Proxy::CreateBearerCallback(const ::DBus::Path &path, |
| 272 | const ::DBus::Error& dberror, |
| 273 | void *data) { |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 274 | scoped_ptr<ResultCallback> callback(reinterpret_cast<ResultCallback *>(data)); |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 275 | Error error; |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 276 | CellularError::FromDBusError(dberror, &error); |
| 277 | callback->Run(error); |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 278 | } |
| 279 | |
| 280 | void ModemProxy::Proxy::DeleteBearerCallback(const ::DBus::Error& dberror, |
| 281 | void *data) { |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 282 | scoped_ptr<ResultCallback> callback(reinterpret_cast<ResultCallback *>(data)); |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 283 | Error error; |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 284 | CellularError::FromDBusError(dberror, &error); |
| 285 | callback->Run(error); |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 286 | } |
| 287 | |
| 288 | void ModemProxy::Proxy::ResetCallback(const ::DBus::Error& dberror, |
| 289 | void *data) { |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 290 | scoped_ptr<ResultCallback> callback(reinterpret_cast<ResultCallback *>(data)); |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 291 | Error error; |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 292 | CellularError::FromDBusError(dberror, &error); |
| 293 | callback->Run(error); |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 294 | } |
| 295 | |
| 296 | void ModemProxy::Proxy::FactoryResetCallback(const ::DBus::Error& dberror, |
| 297 | void *data) { |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 298 | scoped_ptr<ResultCallback> callback(reinterpret_cast<ResultCallback *>(data)); |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 299 | Error error; |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 300 | CellularError::FromDBusError(dberror, &error); |
| 301 | callback->Run(error); |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 302 | } |
| 303 | |
| 304 | void ModemProxy::Proxy::SetAllowedModesCallback( |
| 305 | const ::DBus::Error& dberror, |
| 306 | void *data) { |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 307 | scoped_ptr<ResultCallback> callback(reinterpret_cast<ResultCallback *>(data)); |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 308 | Error error; |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 309 | CellularError::FromDBusError(dberror, &error); |
| 310 | callback->Run(error); |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 311 | } |
| 312 | |
| 313 | void ModemProxy::Proxy::SetBandsCallback(const ::DBus::Error& dberror, |
| 314 | void *data) { |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 315 | scoped_ptr<ResultCallback> callback(reinterpret_cast<ResultCallback *>(data)); |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 316 | Error error; |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 317 | CellularError::FromDBusError(dberror, &error); |
| 318 | callback->Run(error); |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 319 | } |
| 320 | |
| 321 | void ModemProxy::Proxy::CommandCallback(const std::string &response, |
| 322 | const ::DBus::Error& dberror, |
| 323 | void *data) { |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 324 | scoped_ptr<ResultCallback> callback(reinterpret_cast<ResultCallback *>(data)); |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 325 | Error error; |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 326 | CellularError::FromDBusError(dberror, &error); |
| 327 | callback->Run(error); |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 328 | } |
| 329 | |
| 330 | } // namespace mm1 |
| 331 | } // namespace shill |