From patchwork Sat Sep 7 20:49:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vibhav Pant X-Patchwork-Id: 827103 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DFE79166F0C for ; Sat, 7 Sep 2024 20:49:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725742193; cv=none; b=hDms+50pTKSGCHmp5hVfgTcNRY31n3MT/FzGeOOdXff11uAVowbqVcbJvG/Kj4WhSXFXBBryT8BNakEW8e/37YdtarM44WYZdCyKxilo5lYHAkioY6aErjHCCoxJ7+tboj8L3tJxm0CDYSo85xIEShIbkk5SVKK0j4dXMywlNZg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725742193; c=relaxed/simple; bh=F7RRfgvr8DE4+z/p31uILT00fnTp8gu/QZvApCeJKwk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=PZ6XmEi9lkGTb0cBxQYGzDoot8MBy/3J07Xvl1HlrAx0JIFJ7o0ocT6zrbObVwMlU++G1naOKK+gSx0lbTu9Th0Niinhe48YtttsaunKhmmpRGXmSvcDVXRTx9f8QVNEARBXcR8LTy5bUrI5Isl4oDGqQOeQCJ141ZrHTxzy2Ic= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=IzGoG0Fn; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IzGoG0Fn" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-374c7e64b60so1746628f8f.2 for ; Sat, 07 Sep 2024 13:49:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725742190; x=1726346990; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=bpvdD76SgdEUjB7HbU4UN48WgtwMtCq3ktG5BLJX0n8=; b=IzGoG0FnbS0HrjprE3HNKpBTiQdB0muy2vayGTLfJYg3YFtmBx+MeZl8nZXwZ3T1uX xqLFy5ibtyuHsKkPvv1Oj74mU7kt5EeMt1LyGGF6Q/3eBmDgw8TgsLniwehRgTDjVpbw VY8DbkZYk9IXCzzazIBawX5KMWBnOydZssDXgOdJt04Dn8vWcVcUonHkRh3kPM1wO8lf aWqj9OVCMdxJF7OqU2c30r+bqBErvdgf1DWShxE/f5TpORqQ1N08Gsd3rQHIdKnFq5nG eskEEH0IeGI7zywsQKN3o1tAV3UtiMqKpK4U4hNWNJvXe9NDdpuIiOLSKRPJFLx7bNL5 Vsxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725742190; x=1726346990; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bpvdD76SgdEUjB7HbU4UN48WgtwMtCq3ktG5BLJX0n8=; b=C8+CVeMZY9hyr83AoJi03NTMHIClnK5HyyztikrhEdF2FxRejI30LJZAnOWB2bDBdY nLbRxB1ywblsZLlC6+Rptd1m4pan7x4JoB5L4ZgYIDWshvBgVzMw0g3nX+B23//uneHz 0mHBG82Kl3rYXX71tcxB701WZbp7DmuaFs0cdknQiq8CPZGkQOKYUzyAr1WnyVJXXlHv exDvGRLqTTKjKrIFZ/f5H42vL9Yq6k74Hwjix9WvocDoAmI9eJ6HScxjlAwmuCdHW1NN 0F0lAR9uNyP+y6k6g8uIDTnMSGFS/ZgtRrDtfudBaME+43ovCCzCd1N2dhvUHziNSJXf s1Aw== X-Gm-Message-State: AOJu0YzvdVekDFg4pLV2HBM3jUCnHw+/xolqPzzpbO9khoFgzCQW50dd Y+P+QuDtMWGWaoqY+CtwsO55pn0AAjE4XZVdUGDKSYfDS/qfXjCw3R9Nuw== X-Google-Smtp-Source: AGHT+IG3+++ZD32lk1WmXWVEVxSNDc8Lde6me1P+b+xb3z9w8CoFfxan6TSwzPbzjcl+KdKmHB7hSQ== X-Received: by 2002:adf:ffc9:0:b0:374:badf:966f with SMTP id ffacd0b85a97d-378895c4b83mr4485459f8f.7.1725742189421; Sat, 07 Sep 2024 13:49:49 -0700 (PDT) Received: from vibhavp-an515-58.lan ([2401:4900:1c62:13d2:d7f9:63c9:9aab:1368]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378956dd9dcsm2053698f8f.92.2024.09.07.13.49.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Sep 2024 13:49:48 -0700 (PDT) From: Your Name To: linux-bluetooth@vger.kernel.org Cc: Vibhav Pant Subject: [PATCH BlueZ 1/2] device: Add ConnectionType property. Date: Sun, 8 Sep 2024 02:19:40 +0530 Message-ID: <20240907204941.8006-1-vibhavp@gmail.com> X-Mailer: git-send-email 2.46.0 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Vibhav Pant --- src/device.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/device.c b/src/device.c index 0f18c8c7f..fa149f1d4 100644 --- a/src/device.c +++ b/src/device.c @@ -1003,6 +1003,32 @@ static gboolean dev_property_exists_class(const GDBusPropertyTable *property, return device->class != 0; } +static gboolean +dev_property_get_connection_type(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *data) +{ + struct btd_device *device = data; + const char *str; + + if (device->le && device->bredr) + str = "dual"; + else if (device->le) + str = "le"; + else + str = "bredr"; + dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &str); + return TRUE; +} + +static gboolean +dev_property_exists_connection_type(const GDBusPropertyTable *property, + void *data) +{ + struct btd_device *device = data; + + return device->bredr || device->le; +} + static gboolean dev_property_get_class(const GDBusPropertyTable *property, DBusMessageIter *iter, void *data) { @@ -3234,6 +3260,8 @@ static const GDBusPropertyTable device_properties[] = { { "Alias", "s", dev_property_get_alias, dev_property_set_alias }, { "Class", "u", dev_property_get_class, NULL, dev_property_exists_class }, + { "ConnectionType", "s", dev_property_get_connection_type, NULL, + dev_property_exists_connection_type }, { "Appearance", "q", dev_property_get_appearance, NULL, dev_property_exists_appearance }, { "Icon", "s", dev_property_get_icon, NULL, From patchwork Sat Sep 7 20:51:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vibhav Pant X-Patchwork-Id: 826314 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C6A2C3D982 for ; Sat, 7 Sep 2024 20:51:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725742314; cv=none; b=XDJjSpnwZ9WnY1b6V91q3kSzFWs/FYXBEPvzGlwq3zBWs+9Uslbq8XtpTHwB74B6CajV9NqHicXNclytm0eUGB0d+TdKottbQUoiikvKpIsP6XVhtcgiB79PiINbEbJAIiDOPLfVO66fN5vcka48ZXa85/VLs0cY26S9wqE7ZxE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725742314; c=relaxed/simple; bh=aDNySAO6yG4fFDFYPMfyLw0Q78w1IYmd1cPjFVafACQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Q06wWLFdHjLMbRZ3XB6WaAKJrIEOxuF2kQRB8T833viDNvfOisKm2/EXaQFjnb6TZPeM6Lvo1EkiCrh63N68gOyd8wmNYOMn4B0fs1NPCMuGcnJBsohuafyq58Fhd50k/hUpTrRH62+iL5e5dNngFOQnF/0AdLZtpnIsS+GJY5c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VigA6PUF; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VigA6PUF" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-206aee4073cso31575845ad.1 for ; Sat, 07 Sep 2024 13:51:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725742311; x=1726347111; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=y7nT5xjXg7qsIesQ0p79ocbL3I+Q+QHFC8bs8vDnDgo=; b=VigA6PUF6lRlDvZbBuZqu5Qwo3xdHw6DoYOaPNL5ZB4bM/CdD1yu7pOOWQ2y6FJLNk qbUH3NEpd1DC4pnuTg/B2Lr3JSbJqRm3ltVs6g9MnMD3scQjjCcf3QU6MtPfnkrCAaOC ZrLRPxFKyz4vDfvqi7diM0mWAxvOpodUAiDTMQxrWXc98TLvItPeNCMthhh7OlKWxA7f Wl0fTa83KqmwGirIXZ/48iVF5DFjl1U/nX8pqYwWmlihGmKfA1RTTdg34ILwvjptR6Lc 8rHVSEfg+7/9mMhu+S9WwpBwAPsrOBiP9moMuZa4PyzaYEQGxItiyyJNCvzWFQ35fPIB uvsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725742311; x=1726347111; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=y7nT5xjXg7qsIesQ0p79ocbL3I+Q+QHFC8bs8vDnDgo=; b=JkIeLInJr0lpCU1OzXJ2j0Y9rQ4afmCH3yHjkNG0R5ZVoz1o2WoyJbEJto+FUuwbtL o2ncEPSe5rXBPT8ENUBmHPnupfG4xENqaTXYJGXiz+FHQq8wKZnjCSunEvpyalDQbEw+ xXdXil5HWukpRm8CUreQg1R2OXTVcaBlw9VxWFLjlEvZSAn2ZiERKYjAXALbfmOmraID Y6PSPzHK7mfrl4B6hP0wVeYHo+MmkNzH4duj1yuShorOdpOkDNoXOotLh/5RSuQnjHa1 BzREdWqteEiz5YZtOCeqWUdWtsn+ctEaJ8RpxDhwIPjXEes+f3M0QVLBZjog02YmrCdJ Ir0w== X-Gm-Message-State: AOJu0YxSNjQVBcOC3SAUe/zFBFHg3iCdXKPqwW32H1NEgPJcZaMKxUh/ erJXJQmURVBxr8Vl5cm8ZGPalKw4aom8xx0hrl5JTPgg0PkVNWaIWX+JOQ== X-Google-Smtp-Source: AGHT+IEx5lnKo9M62WlV60Duxs7F5/9t+vr/qz1RBtcA35aA3wp6vwUqVShJqpAzS6ts/UM52fI+2Q== X-Received: by 2002:a17:903:2303:b0:206:c12d:abad with SMTP id d9443c01a7336-206f05523e9mr113172895ad.34.1725742311301; Sat, 07 Sep 2024 13:51:51 -0700 (PDT) Received: from vibhavp-an515-58.lan ([122.161.69.235]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20710eea95esm12046995ad.161.2024.09.07.13.51.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Sep 2024 13:51:50 -0700 (PDT) From: Your Name To: linux-bluetooth@vger.kernel.org Cc: Vibhav Pant Subject: [PATCH BlueZ 2/2] org.bluez.Device: Add documentation for ConnectionType. Date: Sun, 8 Sep 2024 02:21:46 +0530 Message-ID: <20240907205146.8977-1-vibhavp@gmail.com> X-Mailer: git-send-email 2.46.0 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Vibhav Pant --- doc/org.bluez.Device.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/org.bluez.Device.rst b/doc/org.bluez.Device.rst index f94fc2129..ca3c4664a 100644 --- a/doc/org.bluez.Device.rst +++ b/doc/org.bluez.Device.rst @@ -161,6 +161,16 @@ string AddressType [readonly] Random address +string ConnectionType [readonly] +```````````````````````````````` + The Bluetooth device connection type. + + Possible values: + + :"bredr": + :"le": + :"dual": + string Name [readonly, optional] ````````````````````````````````