Revision: 18346
http://sourceforge.net/p/edk2/code/18346
Author: shenshushi
Date: 2015-08-28 02:59:20 +0000 (Fri, 28 Aug 2015)
Log Message:
-----------
MdePkg: Refine the device path text format for Bluetooth to follow spec.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Modified Paths:
--------------
trunk/edk2/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
trunk/edk2/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
Modified: trunk/edk2/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
===================================================================
--- trunk/edk2/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
2015-08-28 02:57:09 UTC (rev 18345)
+++ trunk/edk2/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
2015-08-28 02:59:20 UTC (rev 18346)
@@ -2795,17 +2795,18 @@
);
Index = sizeof (BLUETOOTH_ADDRESS) - 1;
- while (!IS_NULL(BluetoothStr) && Index >= 0) {
- Walker = SplitStr (&BluetoothStr, L':');
- TempBufferSize = StrSize (Walker) + StrLen (L"0x") * sizeof (CHAR16);
+ Walker = BluetoothStr;
+ while (!IS_NULL(*Walker) && Index >= 0) {
+ TempBufferSize = 2 * sizeof(CHAR16) + StrSize(L"0x");
TempNumBuffer = AllocateZeroPool (TempBufferSize);
if (TempNumBuffer == NULL) {
break;
}
StrCpyS (TempNumBuffer, TempBufferSize / sizeof (CHAR16), L"0x");
- StrCatS (TempNumBuffer, TempBufferSize / sizeof (CHAR16), Walker);
+ StrnCatS (TempNumBuffer, TempBufferSize / sizeof (CHAR16), Walker, 2);
BluetoothDp->BD_ADDR.Address[Index] = (UINT8)Strtoi (TempNumBuffer);
FreePool (TempNumBuffer);
+ Walker += 2;
Index--;
}
Modified: trunk/edk2/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
===================================================================
--- trunk/edk2/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
2015-08-28 02:57:09 UTC (rev 18345)
+++ trunk/edk2/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
2015-08-28 02:59:20 UTC (rev 18346)
@@ -1584,7 +1584,7 @@
Bluetooth = DevPath;
UefiDevicePathLibCatPrint (
Str,
- L"Bluetooth(%02x:%02x:%02x:%02x:%02x:%02x)",
+ L"Bluetooth(%02x%02x%02x%02x%02x%02x)",
Bluetooth->BD_ADDR.Address[5],
Bluetooth->BD_ADDR.Address[4],
Bluetooth->BD_ADDR.Address[3],
------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits