]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg: Refine the device path text format for Bluetooth to follow spec.
authorQiu Shumin <shumin.qiu@intel.com>
Fri, 28 Aug 2015 02:59:20 +0000 (02:59 +0000)
committershenshushi <shenshushi@Edk2>
Fri, 28 Aug 2015 02:59:20 +0000 (02:59 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18346 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
MdePkg/Library/UefiDevicePathLib/DevicePathToText.c

index b8966854b2f33110f4b2929e1edbc96b6d090a4a..e5f6a1f0621ade9b4145fb82b14ce0d3062c9030 100644 (file)
@@ -2795,17 +2795,18 @@ DevPathFromTextBluetooth (
                                    );\r
 \r
   Index = sizeof (BLUETOOTH_ADDRESS) - 1;\r
-  while (!IS_NULL(BluetoothStr) && Index >= 0) {\r
-    Walker = SplitStr (&BluetoothStr, L':');\r
-    TempBufferSize = StrSize (Walker) + StrLen (L"0x") * sizeof (CHAR16);\r
+  Walker = BluetoothStr;\r
+  while (!IS_NULL(*Walker) && Index >= 0) {\r
+    TempBufferSize = 2 * sizeof(CHAR16) + StrSize(L"0x");\r
     TempNumBuffer = AllocateZeroPool (TempBufferSize);\r
     if (TempNumBuffer == NULL) {\r
       break;\r
     }\r
     StrCpyS (TempNumBuffer, TempBufferSize / sizeof (CHAR16), L"0x");\r
-    StrCatS (TempNumBuffer, TempBufferSize / sizeof (CHAR16), Walker);\r
+    StrnCatS (TempNumBuffer, TempBufferSize / sizeof (CHAR16), Walker, 2);\r
     BluetoothDp->BD_ADDR.Address[Index] = (UINT8)Strtoi (TempNumBuffer);\r
     FreePool (TempNumBuffer);\r
+    Walker += 2;\r
     Index--;\r
   }\r
   \r
index be4619ab85535649c7671845d92a21759a004a93..627308c340be2867bdd373e3ab343cf3cc693a8d 100644 (file)
@@ -1584,7 +1584,7 @@ DevPathToTextBluetooth (
   Bluetooth = DevPath;\r
   UefiDevicePathLibCatPrint (\r
     Str,\r
-    L"Bluetooth(%02x:%02x:%02x:%02x:%02x:%02x)",\r
+    L"Bluetooth(%02x%02x%02x%02x%02x%02x)",\r
     Bluetooth->BD_ADDR.Address[5],\r
     Bluetooth->BD_ADDR.Address[4],\r
     Bluetooth->BD_ADDR.Address[3],\r