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

HIAI_C_SendData

Sends data or messages to the Matrix from an external system. This API is defined in c_graph.h.

  • The user-defined message type needs to be registered by calling the API in Data Type Serialization and Deserialization (C++ Language).
  • The message pointer dataPtr is controlled and released by the caller. The Matrix does not manage this pointer.
  • 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_C_SendData(HIAI_PortID_t targetPortConfig, const char* messageName, size_t len, void* dataPtr)

Parameter Description

Parameter

Description

Value Range

targetPortConfig

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

-

messageName

Name of the message that is being sent

-

len

Length of a message name

-

dataPtr

Pointer to a specific message. The message pointer is controlled and released by the caller. The Matrix does not manage this pointer.

-

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.