endurox.tpexport

endurox.tpexport(ibuf: object, flags: int = 0) object

Export ATMI buffer. NULL buffer export is not supported.

tpexport example
import endurox as e
buf = e.tpexport({"data":"HELLO WORLD"})
print(buf)
# will print:
# b'{"buftype":"STRING","version":1,"data":"HELLO WORLD"}'

For more details see tpexport(3) C API call.

Raises:

AtmiException

Following error codes may be present:
TPEINVAL - Invalid buffer passed.
TPEOTYPE - Invalid input type.
TPESYSTEM - System error occurred.
TPEOS - Operating system error occurred.

Parameters:
  • ibuf (dict) – ATMI buffer.

  • flags (int) – Bitwise flags, may contain TPEX_STRING. Default is 0.

Returns:

buf_serial – By default function returns byte array. If flags did contain TPEX_STRING, output format is in Base64 and returned value type is string.

Return type:

object