Utilize 'Bank Locator' memory device table field

SMBIOS specification defines the following fields in the
'Memory Device (Type 17)' table:

'''
Device Locator
String number of the string that identifies the physically-labeled
socket or board position where the memory device is located.
EXAMPLE: "DIMM 0"

Bank Locator
String number of the string that identifies the physically labeled
bank where the memory device is located.
EXAMPLE: "Bank 0" or "A"
'''

Currently smbios-mdr uses only 'Device Locator' field for the
'Dimm::MemoryDeviceLocator' value.
Utilize both 'Bank Locator' and 'Device Locator' fields to construct
more complete locator value.

Tested:
Tested on the AMD EthanolX board. Example of the locator fields in
one of the Type 17 tables:
Bank Locator: "P0 CHANNEL A",
Device Locator: "DIMM 0".

Before the patch "MemoryDeviceLocator" property on the
"xyz.openbmc_project.Inventory.Item.Dimm" interface is equal to
the "DIMM 0".
After the patch it is equal to the "P0 CHANNEL A DIMM 0".

Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
Change-Id: I0e4913b8ac0639a9549c217ca9dfbfe34ea82c68
diff --git a/src/dimm.cpp b/src/dimm.cpp
index 990b310..6928c8b 100644
--- a/src/dimm.cpp
+++ b/src/dimm.cpp
@@ -70,7 +70,8 @@
         dimmSize(memoryInfo->size);
     }
 
-    dimmDeviceLocator(memoryInfo->deviceLocator, memoryInfo->length, dataIn);
+    dimmDeviceLocator(memoryInfo->bankLocator, memoryInfo->deviceLocator,
+                      memoryInfo->length, dataIn);
     dimmType(memoryInfo->memoryType);
     dimmTypeDetail(memoryInfo->typeDetail);
     maxMemorySpeedInMhz(memoryInfo->speed);
@@ -165,10 +166,24 @@
         memorySizeInKB(value);
 }
 
-void Dimm::dimmDeviceLocator(const uint8_t positionNum, const uint8_t structLen,
-                             uint8_t* dataIn)
+void Dimm::dimmDeviceLocator(const uint8_t bankLocatorPositionNum,
+                             const uint8_t deviceLocatorPositionNum,
+                             const uint8_t structLen, uint8_t* dataIn)
 {
-    std::string result = positionToString(positionNum, structLen, dataIn);
+    std::string deviceLocator =
+        positionToString(deviceLocatorPositionNum, structLen, dataIn);
+    std::string bankLocator =
+        positionToString(bankLocatorPositionNum, structLen, dataIn);
+
+    std::string result;
+    if (!bankLocator.empty())
+    {
+        result = bankLocator + " " + deviceLocator;
+    }
+    else
+    {
+        result = deviceLocator;
+    }
 
     memoryDeviceLocator(result);