Chris Masone | 3bd3c8c | 2011-06-13 08:20:26 -0700 | [diff] [blame] | 1 | // Copyright (c) 2011 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 | #ifndef SHILL_CELLULAR_SERVICE_ |
| 6 | #define SHILL_CELLULAR_SERVICE_ |
| 7 | |
| 8 | #include <map> |
| 9 | #include <string> |
| 10 | |
| 11 | #include <base/basictypes.h> |
| 12 | |
Chris Masone | 2b10554 | 2011-06-22 10:58:09 -0700 | [diff] [blame] | 13 | #include "shill/refptr_types.h" |
Chris Masone | 3bd3c8c | 2011-06-13 08:20:26 -0700 | [diff] [blame] | 14 | #include "shill/service.h" |
| 15 | |
| 16 | namespace shill { |
| 17 | |
Chris Masone | 6791a43 | 2011-07-12 13:23:19 -0700 | [diff] [blame] | 18 | class ControlInterface; |
| 19 | class EventDispatcher; |
| 20 | class Manager; |
| 21 | |
Chris Masone | 3bd3c8c | 2011-06-13 08:20:26 -0700 | [diff] [blame] | 22 | class CellularService : public Service { |
| 23 | public: |
| 24 | CellularService(ControlInterface *control_interface, |
| 25 | EventDispatcher *dispatcher, |
Chris Masone | 6791a43 | 2011-07-12 13:23:19 -0700 | [diff] [blame] | 26 | Manager *manager, |
mukesh agrawal | 51a7e93 | 2011-07-27 16:18:26 -0700 | [diff] [blame] | 27 | const CellularRefPtr &device); |
Darin Petkov | d966195 | 2011-08-03 16:25:42 -0700 | [diff] [blame] | 28 | virtual ~CellularService(); |
| 29 | |
Chris Masone | 3bd3c8c | 2011-06-13 08:20:26 -0700 | [diff] [blame] | 30 | void Connect(); |
| 31 | void Disconnect(); |
| 32 | |
Darin Petkov | d966195 | 2011-08-03 16:25:42 -0700 | [diff] [blame] | 33 | uint8 strength() const { return strength_; } |
| 34 | void set_strength(uint8 strength) { strength_ = strength; } |
| 35 | |
Chris Masone | 3bd3c8c | 2011-06-13 08:20:26 -0700 | [diff] [blame] | 36 | protected: |
| 37 | virtual std::string CalculateState() { return "idle"; } |
| 38 | |
| 39 | // Properties |
| 40 | std::string activation_state_; |
| 41 | std::string operator_name_; |
| 42 | std::string operator_code_; |
| 43 | std::string network_tech_; |
| 44 | std::string roaming_state_; |
| 45 | std::string payment_url_; |
| 46 | uint8 strength_; |
| 47 | |
| 48 | std::map<std::string, std::string> apn_info_; |
| 49 | std::map<std::string, std::string> last_good_apn_info_; |
| 50 | |
| 51 | private: |
Chris Masone | 95207da | 2011-06-29 16:50:49 -0700 | [diff] [blame] | 52 | std::string GetDeviceRpcId(); |
| 53 | |
Chris Masone | 2b10554 | 2011-06-22 10:58:09 -0700 | [diff] [blame] | 54 | CellularRefPtr cellular_; |
Chris Masone | 3bd3c8c | 2011-06-13 08:20:26 -0700 | [diff] [blame] | 55 | const std::string type_; |
Darin Petkov | d966195 | 2011-08-03 16:25:42 -0700 | [diff] [blame] | 56 | |
Chris Masone | 3bd3c8c | 2011-06-13 08:20:26 -0700 | [diff] [blame] | 57 | DISALLOW_COPY_AND_ASSIGN(CellularService); |
| 58 | }; |
| 59 | |
| 60 | } // namespace shill |
| 61 | |
| 62 | #endif // SHILL_CELLULAR_SERVICE_ |