sensor: Use getFunc for TPM and RebootAttempt sensor

Change-Id: I8d7581e2c14344425683870daf395fc895d1034c
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
diff --git a/sensorhandler.cpp b/sensorhandler.cpp
index ca8ef53..4394d7b 100644
--- a/sensorhandler.cpp
+++ b/sensorhandler.cpp
@@ -511,7 +511,6 @@
     ipmi::sensor::Info sensor;
 
     switch(type) {
-        case 0xC3:
         case 0xC2:
         case 0xC8:
             r = sd_bus_get_property(bus,a.bus, a.path, a.interface, "value", NULL, &reply, "i");
@@ -592,76 +591,6 @@
             rc = IPMI_CC_OK;
             *data_len=sizeof(sensorreadingresp_t);
             break;
-        case IPMI_SENSOR_TPM:
-        {
-            auto iter = sensors.find(reqptr->sennum);
-            if (iter == sensors.end())
-            {
-                return IPMI_CC_SENSOR_INVALID;
-            }
-
-            auto& interfaceList = iter->second.propertyInterfaces;
-            if (interfaceList.empty())
-            {
-                log<level::ERR>("Interface List empty for the sensor",
-                        entry("SENSOR_NUMBER=%d", reqptr->sennum));
-                return IPMI_CC_UNSPECIFIED_ERROR;
-            }
-
-            /* For the TPM sensor there is no reading value and sensor scanning
-             * is disabled. This is a discrete sensor and only the
-             * corresponding state is asserted.
-             */
-            resp->value = 0;
-            resp->operation = 0;
-            resp->indication[0] = 0;
-            resp->indication[1] = 0;
-
-            try
-            {
-                for (const auto& interface : interfaceList)
-                {
-                    for (const auto& property : interface.second)
-                    {
-                        sdbusplus::bus::bus dbus{ipmid_get_sd_bus_connection()};
-
-                        auto service = ipmi::getService(
-                                       dbus,
-                                       interface.first,
-                                       iter->second.sensorPath);
-
-                        auto propValue = ipmi::getDbusProperty(
-                                dbus, service, iter->second.sensorPath,
-                                interface.first, property.first);
-
-                        auto tpmStatus = propValue.get<bool>();
-
-                        for (const auto& value : property.second)
-                        {
-                            if (tpmStatus == (value.second.assert).get<bool>())
-                            {
-                                /*
-                                 * The discrete sensors support upto 14 states.
-                                 * The assertion states for discrete sensors are
-                                 * stored in 2 bytes, 0-7 in Byte 4 of the
-                                 * response and 8-14 in Byte 5 of the response.
-                                 */
-                                 resp->indication[0] |= 1 << (value.first);
-                                 break;
-                            }
-                        }
-                    }
-                }
-
-                rc = IPMI_CC_OK;
-                *data_len = sizeof(sensorreadingresp_t);
-            }
-            catch (InternalFailure& e)
-            {
-                return IPMI_CC_UNSPECIFIED_ERROR;
-            }
-            break;
-        }
         default:
         {
             const auto iter = sensors.find(reqptr->sennum);