A class can implement the Observer interface when it wants to be informed of events in CustomDataChannel objects.
More...
#include <custom_data_channel.h>
|
virtual void | OnConnected (const int32_t port)=0 |
| This method is called when the listened 'CustomDataChannel' is connected successfully.
|
|
virtual void | OnError (const int32_t port, const TcrCode &code, const std::string &msg)=0 |
| This method is called whenever some error is happened in the listened 'CustomDataChannel'.
|
|
virtual void | OnMessage (const int32_t port, const char *buffer)=0 |
| This method is called whenever the listened 'CustomDataChannel' receives cloud message.
|
|
A class can implement the Observer interface when it wants to be informed of events in CustomDataChannel objects.
◆ OnConnected()
virtual void OnConnected |
( |
const int32_t |
port | ) |
|
|
pure virtual |
This method is called when the listened 'CustomDataChannel' is connected successfully.
- Parameters
-
◆ OnError()
virtual void OnError |
( |
const int32_t |
port, |
|
|
const TcrCode & |
code, |
|
|
const std::string & |
msg |
|
) |
| |
|
pure virtual |
This method is called whenever some error is happened in the listened 'CustomDataChannel'.
- Parameters
-
port | The identify of the listened 'CustomDataChannel'. |
code | The error code. |
msg | The error message. |
◆ OnMessage()
virtual void OnMessage |
( |
const int32_t |
port, |
|
|
const char * |
buffer |
|
) |
| |
|
pure virtual |
This method is called whenever the listened 'CustomDataChannel' receives cloud message.
NOTE: |buffer| will be freed once this function returns so callers who want to use the data asynchronously must make sure to copy it first.
- Parameters
-
port | The identify of the listened 'CustomDataChannel'. |
buffer | The message sent from the cloud. |
The documentation for this class was generated from the following file: