Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5038695rwb; Mon, 21 Nov 2022 15:47:54 -0800 (PST) X-Google-Smtp-Source: AA0mqf7ftIRrMBRQDll2mvBtA2A5/owlMe9AYx9afpMUbF2LsewVRlPgnbqNL2XvX2+uwea8H41+ X-Received: by 2002:a05:6402:5308:b0:460:19c3:2992 with SMTP id eo8-20020a056402530800b0046019c32992mr1492191edb.1.1669074473984; Mon, 21 Nov 2022 15:47:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669074473; cv=none; d=google.com; s=arc-20160816; b=G+PVggUO+vU0ABrzrWG/x3qdVRUXOfsEcnNOR3hw6IidhLOu0IYMxYGAAAP1VVnF6X SGuTSSMYWMhbYeLoEz3H0FGptbUWZVSntCTirk3ez41W1mdN1nxBwtGbh2SlNDjRRErC IkmIFAYz15A5RY7aXodPjZnFz3F+DnhN//w5nBza1NiyEwvDi7NbgBKOKgjcsVhmSJoY kR5GyXFVyk1DWND4cOk9A5/dR0jVDy4l2x5dOHxbqe5+I8hXEa9gO5tVizde2K+bOSWS a1XYNuvUWW+w3O7jbW0Z6reX+h0EBF8JHCcEguKwMNeMhOX9yTsWEq45hPGKE/BfhnRS tpuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QhRSsTOnIdR7xmx+EcZYMhiQ71rMdfXxsrFUNwNBPYs=; b=0Qa7S9LVEprM017kIJHtcIaEHdOFwOobEiHBWis0lD2qCLltvIapEMXKLrwumStnKX rfl/C8QhPW4YbC9uLpQjhiBGltEZLuNbUKHB+WjvAFNYklDY0e/sNa4FbdhcFJCecDud 72UMB12WEoB+mRzhPxVoSGNLPOFmBPmcV245Ele3p5I4l8mevK0Xc0imjNUltyqU//2e 3Ecb+7de5TmoDC09ksKJb478afuaj4L5FyeRG6eB8C2kMjjfMWJdntSwfYYTQxz1SBrC eJ9iZzYtIh3kJUEEgpFYjfTKz19oZxWeUXTg8sbCabxHGYcPuXUDiEOsgcVmlT9/wzh8 6pBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nQGoNp1q; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p26-20020a056402501a00b0045f802c0b98si10319996eda.443.2022.11.21.15.47.19; Mon, 21 Nov 2022 15:47:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nQGoNp1q; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232130AbiKUXqx (ORCPT + 99 others); Mon, 21 Nov 2022 18:46:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231951AbiKUXqU (ORCPT ); Mon, 21 Nov 2022 18:46:20 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00276C6947 for ; Mon, 21 Nov 2022 15:44:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669074288; x=1700610288; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5HjTXE6yASm4fnculIMu637JkLzu9jsyaoxsbFGWhJY=; b=nQGoNp1qtsgIo1BFxaR32SH2eH+DrxmGG188syaHIV3mrN7cFOwLd7FQ 8j9P7+7GYB1i8KQCAWsmYVppH8km+0ashqjLM6ikjDNexiAKdFt/SamXE NSjL2XU7h7wuB6NCfuY7OlvTEtP5fVu3emM2xQRinAcHY+HZORF1OHisS 18pRzd2bzONqBjwJqpX9eRR7KQrKMQlr47TYz/8MZ1YFtvrg0IDdlI3tQ HD+jRYLQaQFm4a4UCuzxr2X8BysO23Oj1RoOBqR7b1YSAFWYw+QTNn6IH YxypcJXvVTV1Or7p8tTID9n1TRkmas8VvggoRTVCo5yr+/G63qpufSkkN w==; X-IronPort-AV: E=McAfee;i="6500,9779,10538"; a="377946609" X-IronPort-AV: E=Sophos;i="5.96,182,1665471600"; d="scan'208";a="377946609" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2022 15:44:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10538"; a="783633470" X-IronPort-AV: E=Sophos;i="5.96,182,1665471600"; d="scan'208";a="783633470" Received: from intel-latitude-e5450.iind.intel.com ([10.224.186.32]) by fmsmga001.fm.intel.com with ESMTP; 21 Nov 2022 15:44:46 -0800 From: Sathish Narasimman To: linux-bluetooth@vger.kernel.org Cc: Sathish Narasimman Subject: [PATCH BlueZ 5/6] monitor/att: Add decoding support for CSIP Date: Tue, 22 Nov 2022 05:16:23 +0530 Message-Id: <20221121234624.2961-6-sathish.narasimman@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221121234624.2961-1-sathish.narasimman@intel.com> References: <20221121234624.2961-1-sathish.narasimman@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This adds decoding support for CSIS attributes --- monitor/att.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/monitor/att.c b/monitor/att.c index d14cbd165697..6fd740aa4cd4 100644 --- a/monitor/att.c +++ b/monitor/att.c @@ -1733,6 +1733,73 @@ static void pac_context_notify(const struct l2cap_frame *frame) print_pac_context(frame); } +static void csip_rank_read(const struct l2cap_frame *frame) +{ + uint8_t rank; + + if (!l2cap_frame_get_u8((void *)frame, &rank)) { + print_text(COLOR_ERROR, "CSIP Rank: invalid size"); + goto done; + } + print_field(" CSIP Rank: %u", rank); + +done: + if (frame->size) + print_hex_field(" Data", frame->data, frame->size); +} + +static void csip_lock_read(const struct l2cap_frame *frame) +{ + uint8_t lock; + + if (!l2cap_frame_get_u8((void *)frame, &lock)) { + print_text(COLOR_ERROR, "CSIP LOCK: invalid size"); + goto done; + } + print_field(" CSIP LOCK: %u", lock); + +done: + if (frame->size) + print_hex_field(" Data", frame->data, frame->size); +} + +static void print_csip_size(const struct l2cap_frame *frame) +{ + uint8_t size; + + if (!l2cap_frame_get_u8((void *)frame, &size)) { + print_text(COLOR_ERROR, "CSIP SIZE: invalid size"); + goto done; + } + print_field(" CSIP SIZE: %u", size); + +done: + if (frame->size) + print_hex_field(" Data", frame->data, frame->size); +} + +static void csip_size_read(const struct l2cap_frame *frame) +{ + print_csip_size(frame); +} + +static void csip_size_notify(const struct l2cap_frame *frame) +{ + print_csip_size(frame); +} + +static void csip_sirk_read(const struct l2cap_frame *frame) +{ + if (frame->size) + print_hex_field(" SIRK", frame->data, frame->size); +} + +static void csip_sirk_notify(const struct l2cap_frame *frame) +{ + if (frame->size) + print_hex_field(" SIRK", frame->data, frame->size); +} + static void print_vcs_state(const struct l2cap_frame *frame) { uint8_t vol_set, mute, chng_ctr; @@ -2413,6 +2480,12 @@ struct gatt_handler { GATT_HANDLER(0x2b7d, vol_state_read, NULL, vol_state_notify), GATT_HANDLER(0x2b7e, NULL, vol_cp_write, NULL), GATT_HANDLER(0x2b7f, vol_flag_read, NULL, vol_flag_notify), + + GATT_HANDLER(0x2b84, csip_sirk_read, NULL, csip_sirk_notify), + GATT_HANDLER(0x2b85, csip_size_read, NULL, csip_size_notify), + GATT_HANDLER(0x2b86, csip_lock_read, NULL, NULL), + GATT_HANDLER(0x2b87, csip_rank_read, NULL, NULL), + GATT_HANDLER(0x2b93, mp_name_read, NULL, mp_name_notify), GATT_HANDLER(0x2b96, NULL, NULL, track_changed_notify), GATT_HANDLER(0x2b97, track_title_read, NULL, track_title_notify), -- 2.25.1