Updated on 2022-03-13 GMT+08:00

Engine::SendData

Sends data from the engine to the specified port_id. This API is defined in engine.h.

The SendData interface uses the DMA transfer mode, which may affect the CPU's timely response to and processing of interrupt requests, for example, memory allocation by calling the new or malloc function.

Syntax

HIAI_StatusT Engine::SendData(uint32_t portId, const std::string& messageName, const shared_ptr<void>& dataPtr, uint32_t timeOut = TIME_OUT_VALUE)

Parameter Description

Parameter

Description

Value Range

portId

ID of the output port of the engine

-

messageName

Name of the message that is being sent. The message must be registered in advance by calling the macro provided by HiAI.

-

dataPtr

Pointer that points to a specific message

-

timeOut

Timeout for calling this API to send data. The default timeout is 500 ms.

If data sending times out, the system background attempts to send data again. A maximum of 16 attempts are allowed.

-

Return Value

For details about the returned error codes, see "Error Codes."

Error Codes

No.

Error Code

Description

1

HIAI_OK

The running is OK.

2

HIAI_ENGINE_NULL_POINTER

The pointer is null.

3

HIAI_GRAPH_ENGINE_NOT_EXIST

The engine does not exist.

4

HIAI_GRAPH_SRC_PORT_NOT_EXIST

The source port does not exist.