Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp2059203imn; Mon, 1 Aug 2022 09:36:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR5O1kO7I89qPpNhpPScx8bTJT3zkgzobpIDJ5hjmyeJJiEASvL/+6fKA9qSoMDOm0WUVTx3 X-Received: by 2002:a17:907:3f8f:b0:730:9367:f9c2 with SMTP id hr15-20020a1709073f8f00b007309367f9c2mr2830867ejc.438.1659371783639; Mon, 01 Aug 2022 09:36:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659371783; cv=none; d=google.com; s=arc-20160816; b=MEbI6iJMWOv0ss7r3zze9Ncp0QUxTe7Vq2Z79MzAHNUL3zccHt2AykJsqpiSnWCOvm 86TrZORqP7cWHEyw2gT72VnEZ2WQHUoriYqzuN5FMIwnS5zy9EZS0F46ZymxezhnVzd+ mrEp6GyaQkwX1Oh/Iapi2v6i6vJPjxstiUT4wX6zEKUbKVatqYCzyxuonaWz30tsyGTZ mZE8lBYVkSeDUPhKTZKGRFV5qAgLrAp0fVOzkhzs+vs6ECY1BvnkjPfUXrXxgYPPpov8 hCplaKp15ObBGFfWHSK/EbswHNYc8ECc7ZGzNKsQTlyttRXwP7aciL7OQmltI+3RaPam KJbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=9B2i4grwI/XhViJb4OfP8/IBJigM7VowAoOLHphbaKM=; b=yQKRDoBfbwd0O76rGDt8aCaCqHcbpTkwqzrWRPMebUV7icopmYUq7eZeZ0sho3uaKQ DbqLWZ5ztZwnNqRYN1S4nkno6b6YaaNOr85kcBmzfUpX88ZE2u8Fp8v34uiLEGaSNrIw kTJvk6ivLFW0JSMBz39qQ4nCJ+3qR8Rle7YIZTS4FkKc9qFCPSIxiIJ1GWqmET6OZZml 7jRtGECIVi+kdzeltbywGlm6yV5esLJcOhf8otnP+d93SJ+SuB2WZBm3b77XVEQKMvJT kcUomWA1DsL05TNWduJNa93cDhcop0WdsEpRqi7mJYfY3t6SkqhS2lp8QPKBuNS6LJuD qb8w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sa31-20020a1709076d1f00b007309c417421si481531ejc.398.2022.08.01.09.35.45; Mon, 01 Aug 2022 09:36:23 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231766AbiHAQeD (ORCPT + 99 others); Mon, 1 Aug 2022 12:34:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231439AbiHAQeC (ORCPT ); Mon, 1 Aug 2022 12:34:02 -0400 Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com [209.85.210.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEF8D357F3 for ; Mon, 1 Aug 2022 09:34:00 -0700 (PDT) Received: by mail-ot1-f42.google.com with SMTP id a14-20020a0568300b8e00b0061c4e3eb52aso8584310otv.3 for ; Mon, 01 Aug 2022 09:34:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=9B2i4grwI/XhViJb4OfP8/IBJigM7VowAoOLHphbaKM=; b=rbJdai2OGyvs1+FMgPoiP7kHpAmB0eVNCtsseusm+BUvIowWZxRJm/SsShApJDhARQ EYMxYz008+1XwwPLmrStYoSI6/XIFisGRxqGjV/BQndigz4x2iXvP7Ff4gjA7o1HuaKl bLBaBvCM4jZfBt1D+zBlIOZ3QMJwYoWKDq5lMhjIkIjhAOOJHOLq77DQZ0phNn1qRYuP VTFatpV+CN8kNC2MCsGwwVYQBPOyRh4IBIFcBqqkIXuQrdLssVydzBqWdJFkfEJb0xNy 87ycOrkhP16Gv/9gJPq7z9OuO3Jki1/Q21kgIjJYTUocOWmT3xsoioo20prBS6BfKF+E H9PQ== X-Gm-Message-State: AJIora9N+J+60GOGynQXY3bSKLq/ZqiVFAt57gn8BD1JYh54sOxWFgnr OhaPSZmZwWhWsnsYvlyeKm7vVwtmrPvU6pJA3SRslTbNj28= X-Received: by 2002:a05:6830:140f:b0:61c:df39:3be3 with SMTP id v15-20020a056830140f00b0061cdf393be3mr6010921otp.285.1659371640288; Mon, 01 Aug 2022 09:34:00 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Adam Pigg Date: Mon, 1 Aug 2022 17:33:48 +0100 Message-ID: Subject: Re: GattCharacteristic1 WriteValue fails parameter validation in a GATT Client To: John Klug Cc: Luiz Augusto von Dentz , Linux-Bluetooth MailingList Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no 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 On Mon, 1 Aug 2022 at 17:11, John Klug wrote: > > Luiz Augusto von Dentz writes: > > >You can use AcquireWrite and then write directly to the fd received. > > I tried AcquireWrite as you suggest. The result was "NotSupported". I > should mention that I have tried Nordic's NRF Connect on Android with > the same GATT Server, and it is able to write to this > UUID/characteristic just fine. > > > Using "dbus-monitor --system" I see both read and write flags on my characteristic "service0021/char0046" with the correct UUID: > > > signal time=1659368288.691466 sender=:1.3649 -> destination=(null > destination) serial=968 path=/; > interface=org.freedesktop.DBus.ObjectManager; member=InterfacesAdded > > object path "/org/bluez/hci0/dev_CC_F9_57_89_8B_D8/service0021/char0046" > array [ > dict entry( > string "org.freedesktop.DBus.Introspectable" > array [ > ] > ) > dict entry( > string "org.bluez.GattCharacteristic1" > array [ > dict entry( > string "UUID" > variant string "edf50100-681e-4b92-999c-e16b3a8bc047" > ) > dict entry( > string "Service" > variant object path "/org/bluez/hci0/dev_CC_F9_57_89_8B_D8/service0021" > ) > dict entry( > string "Value" > variant array [ > ] > ) > dict entry( > string "Flags" > variant array [ > string "read" > string "write" > ] > ) > ] > ) > dict entry( > string "org.freedesktop.DBus.Properties" > array [ > ] > ) > ] > > > > However, AcquireWrite replies with "Not Supported" which is the text I see in the error message in my program: > > > method call time=1659368290.693590 sender=:1.3987 -> > destination=org.bluez serial=10 > path=/org/bluez/hci0/dev_CC_F9_57_89_8B_D8/service0021/char0046; > interface=org.bluez.GattCharacteristic1; member=AcquireWrite > > array [ > ] > error time=1659368290.693700 sender=:1.3649 -> destination=:1.3987 error_name=org.bluez.Error.NotSupported reply_serial=10 > string "Operation is not supported" > > Any ideas on where in the BlueZ source I could look for this? Does anyone have an example of doing a GATT Write from a client? I have a watch companion application called Amazfish which does a lot of writing using the DBUS api. I wrote a simple Qt style wrapper around the dbus part which is at https://github.com/piggz/qble , and the app is at https://github.com/piggz/harbour-amazfish . Perhaps something in there will help you. Adam > > > > John Klug