diff options
author | Ruiyu Ni <ruiyu.ni@intel.com> | 2017-06-06 10:03:09 +0800 |
---|---|---|
committer | Guo Mang <mang.guo@intel.com> | 2017-07-12 11:24:53 +0800 |
commit | 0acca3e4065b6b6498faf0844185c82b3367e0c8 (patch) | |
tree | 2f1aa40d7d529b9d3b2f1c3e142f9eb0a8e6f7f3 /Core/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c | |
parent | b527ce3be7b615d64339e6736a92a560b80f87d0 (diff) | |
download | edk2-platforms-0acca3e4065b6b6498faf0844185c82b3367e0c8.tar.xz |
MdePkg/DevicePath: Add BluetoothLe device path node support
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
(cherry picked from commit ff5623e990782ad62c5f6943087ebafb17afe8ba)
Diffstat (limited to 'Core/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c')
-rw-r--r-- | Core/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Core/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c b/Core/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c index 187c1cc4dc..f50c11cfa2 100644 --- a/Core/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c +++ b/Core/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c @@ -2692,6 +2692,39 @@ DevPathFromTextWiFi ( }
/**
+ Converts a text device path node to Bluetooth LE device path structure.
+
+ @param TextDeviceNode The input Text device path node.
+
+ @return A pointer to the newly-created Bluetooth LE device path structure.
+
+**/
+EFI_DEVICE_PATH_PROTOCOL *
+DevPathFromTextBluetoothLE (
+ IN CHAR16 *TextDeviceNode
+ )
+{
+ CHAR16 *BluetoothLeAddrStr;
+ CHAR16 *BluetoothLeAddrTypeStr;
+ BLUETOOTH_LE_DEVICE_PATH *BluetoothLeDp;
+
+ BluetoothLeAddrStr = GetNextParamStr (&TextDeviceNode);
+ BluetoothLeAddrTypeStr = GetNextParamStr (&TextDeviceNode);
+ BluetoothLeDp = (BLUETOOTH_LE_DEVICE_PATH *) CreateDeviceNode (
+ MESSAGING_DEVICE_PATH,
+ MSG_BLUETOOTH_LE_DP,
+ (UINT16) sizeof (BLUETOOTH_LE_DEVICE_PATH)
+ );
+
+ BluetoothLeDp->Address.Type = (UINT8) Strtoi (BluetoothLeAddrTypeStr);
+ StrHexToBytes (
+ BluetoothLeAddrStr, sizeof (BluetoothLeDp->Address.Address) * 2,
+ BluetoothLeDp->Address.Address, sizeof (BluetoothLeDp->Address.Address)
+ );
+ return (EFI_DEVICE_PATH_PROTOCOL *) BluetoothLeDp;
+}
+
+/**
Converts a text device path node to URI device path structure.
@param TextDeviceNode The input Text device path node.
@@ -3367,6 +3400,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED DEVICE_PATH_FROM_TEXT_TABLE mUefiDevicePathLibDevP {L"Uri", DevPathFromTextUri },
{L"Bluetooth", DevPathFromTextBluetooth },
{L"Wi-Fi", DevPathFromTextWiFi },
+ {L"BluetoothLE", DevPathFromTextBluetoothLE },
{L"MediaPath", DevPathFromTextMediaPath },
{L"HD", DevPathFromTextHD },
{L"CDROM", DevPathFromTextCDROM },
|