From: injun.yang Date: Tue, 5 Mar 2019 07:36:29 +0000 (+0900) Subject: Deinitialize gatt server properly X-Git-Tag: accepted/tizen/unified/20190611.050050~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git;a=commitdiff_plain;h=51f699be6740725518ddf59cb6a5536e7fc62181 Deinitialize gatt server properly [Model] All [BinType] AP [Customer] OPEN [Issue#] N/A [Request] Internal [Occurrence Version] N/A [Problem] register gatt server -> bluetoothd terminated abnormally -> unregister gatt server -> bt-frwk recovery BT-> register gatt server -> crash [Cause & Measure] After BT disabled, gatt server is not deinitialized properly. [Checking Method] n/a [Team] IoT Hub [Developer] Injun Yang [Solution company] Samsung [Change Type] Specification change Change-Id: I6f4356e12e05073656d56302d7e6c39883fc96f2 Signed-off-by: injun.yang Signed-off-by: DoHyun Pyun --- diff --git a/bt-api/bt-gatt-service.c b/bt-api/bt-gatt-service.c index 0842b8a..6a4cc6c 100644 --- a/bt-api/bt-gatt-service.c +++ b/bt-api/bt-gatt-service.c @@ -1566,7 +1566,8 @@ BT_EXPORT_API int bluetooth_gatt_unregister_application(void) if (err != NULL) { BT_ERR("D-Bus API failure: errCode[%x], message[%s]", err->code, err->message); - if (err->code == G_DBUS_ERROR_SERVICE_UNKNOWN) { + if (err->code == G_DBUS_ERROR_SERVICE_UNKNOWN || + g_strrstr(err->message, BT_ERROR_DOES_NOT_EXIST)) { g_clear_error(&err); goto done; } diff --git a/bt-api/include/bt-common.h b/bt-api/include/bt-common.h index bda9c40..75a7a13 100644 --- a/bt-api/include/bt-common.h +++ b/bt-api/include/bt-common.h @@ -216,6 +216,7 @@ extern "C" { #define BT_ERROR_BUSY "InProgress" #define BT_ERROR_INVALID_PARAM "InvalidArguments" #define BT_ERROR_ALREADY_EXIST "AlreadyExists" +#define BT_ERROR_DOES_NOT_EXIST "DoesNotExist" #define BT_ERROR_ALREADY_CONNECTED "Already Connected" #define BT_ERROR_NO_MEMORY "No memory" #define BT_ERROR_NO_DATA "No data"