From a4685d019431c00a2f22506e6b2f16c6d63d6aa7 Mon Sep 17 00:00:00 2001 From: "Vishnu Swaroop Kumar Sarma, Duddu" Date: Thu, 15 Feb 2024 22:39:42 +0530 Subject: [PATCH 1/2] Declare the error string from inside library --- include/tdi/common/tdi_defs.h | 4 +++- tdi_python/tdicli.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/tdi/common/tdi_defs.h b/include/tdi/common/tdi_defs.h index 5b7bf74..bed7557 100644 --- a/include/tdi/common/tdi_defs.h +++ b/include/tdi/common/tdi_defs.h @@ -359,7 +359,9 @@ typedef uint32_t tdi_dev_pipe_t; * @param[out] err_str Pointer to error string. Doesn't require user to allocate *space */ -// void tdi_err_str(tdi_status_t sts, const char **err_str); +void tdi_get_err_str(tdi_status_t sts, const char **err_str) { + *err_str = tdi_err_str(sts); +} #ifdef __cplusplus } diff --git a/tdi_python/tdicli.py b/tdi_python/tdicli.py index 329d7fe..ff31f5c 100644 --- a/tdi_python/tdicli.py +++ b/tdi_python/tdicli.py @@ -256,7 +256,7 @@ def _abort_transaction(self): def err_str(self, sts): estr = c_char_p() - self._driver.bf_rt_err_str(c_int(sts), byref(estr)) + self._driver.tdi_get_err_str(c_int(sts), byref(estr)) return estr.value.decode('ascii') class TdiHandle(Structure): _fields_ = [("unused", c_int)] From 2a77eb440cc6f382f53c7c5904257d641e26f3a6 Mon Sep 17 00:00:00 2001 From: "Vishnu Swaroop Kumar Sarma, Duddu" Date: Thu, 15 Feb 2024 23:01:01 +0530 Subject: [PATCH 2/2] fix for duplicate symbols --- include/tdi/common/tdi_defs.h | 4 +--- src/CMakeLists.txt | 2 +- src/tdi_utils.cpp | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/tdi/common/tdi_defs.h b/include/tdi/common/tdi_defs.h index bed7557..dad4a63 100644 --- a/include/tdi/common/tdi_defs.h +++ b/include/tdi/common/tdi_defs.h @@ -359,9 +359,7 @@ typedef uint32_t tdi_dev_pipe_t; * @param[out] err_str Pointer to error string. Doesn't require user to allocate *space */ -void tdi_get_err_str(tdi_status_t sts, const char **err_str) { - *err_str = tdi_err_str(sts); -} +void tdi_get_err_str(tdi_status_t sts, const char **err_str); #ifdef __cplusplus } diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index da7ca87..a01a827 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -14,7 +14,7 @@ set(TDI_SRCS #tdi_cjson.cpp #tdi_info_impl.cpp #tdi_table_info.cpp - #tdi_utils.cpp + tdi_utils.cpp ) set(TDI_C_FRONTEND_SRCS diff --git a/src/tdi_utils.cpp b/src/tdi_utils.cpp index cb3a37d..d7cd368 100644 --- a/src/tdi_utils.cpp +++ b/src/tdi_utils.cpp @@ -25,8 +25,8 @@ extern "C" { #include #include -void tdi_err_str(tdi_status_t sts, const char **err_str) { - *err_str = bf_err_str(sts); +void tdi_get_err_str(tdi_status_t sts, const char **err_str) { + *err_str = tdi_err_str(sts); } #ifdef __cplusplus