diff --git a/python_binding/RdcReader.py b/python_binding/RdcReader.py index 57dc5e9163..96ed02d7dd 100644 --- a/python_binding/RdcReader.py +++ b/python_binding/RdcReader.py @@ -27,14 +27,6 @@ default_unit_coverter = { rdc_field_t.RDC_FI_GPU_TEMP: 0.001, # degree } -class rdc_entity_info_t(Structure): - _fields_ = [ - ("device_type", c_uint32), - ("entity_role", c_uint32), - ("instance_index", c_uint32), - ("device_index", c_uint32), - ] - class RdcReader: # To run the RDC in embedded mode, set the ip_port = None def __init__(self, ip_port = "localhost:50051", field_ids = default_field_ids, @@ -53,11 +45,6 @@ class RdcReader: self.unit_converter = unit_converter self.rdc_handle = c_void_p() - rdc.rdc_get_entity_index_from_info.argtypes = [rdc_entity_info_t] - rdc.rdc_get_entity_index_from_info.restype = c_uint32 - rdc.rdc_get_info_from_entity_index.argtypes = [c_uint32] - rdc.rdc_get_info_from_entity_index.restype = rdc_entity_info_t - self.is_standalone = True if not ip_port: # embedded self.is_standalone = False diff --git a/python_binding/rdc_bootstrap.py b/python_binding/rdc_bootstrap.py index dbef7b921f..c7e7c88934 100644 --- a/python_binding/rdc_bootstrap.py +++ b/python_binding/rdc_bootstrap.py @@ -381,6 +381,15 @@ class rdc_job_group_info_t(Structure): ,("stop_time", c_uint64) ] +class rdc_entity_info_t(Structure): + _fields_ = [ + ("device_index", c_uint32), + ("instance_index", c_uint32), + ("entity_role", c_uint32), + ("device_type", c_uint32), + ] + + rdc.rdc_init.restype = rdc_status_t rdc.rdc_init.argtypes = [ c_uint64 ] rdc.rdc_shutdown.restype = rdc_status_t @@ -441,3 +450,7 @@ rdc.field_id_string.restype = c_char_p rdc.field_id_string.argtypes = [ rdc_field_t ] rdc.get_field_id_from_name.restype = rdc_field_t rdc.get_field_id_from_name.argtypes = [ c_char_p ] +rdc.rdc_get_entity_index_from_info.argtypes = [ rdc_entity_info_t ] +rdc.rdc_get_entity_index_from_info.restype = c_uint32 +rdc.rdc_get_info_from_entity_index.argtypes = [c_uint32] +rdc.rdc_get_info_from_entity_index.restype = rdc_entity_info_t diff --git a/rdc_libs/rdc_modules/rdc_rocp/CMakeLists.txt b/rdc_libs/rdc_modules/rdc_rocp/CMakeLists.txt index 039964ef42..0267cbca32 100644 --- a/rdc_libs/rdc_modules/rdc_rocp/CMakeLists.txt +++ b/rdc_libs/rdc_modules/rdc_rocp/CMakeLists.txt @@ -6,13 +6,16 @@ set(SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}") set(INC_DIR "${PROJECT_SOURCE_DIR}/include/rdc_modules/rdc_rocp") set(RDC_ROCP_LIB_COMPONENT "lib${RDC_ROCP_LIB}") -set(RDC_ROCP_LIB_SRC_LIST "${BOOTSTRAP_LIB_SRC_DIR}/RdcLogger.cc" "${SRC_DIR}/RdcTelemetryLib.cc" - "${SRC_DIR}/RdcRocpCounterSampler.cc" "${SRC_DIR}/RdcRocpBase.cc") +set(RDC_ROCP_LIB_SRC_LIST + "${BOOTSTRAP_LIB_SRC_DIR}/RdcLogger.cc" "${BOOTSTRAP_LIB_SRC_DIR}/RdcEntityCodec.cc" + "${SRC_DIR}/RdcTelemetryLib.cc" "${SRC_DIR}/RdcRocpCounterSampler.cc" + "${SRC_DIR}/RdcRocpBase.cc") set(RDC_ROCP_LIB_INC_LIST "${PROJECT_SOURCE_DIR}/include/rdc/rdc.h" "${RDC_LIB_INC_DIR}/RdcDiagnosticLibInterface.h" "${RDC_LIB_INC_DIR}/rdc_common.h" "${RDC_LIB_INC_DIR}/RdcLogger.h" + "${RDC_LIB_INC_DIR}/RdcEntityCodec.h" "${SRC_DIR}/../../rdc/src/SmiUtils.cc" "${INC_DIR}/RdcRocpBase.h" "${INC_DIR}/RdcRocpCounterSampler.h")