From 48a17a4e61aa8a6b50d5a716c0e16eb30d360261 Mon Sep 17 00:00:00 2001 From: Gowtham Anandha Babu Date: Thu, 29 Jun 2017 15:12:36 +0530 Subject: [PATCH] [OTP] Fix PTS fail cases The patch fixes below TCs: 1) OTS/SR/CR/BV-01-C 2) All OACP & OLCP cases (Modify indication length) Change-Id: I920f49b6126b8da855770aa0833878db01691667 Signed-off-by: Gowtham Anandha Babu --- bt-otp/bt-otpserver.c | 10 ++++++---- bt-otp/bt-otpserver.h | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bt-otp/bt-otpserver.c b/bt-otp/bt-otpserver.c index 4948a8c..c68068d 100644 --- a/bt-otp/bt-otpserver.c +++ b/bt-otp/bt-otpserver.c @@ -298,8 +298,8 @@ int _bt_otp_prepare_ots(void) char *desc_uuid; bt_gatt_characteristic_property_t props; bt_gatt_permission_t perms; - char supp_feat[OTP_FEATURE_LENGTH] = { 0xDC, 0x00, 0x00, 0x00, - 0x80, 0x00, 0x00, 0x00 }; + char supp_feat[OTP_FEATURE_LENGTH] = { 0x3B, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00 }; ret = bluetooth_gatt_init(); if (ret != BLUETOOTH_ERROR_NONE) { @@ -1558,6 +1558,7 @@ static void _bt_otp_send_indication(const char *obj_path, { int ret = BLUETOOTH_ERROR_NONE; char value[7] = {0x00}; + int length = OTP_INDICATION_LEN_WITHOUT_RESP; BT_DBG(""); @@ -1569,12 +1570,13 @@ static void _bt_otp_send_indication(const char *obj_path, value[5] = (info->resp_param[4] >> 16) & 0xFF; value[4] = (info->resp_param[5] >> 8) & 0xFF; value[3] = info->resp_param[6] & 0xFF; + length = OTP_INDICATION_LEN_WITH_RESP; } BT_DBG("Opcode: %d", value[1]); /* Store the status value */ - _bt_otp_set_char_value(obj_path, value, 7); + _bt_otp_set_char_value(obj_path, value, length); /* Send indication */ ret = bluetooth_gatt_server_set_notification(obj_path, remote_address); @@ -1582,7 +1584,7 @@ static void _bt_otp_send_indication(const char *obj_path, BT_ERR("_bt_otp_send_control_point_indication failed"); return; } - ret = bluetooth_gatt_update_characteristic(obj_path, value, 7); + ret = bluetooth_gatt_update_characteristic(obj_path, value, length); if (ret != BLUETOOTH_ERROR_NONE) { BT_ERR("_bt_otp_send_control_point_indication failed"); return; diff --git a/bt-otp/bt-otpserver.h b/bt-otp/bt-otpserver.h index 365f13a..358a849 100755 --- a/bt-otp/bt-otpserver.h +++ b/bt-otp/bt-otpserver.h @@ -75,6 +75,8 @@ /* Object Metadata Length */ #define OTP_FEATURE_LENGTH 8 +#define OTP_INDICATION_LEN_WITHOUT_RESP 3 +#define OTP_INDICATION_LEN_WITH_RESP 7 /* Object ID range defined by SIG. */ #define OBJECT_START_ID 256 -- 2.7.4