blob: 1c753584c8af8a339c0b94f55c242c52dcafbef5 [file] [log] [blame]
Chris Masone3bd3c8c2011-06-13 08:20:26 -07001// 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 Masone2b105542011-06-22 10:58:09 -070013#include "shill/refptr_types.h"
Chris Masone3bd3c8c2011-06-13 08:20:26 -070014#include "shill/service.h"
15
16namespace shill {
17
Chris Masone6791a432011-07-12 13:23:19 -070018class ControlInterface;
19class EventDispatcher;
20class Manager;
21
Chris Masone3bd3c8c2011-06-13 08:20:26 -070022class CellularService : public Service {
23 public:
24 CellularService(ControlInterface *control_interface,
25 EventDispatcher *dispatcher,
Chris Masone6791a432011-07-12 13:23:19 -070026 Manager *manager,
mukesh agrawal51a7e932011-07-27 16:18:26 -070027 const CellularRefPtr &device);
Darin Petkovd9661952011-08-03 16:25:42 -070028 virtual ~CellularService();
29
Darin Petkovb27e5442011-08-16 14:36:45 -070030 virtual void Connect();
31 virtual void Disconnect();
Chris Masone3bd3c8c2011-06-13 08:20:26 -070032
Darin Petkovd9661952011-08-03 16:25:42 -070033 uint8 strength() const { return strength_; }
34 void set_strength(uint8 strength) { strength_ = strength; }
35
Darin Petkovb27e5442011-08-16 14:36:45 -070036 const std::string &payment_url() const { return payment_url_; }
37 void set_payment_url(const std::string &url) { payment_url_ = url; }
38
39 const std::string &usage_url() const { return usage_url_; }
40 void set_usage_url(const std::string &url) { usage_url_ = url; }
41
Chris Masone3bd3c8c2011-06-13 08:20:26 -070042 protected:
43 virtual std::string CalculateState() { return "idle"; }
44
45 // Properties
46 std::string activation_state_;
47 std::string operator_name_;
48 std::string operator_code_;
49 std::string network_tech_;
50 std::string roaming_state_;
51 std::string payment_url_;
52 uint8 strength_;
Darin Petkovb27e5442011-08-16 14:36:45 -070053 std::string usage_url_;
Chris Masone3bd3c8c2011-06-13 08:20:26 -070054
55 std::map<std::string, std::string> apn_info_;
56 std::map<std::string, std::string> last_good_apn_info_;
57
58 private:
Darin Petkovb27e5442011-08-16 14:36:45 -070059 virtual std::string GetDeviceRpcId();
Chris Masone95207da2011-06-29 16:50:49 -070060
Chris Masone2b105542011-06-22 10:58:09 -070061 CellularRefPtr cellular_;
Chris Masone3bd3c8c2011-06-13 08:20:26 -070062 const std::string type_;
Darin Petkovd9661952011-08-03 16:25:42 -070063
Chris Masone3bd3c8c2011-06-13 08:20:26 -070064 DISALLOW_COPY_AND_ASSIGN(CellularService);
65};
66
67} // namespace shill
68
69#endif // SHILL_CELLULAR_SERVICE_