]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
MdePkg: Add bluetooth devicepath handling in device path library.
[mirror_edk2.git] / MdePkg / Library / UefiDevicePathLib / DevicePathToText.c
index 2dbbddaf097088379a6bde0e893ba8fe775ecf33..af1a6d675e5111080ce96614f8deb4b6f22978da 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   DevicePathToText protocol as defined in the UEFI 2.0 specification.\r
 \r
-Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -1494,6 +1494,42 @@ DevPathToTextVlan (
   UefiDevicePathLibCatPrint (Str, L"Vlan(%d)", Vlan->VlanId);\r
 }\r
 \r
+/**\r
+  Converts a Bluetooth device path structure to its string representative.\r
+\r
+  @param Str             The string representative of input device.\r
+  @param DevPath         The input device path structure.\r
+  @param DisplayOnly     If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param AllowShortcuts  If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+**/\r
+VOID\r
+DevPathToTextBluetooth (\r
+  IN OUT POOL_PRINT  *Str,\r
+  IN VOID            *DevPath,\r
+  IN BOOLEAN         DisplayOnly,\r
+  IN BOOLEAN         AllowShortcuts\r
+  )\r
+{\r
+  BLUETOOTH_DEVICE_PATH  *Bluetooth;\r
+\r
+  Bluetooth = DevPath;\r
+  UefiDevicePathLibCatPrint (\r
+    Str,\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
+    Bluetooth->BD_ADDR.Address[2],\r
+    Bluetooth->BD_ADDR.Address[1],\r
+    Bluetooth->BD_ADDR.Address[0]\r
+    );\r
+}\r
+\r
 /**\r
   Converts a Hard drive device path structure to its string representative.\r
 \r
@@ -1912,6 +1948,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED const DEVICE_PATH_TO_TEXT_TABLE mUefiDevicePathLib
   {MESSAGING_DEVICE_PATH, MSG_VENDOR_DP,                    DevPathToTextVendor         },\r
   {MESSAGING_DEVICE_PATH, MSG_ISCSI_DP,                     DevPathToTextiSCSI          },\r
   {MESSAGING_DEVICE_PATH, MSG_VLAN_DP,                      DevPathToTextVlan           },\r
+  {MESSAGING_DEVICE_PATH, MSG_BLUETOOTH_DP,                 DevPathToTextBluetooth      },\r
   {MEDIA_DEVICE_PATH,     MEDIA_HARDDRIVE_DP,               DevPathToTextHardDrive      },\r
   {MEDIA_DEVICE_PATH,     MEDIA_CDROM_DP,                   DevPathToTextCDROM          },\r
   {MEDIA_DEVICE_PATH,     MEDIA_VENDOR_DP,                  DevPathToTextVendor         },\r