Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp1051946rdb; Fri, 20 Oct 2023 07:13:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGVsQfP2IyMWluEOPlk6RNT6puRB/VUif1ned8gKrimSpkr6pFLVF8n9zmIb2rxHIQGBMr6 X-Received: by 2002:a05:6a21:3398:b0:174:1466:359c with SMTP id yy24-20020a056a21339800b001741466359cmr1996747pzb.61.1697811235681; Fri, 20 Oct 2023 07:13:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697811235; cv=none; d=google.com; s=arc-20160816; b=VUhQTq0W41ZsyYdZTU0EXCX33acWCoN/sY0VOpgyE3Sy1rXx8x5kt4IjCb4qTFSH5f i9/hQ/D/9279KnsjhoYkLDHdF81qypaU79YC5AiyNlz43o4evTSMmVFoiiCZ1Qk1shR+ H1t16WrRjMe9xXEfpNJNOYfxwOwDqWiFKVTgxh27PgEExRe39/uHFhI+WgLfRMfEz2uc aaO0WZW1rHsGA+fGUvVTCAevmWiztXeGY4p+mEBwprvcallblhNiXzosSHIIOCIt/Q0v hoPQCEqHibyFxgfhawfzeMnHCMhKqYA0wcuj9bkkzqjVwy627OOYaIT0L69OXmJiGDK2 PqCw== 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=XZt+UvfvSVjJbWw+mJVqNecFvl0pvQPP4y1EEV52h3U=; fh=U3ev7U7uX1ilviB+nfdu7oOFhneDnAUw+Nb8W7HsKBg=; b=K4knFnX6FyybHS/sAhnZmFxluxEcjwJkaTXrSEPFKMaWIwJDPm8xoX8Dpb/GJgLYtQ ZoQjdIeTb9IqvXIEJQr5+NOkVg+uUvpZiPeISO41DTRQDGqXsJWxmFTMAS/gxf1DDzlE VLA5GcvnIqdxNB8IQcU6yLcW9QPVefXI+Cc+TXIpHebTRDZ4dAoI+i3WXb8cAQ+S87p0 Y0fF7CcfUnbr035tPkkbtAR4pd32S1LhI5OI9/mKjHvGOL4A5+KNUAF1XTH+GGXAKiTv 4SdniHj11MLkBATMM/cd0u3Muz1qin19PSMlQIgsyjkbIJuGzcET/7TqsOabYN9S18Ye 6BrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NO6gTAmY; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id oa8-20020a17090b1bc800b0027cde38c731si4773650pjb.17.2023.10.20.07.13.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 07:13:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NO6gTAmY; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 167DB83FC3AB; Fri, 20 Oct 2023 07:13:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377540AbjJTONt (ORCPT + 99 others); Fri, 20 Oct 2023 10:13:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377535AbjJTONt (ORCPT ); Fri, 20 Oct 2023 10:13:49 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B8E6D5A for ; Fri, 20 Oct 2023 07:13:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697811227; x=1729347227; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=djb+3OFt+//850NJe6tJIgHp8zlYEwTlsouldHOC21A=; b=NO6gTAmY6UKp2fz421KiEpi2lZE/rbKfo9TWeMD61+FOiIYjPFz1p1oX CpLnPzzZulsznl2ls3DJ/qIny+QMjrJYyXXv6uENd1jYmNG97HRPIBSj5 flfSuC9kq/1fLE5m94lxmfJWoXmwJQ2QYhHryaA5jrMXfAU7uF8ODjYJb oRrQZEbKG19BPZkGx4Fy+e7fVXzev8GJl37gkQRDb623lkd/8r+Fcdy8A ex2LN+KXskOnCRCj8+jgmfN+GV/HECvCb+mDKwehoEdFB2bocTO3VmACd OPxUkEhIBgI3MzaPp19YFC6s4tkbi5mPXpLQoFtnFRtadi742NST646eK w==; X-IronPort-AV: E=McAfee;i="6600,9927,10869"; a="365840907" X-IronPort-AV: E=Sophos;i="6.03,239,1694761200"; d="scan'208";a="365840907" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2023 07:13:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10869"; a="1088756514" X-IronPort-AV: E=Sophos;i="6.03,239,1694761200"; d="scan'208";a="1088756514" Received: from intel-lenovo-legion-y540-15irh-pg0.iind.intel.com ([10.224.186.95]) by fmsmga005.fm.intel.com with ESMTP; 20 Oct 2023 07:13:45 -0700 From: Kiran K To: linux-bluetooth@vger.kernel.org Cc: ravishankar.srivatsa@intel.com, Kiran K Subject: [PATCH v1 5/5] media: Parse conext and supported context Date: Fri, 20 Oct 2023 19:55:54 +0530 Message-Id: <20231020142554.486629-5-kiran.k@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020142554.486629-1-kiran.k@intel.com> References: <20231020142554.486629-1-kiran.k@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 20 Oct 2023 07:13:53 -0700 (PDT) Allow clients to register available context and supported context for bap endpoint. --- profiles/audio/media.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/profiles/audio/media.c b/profiles/audio/media.c index d0520d3216c9..69f77a80c8ea 100644 --- a/profiles/audio/media.c +++ b/profiles/audio/media.c @@ -1613,6 +1613,15 @@ static int parse_properties(DBusMessageIter *props, const char **uuid, if (var != DBUS_TYPE_UINT32) return -EINVAL; dbus_message_iter_get_basic(&value, &qos->location); + } else if (strcasecmp(key, "Context") == 0) { + if (var != DBUS_TYPE_UINT16) + return -EINVAL; + dbus_message_iter_get_basic(&value, &qos->context); + } else if (strcasecmp(key, "SupportedContext") == 0) { + if (var != DBUS_TYPE_UINT16) + return -EINVAL; + dbus_message_iter_get_basic(&value, + &qos->supported_context); } dbus_message_iter_next(props); @@ -2810,6 +2819,20 @@ static void app_register_endpoint(void *data, void *user_data) dbus_message_iter_get_basic(&iter, &qos.location); } + if (g_dbus_proxy_get_property(proxy, "Context", &iter)) { + if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_UINT16) + goto fail; + + dbus_message_iter_get_basic(&iter, &qos.context); + } + + if (g_dbus_proxy_get_property(proxy, "SupportedContext", &iter)) { + if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_UINT16) + goto fail; + + dbus_message_iter_get_basic(&iter, &qos.supported_context); + } + endpoint = media_endpoint_create(app->adapter, app->sender, path, uuid, delay_reporting, codec, vendor.cid, vendor.vid, &qos, -- 2.34.1