Remove underscores in MAC address 51/27251/1
authorJimmy Huang <jimmy.huang@intel.com>
Mon, 8 Sep 2014 21:53:13 +0000 (14:53 -0700)
committerJimmy Huang <jimmy.huang@intel.com>
Mon, 8 Sep 2014 21:55:19 +0000 (14:55 -0700)
The current MAC address string contains underscores that need to be
removed so that it can be parsed correctly.

Change-Id: Ib3cab182de56ebdef51e0e903279ba8d307fa081
Signed-off-by: Jimmy Huang <jimmy.huang@intel.com>
packaging/phoned.changes
src/ofono.cpp

index 0e21f37..59ea458 100644 (file)
@@ -1,3 +1,6 @@
+* Mon Sep 08 2014 Jimmy Huang <jimmy.huang@intel.com> submit/tizen_ivi/20140908.173512-2-ge0fa798
+- Remove underscores in MAC address
+
 * Mon Sep 08 2014 Jimmy Huang <jimmy.huang@intel.com> submit/tizen_ivi/20140908.173512-1-g3635592
 - Fixes invalid check for power state
 
index 6af38ca..db7ccb6 100644 (file)
@@ -444,6 +444,8 @@ void OFono::handleSignal(GDBusConnection       *connection,
                 std::string modemString(modem);
                 size_t idx = modemString.find( "_" ) + 1; // index of address of remote device
                 std::string modemRemoteBtAddress = modemString.substr (idx, modemString.length()-idx);
+                modemRemoteBtAddress.erase(std::remove_if(modemRemoteBtAddress.begin(),
+                    modemRemoteBtAddress.end(), isnxdigit), modemRemoteBtAddress.end());
                 if(makeMACFromRawMAC(modemRemoteBtAddress)) {
                     ctx->modemAdded(modemRemoteBtAddress);
                 }