From 34af218abe6a99144ffe01332ce36fbad94f2628 Mon Sep 17 00:00:00 2001 From: Chris Masone Date: Mon, 22 Aug 2011 11:59:36 -0700 Subject: [shill] Use flimflam-esque storage ids Devices: device_ IPConfig: ipconfig__0 Services: ethernet_ wifi____ cellular__ BUG=chromium-os:17744 TEST=unit Change-Id: Ibf061f9c184e7c86f5afcf97d48e321fc74bde1c Reviewed-on: http://gerrit.chromium.org/gerrit/6412 Reviewed-by: Chris Masone Tested-by: Chris Masone --- cellular_service.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'cellular_service.cc') 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 #include +#include #include #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(); } -- cgit v1.2.3