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] 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)]