Skip to content

Commit

Permalink
Declare the error string from inside library
Browse files Browse the repository at this point in the history
  • Loading branch information
swaroopsarma committed Feb 15, 2024
1 parent f8ff8c1 commit a4685d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion include/tdi/common/tdi_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion tdi_python/tdicli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit a4685d0

Please sign in to comment.