[OTP] Fix PTS fail cases
[platform/core/connectivity/bluetooth-frwk.git] / bt-otp / bt-otpserver.c
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;