Engine::SetDataRecvFunctor
Sets the callback function for an engine to receive messages. This API is defined in engine.h.
It must be used together with the DataRecvInterface::RecvData API. The detailed principles are as follows:
- Define a subclass (for example, DdkDataRecvInterface) of class DataRecvInterface and initialize the object of the subclass.
- Set the object of class DdkDataRecvInterface to a callback function by calling Engine::SetDataRecvFunctor.
- Send the input data to the corresponding output port by calling Engine::SendData.
- Return data by calling the RecvData function of class DdkDataRecvInterface.
Syntax
HIAI_StatusT Engine::SetDataRecvFunctor(const uint32_t portId, const shared_ptr<DataRecvInterface>& userDefineDataRecv)
Parameter Description
Parameter |
Description |
Value Range |
---|---|---|
portId |
Port ID |
- |
userDefineDataRecv |
Callback function for receiving user-defined data |
- |
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_PORT_ID_ERROR |
The port ID has an error. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot