sdr: Use registerHandler instead of ipmi_register_callback

Since ipmi_register_callback declared in api.h has been gradually
deprecated, this submission is to use registerHandler instead of
ipmi_register_callback.

Change-Id: I0adfcd6c0e41daafe2d81918a527925997f96585
Signed-off-by: George Liu <liuxiwei@ieisystem.com>
diff --git a/dbus-sdr/sensorcommands.cpp b/dbus-sdr/sensorcommands.cpp
index 06d039a..c6a167f 100644
--- a/dbus-sdr/sensorcommands.cpp
+++ b/dbus-sdr/sensorcommands.cpp
@@ -695,8 +695,7 @@
         {
             return GENERAL_ERROR;
         }
-        data.header.record_id_msb = recordID >> 8;
-        data.header.record_id_lsb = recordID & 0xFF;
+        data.header.recordId = recordID;
         recordData.insert(recordData.end(), reinterpret_cast<uint8_t*>(&data),
                           reinterpret_cast<uint8_t*>(&data) + sizeof(data));
     }
@@ -1778,12 +1777,10 @@
 void constructSensorSdrHeaderKey(uint16_t sensorNum, uint16_t recordID,
                                  get_sdr::SensorDataFullRecord& record)
 {
-    get_sdr::header::set_record_id(
-        recordID, reinterpret_cast<get_sdr::SensorDataRecordHeader*>(&record));
-
     uint8_t sensornumber = static_cast<uint8_t>(sensorNum);
     uint8_t lun = static_cast<uint8_t>(sensorNum >> 8);
 
+    record.header.recordId = recordID;
     record.header.sdr_version = ipmiSdrVersion;
     record.header.record_type = get_sdr::SENSOR_DATA_FULL_RECORD;
     record.header.record_length = sizeof(get_sdr::SensorDataFullRecord) -
@@ -2043,9 +2040,7 @@
     uint8_t sensornumber = static_cast<uint8_t>(sensorNum);
     uint8_t lun = static_cast<uint8_t>(sensorNum >> 8);
 
-    get_sdr::header::set_record_id(
-        recordID, reinterpret_cast<get_sdr::SensorDataRecordHeader*>(&record));
-
+    record.header.recordId = recordID;
     record.header.sdr_version = ipmiSdrVersion;
     record.header.record_type = get_sdr::SENSOR_DATA_EVENT_RECORD;
     record.header.record_length = sizeof(get_sdr::SensorDataEventRecord) -
diff --git a/dbus-sdr/storagecommands.cpp b/dbus-sdr/storagecommands.cpp
index f0c43c3..e0e47e1 100644
--- a/dbus-sdr/storagecommands.cpp
+++ b/dbus-sdr/storagecommands.cpp
@@ -709,8 +709,7 @@
     }
     size_t sizeDiff = maxFruSdrNameSize - name.size();
 
-    resp.header.record_id_lsb = 0x0; // calling code is to implement these
-    resp.header.record_id_msb = 0x0;
+    resp.header.recordId = 0x0; // calling code is to implement these
     resp.header.sdr_version = ipmiSdrVersion;
     resp.header.record_type = get_sdr::SENSOR_DATA_FRU_RECORD;
     resp.header.record_length = sizeof(resp.body) + sizeof(resp.key) - sizeDiff;
@@ -1199,8 +1198,8 @@
     get_sdr::SensorDataEntityRecord data{};
 
     /* Header */
-    get_sdr::header::set_record_id(recordId, &(data.header));
     // Based on IPMI Spec v2.0 rev 1.1
+    data.header.recordId = recordId;
     data.header.sdr_version = SDR_VERSION;
     data.header.record_type = 0x08;
     data.header.record_length = sizeof(data.key) + sizeof(data.body);