summaryrefslogtreecommitdiff
path: root/cellular_service.cc
diff options
context:
space:
mode:
authorChris Masone <cmasone@chromium.org>2011-08-22 11:59:36 -0700
committerChris Masone <cmasone@chromium.org>2011-08-22 15:06:46 -0700
commit34af218abe6a99144ffe01332ce36fbad94f2628 (patch)
tree945f160f913a90aa85501df623d5b95e62d5126b /cellular_service.cc
parent3335b3773067671301a8a02a1f9eefd17a3ce607 (diff)
downloadshill-34af218abe6a99144ffe01332ce36fbad94f2628.tar.gz
[shill] Use flimflam-esque storage ids
Devices: device_<MAC> IPConfig: ipconfig_<MAC of associated device>_0 Services: ethernet_<MAC of associated device> wifi_<MAC of associated device>_<SSID>_<mode>_<security> cellular_<MAC of associated device>_<Network_name> BUG=chromium-os:17744 TEST=unit Change-Id: Ibf061f9c184e7c86f5afcf97d48e321fc74bde1c Reviewed-on: http://gerrit.chromium.org/gerrit/6412 Reviewed-by: Chris Masone <cmasone@chromium.org> Tested-by: Chris Masone <cmasone@chromium.org>
Diffstat (limited to 'cellular_service.cc')
-rw-r--r--cellular_service.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/cellular_service.cc b/cellular_service.cc
index 70b11917..487df55e 100644
--- a/cellular_service.cc
+++ b/cellular_service.cc
@@ -7,6 +7,7 @@
#include <string>
#include <base/logging.h>
+#include <base/stringprintf.h>
#include <chromeos/dbus/service_constants.h>
#include "shill/cellular.h"
@@ -15,6 +16,9 @@ using std::string;
namespace shill {
+// static
+const char CellularService::kServiceType[] = "cellular";
+
CellularService::CellularService(ControlInterface *control_interface,
EventDispatcher *dispatcher,
Manager *manager,
@@ -51,6 +55,15 @@ void CellularService::ActivateCellularModem(const string &carrier) {
cellular_->Activate(carrier);
}
+string CellularService::GetStorageIdentifier(const string &mac) {
+ string id = base::StringPrintf("%s_%s_%s",
+ kServiceType,
+ mac.c_str(),
+ serving_operator_.GetName().c_str());
+ std::replace_if(id.begin(), id.end(), &Service::LegalChar, '_');
+ return id;
+}
+
string CellularService::GetDeviceRpcId() {
return cellular_->GetRpcIdentifier();
}