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

Graph::RegisterEventHandle

Subscribes to interested events. Currently, the host-device disconnection event is supported. When disconnection occurs, the user can receive this event and handle the disconnection logic (for example, waiting for stopping the main program) in the registered callback function. This API is defined in graph.h.

Syntax

HIAI_StatusT Graph::RegisterEventHandle(const HIAIEvent& event, const std::function<HIAI_StatusT(void)>&callBack)

Parameter Description

Parameter

Description

Value Range

event

Subscribed event

typedef enum {

HIAI_DEVICE_DISCONNECT_EVENT // Disconnection message

}HIAIEvent;

callBack

Event callback function

Callback function for user subscription

Return Value

If the operation is successful, HIAI_OK is returned. Otherwise, a failure message is returned.