1c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu//
2c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu// Copyright (C) 2012 The Android Open Source Project
3c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu//
4c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu// Licensed under the Apache License, Version 2.0 (the "License");
5c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu// you may not use this file except in compliance with the License.
6c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu// You may obtain a copy of the License at
7c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu//
8c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu//      http://www.apache.org/licenses/LICENSE-2.0
9c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu//
10c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu// Unless required by applicable law or agreed to in writing, software
11c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu// distributed under the License is distributed on an "AS IS" BASIS,
12c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu// See the License for the specific language governing permissions and
14c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu// limitations under the License.
15c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5Peter Qiu//
16a1e0a1c5a6f60a257cec29341ae6b318550d151aDarin Petkov
17c54afe521739065a5d77e7c049acdb5e603f0592Ben Chan#ifndef SHILL_CELLULAR_MODEM_GSM_NETWORK_PROXY_INTERFACE_H_
18c54afe521739065a5d77e7c049acdb5e603f0592Ben Chan#define SHILL_CELLULAR_MODEM_GSM_NETWORK_PROXY_INTERFACE_H_
19a1e0a1c5a6f60a257cec29341ae6b318550d151aDarin Petkov
20c08653143f7ff3f9f8c2d978da3814290bce5064Darin Petkov#include <map>
21a1e0a1c5a6f60a257cec29341ae6b318550d151aDarin Petkov#include <string>
22c08653143f7ff3f9f8c2d978da3814290bce5064Darin Petkov#include <vector>
23a1e0a1c5a6f60a257cec29341ae6b318550d151aDarin Petkov
249a24553461df7036755060423f90804011612249Eric Shienbrood#include "shill/callbacks.h"
259a24553461df7036755060423f90804011612249Eric Shienbrood
26a1e0a1c5a6f60a257cec29341ae6b318550d151aDarin Petkovnamespace shill {
27a1e0a1c5a6f60a257cec29341ae6b318550d151aDarin Petkov
285de44ab664b7cbb7619e31431e346ec8309548a6Eric Shienbroodclass Error;
295de44ab664b7cbb7619e31431e346ec8309548a6Eric Shienbrood
305de44ab664b7cbb7619e31431e346ec8309548a6Eric Shienbroodtypedef std::map<std::string, std::string> GSMScanResult;
315de44ab664b7cbb7619e31431e346ec8309548a6Eric Shienbroodtypedef std::vector<GSMScanResult> GSMScanResults;
325de44ab664b7cbb7619e31431e346ec8309548a6Eric Shienbrood
337fab89734d88724a288e96a9996b15548c5294c7Ben Chantypedef base::Callback<void(uint32_t)> SignalQualitySignalCallback;
349a24553461df7036755060423f90804011612249Eric Shienbroodtypedef base::Callback<void(
359a24553461df7036755060423f90804011612249Eric Shienbrood    uint32_t,
36f58b28e08efb9e3beccb993bc27dd68e0025a7daPaul Stewart    const std::string&,
37f58b28e08efb9e3beccb993bc27dd68e0025a7daPaul Stewart    const std::string&)> RegistrationInfoSignalCallback;
389a24553461df7036755060423f90804011612249Eric Shienbroodtypedef base::Callback<void(uint32_t)> NetworkModeSignalCallback;
399a24553461df7036755060423f90804011612249Eric Shienbrood
40f58b28e08efb9e3beccb993bc27dd68e0025a7daPaul Stewarttypedef base::Callback<void(uint32_t, const Error&)> SignalQualityCallback;
419a24553461df7036755060423f90804011612249Eric Shienbroodtypedef base::Callback<void(uint32_t,
42f58b28e08efb9e3beccb993bc27dd68e0025a7daPaul Stewart                            const std::string&,
43f58b28e08efb9e3beccb993bc27dd68e0025a7daPaul Stewart                            const std::string&,
44f58b28e08efb9e3beccb993bc27dd68e0025a7daPaul Stewart                            const Error&)> RegistrationInfoCallback;
45f58b28e08efb9e3beccb993bc27dd68e0025a7daPaul Stewarttypedef base::Callback<void(const GSMScanResults&,
46f58b28e08efb9e3beccb993bc27dd68e0025a7daPaul Stewart                            const Error&)> ScanResultsCallback;
479a24553461df7036755060423f90804011612249Eric Shienbrood
48a1e0a1c5a6f60a257cec29341ae6b318550d151aDarin Petkov// These are the methods that a ModemManager.Modem.Gsm.Network proxy must
49a1e0a1c5a6f60a257cec29341ae6b318550d151aDarin Petkov// support. The interface is provided so that it can be mocked in tests.
509a24553461df7036755060423f90804011612249Eric Shienbrood// All calls are made asynchronously.
519a24553461df7036755060423f90804011612249Eric Shienbrood// XXX fixup comment to reflect new reality
52a1e0a1c5a6f60a257cec29341ae6b318550d151aDarin Petkovclass ModemGSMNetworkProxyInterface {
53a1e0a1c5a6f60a257cec29341ae6b318550d151aDarin Petkov public:
54a1e0a1c5a6f60a257cec29341ae6b318550d151aDarin Petkov  virtual ~ModemGSMNetworkProxyInterface() {}
55a1e0a1c5a6f60a257cec29341ae6b318550d151aDarin Petkov
56f58b28e08efb9e3beccb993bc27dd68e0025a7daPaul Stewart  virtual void GetRegistrationInfo(Error* error,
57f58b28e08efb9e3beccb993bc27dd68e0025a7daPaul Stewart                                   const RegistrationInfoCallback& callback,
585de44ab664b7cbb7619e31431e346ec8309548a6Eric Shienbrood                                   int timeout) = 0;
59f58b28e08efb9e3beccb993bc27dd68e0025a7daPaul Stewart  virtual void GetSignalQuality(Error* error,
60f58b28e08efb9e3beccb993bc27dd68e0025a7daPaul Stewart                                const SignalQualityCallback& callback,
619a24553461df7036755060423f90804011612249Eric Shienbrood                                int timeout) = 0;
62f58b28e08efb9e3beccb993bc27dd68e0025a7daPaul Stewart  virtual void Register(const std::string& network_id,
63f58b28e08efb9e3beccb993bc27dd68e0025a7daPaul Stewart                        Error* error, const ResultCallback& callback,
649a24553461df7036755060423f90804011612249Eric Shienbrood                        int timeout) = 0;
65f58b28e08efb9e3beccb993bc27dd68e0025a7daPaul Stewart  virtual void Scan(Error* error, const ScanResultsCallback& callback,
669a24553461df7036755060423f90804011612249Eric Shienbrood                    int timeout) = 0;
679bac6feabc28d06b0a352d7e6a317a84fdee26c7Darin Petkov
689bac6feabc28d06b0a352d7e6a317a84fdee26c7Darin Petkov  // Properties.
697fab89734d88724a288e96a9996b15548c5294c7Ben Chan  virtual uint32_t AccessTechnology() = 0;
709a24553461df7036755060423f90804011612249Eric Shienbrood  // Signal callbacks
719a24553461df7036755060423f90804011612249Eric Shienbrood  virtual void set_signal_quality_callback(
72f58b28e08efb9e3beccb993bc27dd68e0025a7daPaul Stewart      const SignalQualitySignalCallback& callback) = 0;
739a24553461df7036755060423f90804011612249Eric Shienbrood  virtual void set_network_mode_callback(
74f58b28e08efb9e3beccb993bc27dd68e0025a7daPaul Stewart      const NetworkModeSignalCallback& callback) = 0;
759a24553461df7036755060423f90804011612249Eric Shienbrood  virtual void set_registration_info_callback(
76f58b28e08efb9e3beccb993bc27dd68e0025a7daPaul Stewart      const RegistrationInfoSignalCallback& callback) = 0;
77a1e0a1c5a6f60a257cec29341ae6b318550d151aDarin Petkov};
78a1e0a1c5a6f60a257cec29341ae6b318550d151aDarin Petkov
79a1e0a1c5a6f60a257cec29341ae6b318550d151aDarin Petkov}  // namespace shill
80a1e0a1c5a6f60a257cec29341ae6b318550d151aDarin Petkov
81c54afe521739065a5d77e7c049acdb5e603f0592Ben Chan#endif  // SHILL_CELLULAR_MODEM_GSM_NETWORK_PROXY_INTERFACE_H_
82