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>
This commit is contained in:
@@ -2691,6 +2691,39 @@ DevPathFromTextWiFi (
|
||||
return (EFI_DEVICE_PATH_PROTOCOL *) WiFiDp;
|
||||
}
|
||||
|
||||
/**
|
||||
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.
|
||||
|
||||
@@ -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 },
|
||||
|
Reference in New Issue
Block a user