Getting the State of the Usage Intelligence Instance
The ruiGetState() function returns a RUISTATE value that contains the state of the Usage Intelligence instance. The SDK state can change asynchronously.
This function can be called more than once.
This function is a synchronous function.
RUISTATE ruiGetState(RUIINSTANCE* ruiInstance)
                                        
Parameters
The ruiGetState() function has the following parameters.
| Parameter | Description | 
| ruiInstance (RUIINSTANCE*) | Pointer to the Usage Intelligence instance created via ruiCreateInstance(). | 
Returns
The ruiGetState() function returns one of the return status constants below.
| Return | Description | 
| RUI_SDK_STATE_FATAL_ERROR | Irrecoverable internal fatal error. No further API calls should be made | 
| RUI_SDK_STATE_UNINITIALIZED | Instance successfully created (ruiCreateInstance()) but not yet successfully configured ruiCreateConfig(). | 
| RUI_SDK_STATE_CONFIG_INITIALIZED_NOT_STARTED | Successfully configured and not yet started via ruiStartSDK(). | 
| RUI_SDK_STATE_STARTED_NEW_REG_RUNNING | Running ruiStartSDK() with a New Registration in progress but not yet completed. | 
| RUI_SDK_STATE_RUNNING | Running ruiStartSDK() with no need for New Registration or with successfully completed New Registration. | 
| RUI_SDK_STATE_ABORTED_NEW_REG_PROXY_AUTH_FAILURE | Aborted run ruiStartSDK() due to failed New Registration. | 
| RUI_SDK_STATE_ABORTED_NEW_REG_NETWORK_FAILURE | Aborted run ruiStartSDK() due to failed New Registration. | 
| RUI_SDK_STATE_ABORTED_NEW_REG_FAILED | Aborted run ruiStartSDK() due to failed New Registration. | 
| RUI_SDK_STATE_SUSPENDED | Instance has been instructed by Server to back-off. Will return to running once back-off cleared. | 
| RUI_SDK_STATE_PERMANENTLY_DISABLED | Instance has been instructed by Server to disable. This is a permanent, irrecoverable state. | 
| RUI_SDK_STATE_STOPPING_NON_SYNC | Stop in progress ruiStopSDK(). Stopping non-Sync-related threads. | 
| RUI_SDK_STATE_STOPPING_ALL | Stop in progress ruiStopSDK(). Stopping Sync-related threads. | 
| RUI_SDK_STATE_STOPPED | Stop completed ruiStopSDK() | 
| RUI_SDK_STATE_OPTED_OUT | Instance has been instructed by the application to opt-out. |