[OTP] Fix PTS fail cases 09/136409/2
authorGowtham Anandha Babu <gowtham.ab@samsung.com>
Thu, 29 Jun 2017 09:42:36 +0000 (15:12 +0530)
committerGowtham Anandha Babu <gowtham.ab@samsung.com>
Thu, 29 Jun 2017 10:29:23 +0000 (15:59 +0530)
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 <gowtham.ab@samsung.com>
bt-otp/bt-otpserver.c
bt-otp/bt-otpserver.h

index 4948a8c..c68068d 100644 (file)
@@ -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;
index 365f13a..358a849 100755 (executable)
@@ -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