From f4f22017920cf9ed1bfc33186019afd65749fb2a Mon Sep 17 00:00:00 2001 From: Deokhyun Kim Date: Fri, 9 Aug 2019 11:55:34 +0900 Subject: [PATCH] Add disconnection reason for logging BLUETOOTH_ERROR_CONNECTION_REJECTED_DUE_TO_SECURITY_REASONS Change-Id: I6ef3473667c892b66c2934348bf1b10924a7e3f6 Signed-off-by: Deokhyun Kim --- bt-service/bt-service-common.c | 14 ++++++++------ include/bluetooth-api.h | 1 + 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/bt-service/bt-service-common.c b/bt-service/bt-service-common.c index e50f6f6..dd57eda 100644 --- a/bt-service/bt-service-common.c +++ b/bt-service/bt-service-common.c @@ -1028,18 +1028,20 @@ const char *_bt_convert_disc_reason_to_string(int reason) switch (reason) { case (int)BLUETOOTH_ERROR_PAGE_TIMEOUT: return "Page timeout"; - case (int)BLUETOOTH_ERROR_CONNECTION_TIMEOUT: - return "Link loss"; + case (int)BLUETOOTH_ERROR_AUTH_FAILURE: + return "Authentication Failure"; case (int)BLUETOOTH_ERROR_PIN_OR_KEY_MISSING: return "PIN or Key missing"; - case (int)BLUETOOTH_ERROR_LOCAL_HOST_TERM: - return "Connection terminated by local host"; + case (int)BLUETOOTH_ERROR_CONNECTION_TIMEOUT: + return "Link loss"; + case (int)BLUETOOTH_ERROR_CONNECTION_REJECTED_DUE_TO_SECURITY_REASONS: + return "Connection rejected due to security reasons"; case (int)BLUETOOTH_ERROR_REMOTE_USER_TERM: case (int)BLUETOOTH_ERROR_REMOTE_LOW_RESOURCES: case (int)BLUETOOTH_ERROR_REMOTE_POWER_OFF: return "Remote user terminated connection"; - case (int)BLUETOOTH_ERROR_AUTH_FAILURE: - return "Authentication Failure"; + case (int)BLUETOOTH_ERROR_LOCAL_HOST_TERM: + return "Connection terminated by local host"; case (int)BLUETOOTH_ERROR_REPEATED_ATTEMPTS: return "Repeated attempts"; case (int)BLUETOOTH_ERROR_LMP_RESPONSE_TIMEOUT: diff --git a/include/bluetooth-api.h b/include/bluetooth-api.h index af81b14..f7cca5f 100644 --- a/include/bluetooth-api.h +++ b/include/bluetooth-api.h @@ -245,6 +245,7 @@ extern "C" { #define BLUETOOTH_ERROR_AUTH_FAILURE 0x05 #define BLUETOOTH_ERROR_PIN_OR_KEY_MISSING 0x06 #define BLUETOOTH_ERROR_CONNECTION_TIMEOUT 0x08 +#define BLUETOOTH_ERROR_CONNECTION_REJECTED_DUE_TO_SECURITY_REASONS 0x0e #define BLUETOOTH_ERROR_REMOTE_USER_TERM 0x13 #define BLUETOOTH_ERROR_REMOTE_LOW_RESOURCES 0x14 #define BLUETOOTH_ERROR_REMOTE_POWER_OFF 0x15 -- 2.7.4