-static CAResult_t CALEStop()
-{
- CAResult_t result = CA_STATUS_FAILED;
-
- OIC_LOG(DEBUG, TAG, "Stop Linux BLE adapter.");
-
- // Only stop if we were previously started.
- if (!CALECheckStarted())
- {
- return result;
- }
-
- // Stop the event loop thread regardless of previous errors.
- CALEStopEventLoop(&g_context);
-
- CALETearDownDBus(&g_context);
-
- return result;
-}
-
-static void CALETerminate()
-{
- OIC_LOG(DEBUG, TAG, "Terminate BLE adapter.");
-
- CAPeripheralFinalize();
-
- ca_mutex_lock(g_context.lock);
-
- g_context.on_device_state_changed = NULL;
- g_context.on_server_received_data = NULL;
- g_context.on_client_received_data = NULL;
- g_context.client_thread_pool = NULL;
- g_context.server_thread_pool = NULL;
- g_context.on_client_error = NULL;
- g_context.on_server_error = NULL;
-
- ca_mutex_unlock(g_context.lock);
-
- ca_cond_free(g_context.condition);
- ca_mutex_free(g_context.lock);
-}
-