Result Code - IoT SDK
The IoT SDK reports the outcome of every operation with a result code, so you can confirm success and handle failures precisely. Each code below is an enum constant you can check across publishing, subscribing, messaging, and other SDK calls.
| Enum Constant | Value | Description |
|---|---|---|
RESULT_OK | 0 | Operation completed successfully with no errors. |
SSL_CONNECT_FAILED | 3001 | SSL handshake errors occur when the client and server fail to establish a secure connection due to mismatched protocols, certificates, or cipher suites. |
HTTP_REQUEST_FAILED | 3002 | The HTTP request could not be sent from the device, or the server did not respond to the request. |
MEMORY_ALLOC_FAILED | 3003 | The system failed to allocate memory because the requested buffer size exceeded the available heap. |
DEVICE_NOT_SUPPORTED | 3004 | The board does not have the hardware for that direction: receiving audio needs a speaker and receiving video needs a display. The subscribe calls return this code on boards without that hardware (expected, not a failure). See Supported Microcontrollers. |
NULL_PARAMETER | 3005 | A function call failed because a required input parameter was NULL or empty, resulting in an invalid operation. Ensure all required parameters are properly initialized before invoking the function. |
INIT_BOARD_FAILED | 3006 | Initialization of the board or audio codec hardware failed, preventing proper device setup. |
PEER_INIT_FAILED | 3007 | SRTP connection initialization failed due to cryptographic or configuration errors. |
TASK_ALREADY_STARTED | 3008 | An attempt was made to start a task that was already running. To resolve this, stop the task first and then try again. |
PUBLISH_MUTEX_CREATE_FAILED | 3009 | Failed to create a mutex required for synchronizing the media publishing operation. |
AUDIO_CODEC_INIT_FAILED | 3010 | Audio codec initialization failed due to a codec mismatch. Try using a different codec to resolve the issue. |
PUBLISH_PEER_CONNECTION_FAILED | 3011 | The peer connection setup for publishing failed, usually due to signaling or transport issues. |
PUBLISH_MEMORY_ALLOC_FAILED | 3012 | The system failed to allocate the memory required for the publishing process. |
PUBLISH_TASK_CREATE_FAILED | 3013 | Task creation for handling media publishing failed, often due to insufficient or incorrect parameters. |
SUBSCRIBE_MUTEX_CREATE_FAILED | 3014 | Failed to create a mutex required for synchronizing the media subscription operation. |
SUBSCRIBE_PEER_CONNECTION_FAILED | 3015 | The peer connection setup for subscribing to media failed, typically due to negotiation or network errors. |
SUBSCRIBE_MEMORY_ALLOC_FAILED | 3016 | The system failed to allocate the memory required for the subscribing process. |
SUBSCRIBE_TASK_CREATE_FAILED | 3017 | Task creation for handling subscriptions failed, often due to insufficient resources. |
STOP_PUBLISH_TASK_CREATE_FAILED | 3018 | leave() could not start tearing down the publishing side, so nothing was torn down and the session is still active. Free some memory and call leave() again. |
STOP_SUBSCRIBE_TASK_CREATE_FAILED | 3019 | leave() could not start tearing down the subscribing side, so nothing was torn down and the session is still active. Free some memory and call leave() again. |
CANDIDATE_PAIR_FAILED | 3020 | ICE candidate pair checks failed, which means no valid network path was found between peers. |
DTLS_HANDSHAKE_FAILED | 3021 | The DTLS handshake between peers failed due to a certificate or cryptographic mismatch. |
LEAVE_FAILED | 3022 | Teardown started but did not finish within 6 seconds, so something is stuck. Unlike 3018/3019, the session is not left intact, so do not assume it is safe to rejoin immediately. |
INIT_NOT_CALLED | 3023 | This error occurs when the init() function was not called before using other functions like publish() or subscribe(). To resolve this, call init() first. |
DATA_CHANNEL_NOT_STARTED | 3025 | sendMessage() was called before startMessageChannel(). Call startMessageChannel() once before sending messages. |
DATA_CHANNEL_QUEUE_FULL | 3026 | The message send queue is momentarily full, so the message was not queued. Retry shortly. |
Got a Question? Ask us on discord