1 // 2 // Copyright (C) 2012 The Android Open Source Project 3 // 4 // Licensed under the Apache License, Version 2.0 (the "License"); 5 // you may not use this file except in compliance with the License. 6 // You may obtain a copy of the License at 7 // 8 // http://www.apache.org/licenses/LICENSE-2.0 9 // 10 // Unless required by applicable law or agreed to in writing, software 11 // distributed under the License is distributed on an "AS IS" BASIS, 12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 // See the License for the specific language governing permissions and 14 // limitations under the License. 15 // 16 17 #ifndef SHILL_CELLULAR_MODEM_PROXY_INTERFACE_H_ 18 #define SHILL_CELLULAR_MODEM_PROXY_INTERFACE_H_ 19 20 #include <string> 21 22 #include "shill/callbacks.h" 23 24 namespace shill { 25 26 class CallContext; 27 class Error; 28 29 typedef base::Callback<void(uint32_t, uint32_t, uint32_t)> 30 ModemStateChangedSignalCallback; 31 typedef base::Callback<void(const std::string& manufacturer, 32 const std::string& modem, 33 const std::string& version, 34 const Error&)> ModemInfoCallback; 35 36 // These are the methods that a ModemManager.Modem proxy must support. The 37 // interface is provided so that it can be mocked in tests. All calls are 38 // made asynchronously. 39 class ModemProxyInterface { 40 public: 41 virtual ~ModemProxyInterface() {} 42 43 virtual void Enable(bool enable, Error* error, 44 const ResultCallback& callback, int timeout) = 0; 45 virtual void Disconnect(Error* error, const ResultCallback& callback, 46 int timeout) = 0; 47 virtual void GetModemInfo(Error* error, const ModemInfoCallback& callback, 48 int timeout) = 0; 49 50 virtual void set_state_changed_callback( 51 const ModemStateChangedSignalCallback& callback) = 0; 52 }; 53 54 } // namespace shill 55 56 #endif // SHILL_CELLULAR_MODEM_PROXY_INTERFACE_H_ 57