HwmonTempMain: revert the type of bus and address back to uint64_t

In I546e967abae7c0fb9fca645867e3037046037647, the type of bus and
address in HwmonTempMain were updated to size_t.

However, in some systems using i3c, the device name is composed by bus
number and the provisioned ID [1]. The provisioned ID is a 48-bit value
(MIPI I3C Basic, v1.1.1, section 5.1.4.1.1), which is greater than the
range of size_t on e.g. 32-bit ARM platforms. Thus, reverting the type
back to uint64_t.

[1] Linux in-turn uses this Provisioned ID to identify the device, and
exposes the Provisioned ID in the device name:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/i3c/master.c?h=v6.6#n1521

Tested:
- added unit test passed.
- can read temperature of the i3c devices from our system.

Change-Id: I6f0e73aaf5f8d28e4bdedbe85646373463f6707f
Signed-off-by: Tom Tung <shes050117@gmail.com>
diff --git a/src/Utils.hpp b/src/Utils.hpp
index 2438e4f..4562b6f 100644
--- a/src/Utils.hpp
+++ b/src/Utils.hpp
@@ -387,4 +387,32 @@
     setupPropertiesChangedMatches(
         sdbusplus::asio::connection& bus, std::span<const char* const> types,
         const std::function<void(sdbusplus::message_t&)>& handler);
-bool getDeviceBusAddr(const std::string& deviceName, size_t& bus, size_t& addr);
+
+template <typename T>
+bool getDeviceBusAddr(const std::string& deviceName, T& bus, T& addr)
+{
+    auto findHyphen = deviceName.find('-');
+    if (findHyphen == std::string::npos)
+    {
+        std::cerr << "found bad device " << deviceName << "\n";
+        return false;
+    }
+    std::string busStr = deviceName.substr(0, findHyphen);
+    std::string addrStr = deviceName.substr(findHyphen + 1);
+
+    std::from_chars_result res{};
+    res = std::from_chars(&*busStr.begin(), &*busStr.end(), bus);
+    if (res.ec != std::errc{} || res.ptr != &*busStr.end())
+    {
+        std::cerr << "Error finding bus for " << deviceName << "\n";
+        return false;
+    }
+    res = std::from_chars(&*addrStr.begin(), &*addrStr.end(), addr, 16);
+    if (res.ec != std::errc{} || res.ptr != &*addrStr.end())
+    {
+        std::cerr << "Error finding addr for " << deviceName << "\n";
+        return false;
+    }
+
+    return true;
+}