#include "bt-service-audio-common.h"
#include "bt-service-avrcp-tg.h"
#include "bt-service-avrcp-ctrl.h"
+#include "bt-service-gatt.h"
#ifdef TIZEN_DPM_ENABLE
#include "bt-service-dpm.h"
return;
_bt_check_hdp_app_termination(name);
+
+ /* Advertising App Termination */
+ _bt_check_adv_app_termination(name);
}
int _bt_service_register(void)
static void __bt_gatt_event_handler(int event_type, gpointer event_data);
+void _bt_check_adv_app_termination(const char *name)
+{
+ bt_service_app_info_t *app = NULL;
+ int k;
+ int result = OAL_STATUS_SUCCESS;
+
+ BT_DBG("Adv app name [%s]", name);
+
+ ret_if(NULL == name);
+
+ for (k = 1; k < MAX_APPS_SUPPORTED; k++) {
+ app = &numapps[k];
+
+ /* Search for a app which has same sender */
+ if (!strncasecmp(app->sender, name, strlen(name)) && app->is_initialized == TRUE) {
+ BT_DBG("Match found, name: %s", name);
+
+ /* If Advertising is enabled, stop it */
+ if (app->adv_handle > 0) {
+ BT_INFO("Stop advertising on instance ID [%d]", app->instance_id);
+ result = adapter_ble_multi_adv_disable(app->instance_id);
+ if (result != OAL_STATUS_SUCCESS) {
+ BT_ERR("OAL API adapter_ble_multi_adv_enable Fail %d", result);
+ }
+ }
+ /* TODO: Cleanup all Services, chars and Descriptors of the associated GATT server */
+
+ /* Unregister the server instance */
+ _bt_unregister_server_instance(name, app->adv_handle);
+ }
+ }
+
+ BT_DBG("-");
+}
+
void _bt_get_adv_handle_from_instance(int server_inst, int *adv_handle)
{
BT_DBG("+");