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

HIAI_SendData

Sends void data from an external system to a specified port on the Matrix. This API is defined in c_graph.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 HIAI_SendData (HIAI_PortID_t targetPortConfig, const std::string& messageName, std::shared_ptr<void>& dataPtr, uint32_t timeOut=0)

Parameter Description

Parameter

Description

Value Range

targetPortConfig

Graph ID, engine ID, and port ID of the data receiver

-

messageName

Name of a message

-

dataPtr

Pointer to a message

-

timeOut

Timeout for data sending, in ms. If the TX queue is full or the memory pool is insufficient, blocking is enabled based on the timeout configuration. The default value is 0, indicating no blocking.

-

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_GRAPH_ENGINE_NOT_EXIST

The engine does not exist.

3

HIAI_GRAPH_NOT_EXIST

The graph does not exist.

4

HIAI_GRAPH_NO_USEFUL_MEMORY

There is no useful memory.

5

HIAI_GRAPH_SENDMSG_FAILED

The HDC module fails to send a message.

6

HIAI_GRAPH_INVALID_VALUE

The graph has an invalid value.