[no subject]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



        if (length +ADw- 4) +AHs-
                ecode +AD0- BT+AF8-ATT+AF8-ERROR+AF8-INVALID+AF8-PDU+ADs-
                goto error+ADs-
        +AH0-

        if (queue+AF8-length(server-+AD4-prep+AF8-queue) +AD4APQ- server-+AD4-max+AF8-prep+AF8-queue+AF8-len) +AHs-
                ecode +AD0- BT+AF8-ATT+AF8-ERROR+AF8-PREPARE+AF8-QUEUE+AF8-FULL+ADs-
                goto error+ADs-
        +AH0-

        handle +AD0- get+AF8-le16(pdu)+ADs-
        offset +AD0- get+AF8-le16(pdu +- 2)+ADs-

        attr +AD0- gatt+AF8-db+AF8-get+AF8-attribute(server-+AD4-db, handle)+ADs-
        if (+ACE-attr) +AHs-
                ecode +AD0- BT+AF8-ATT+AF8-ERROR+AF8-INVALID+AF8-HANDLE+ADs-
                goto error+ADs-
        +AH0-

        util+AF8-debug(server-+AD4-debug+AF8-callback, server-+AD4-debug+AF8-data,
                                +ACI-Prep Write Req - handle: 0x+ACU-04x+ACI-, handle)+ADs-

        ecode +AD0- check+AF8-permissions(server, attr, BT+AF8-ATT+AF8-PERM+AF8-WRITE +AHw-
                                                BT+AF8-ATT+AF8-PERM+AF8-WRITE+AF8-AUTHEN +AHw-
                                                BT+AF8-ATT+AF8-PERM+AF8-WRITE+AF8-ENCRYPT)+ADs-
        if (ecode)
                goto error+ADs-

        if (+ACE-store+AF8-prep+AF8-data(server, handle, offset, length - 4,
                                                +ACY-((uint8+AF8-t +ACo-) pdu)+AFs-4+AF0-)) +AHs-
                ecode +AD0- BT+AF8-ATT+AF8-ERROR+AF8-INSUFFICIENT+AF8-RESOURCES+ADs-
                goto error+ADs-
        +AH0-

        bt+AF8-att+AF8-send(server-+AD4-att, BT+AF8-ATT+AF8-OP+AF8-PREP+AF8-WRITE+AF8-RSP, pdu, length, NULL,     +ADw-------------------------- Response is sent
                                                                NULL, NULL)+ADs-
        return+ADs-

error:
        bt+AF8-att+AF8-send+AF8-error+AF8-rsp(server-+AD4-att, opcode, handle, ecode)+ADs-
+AH0-


--------------------------------------------------------------------------------------------------------------------------------------
In Bluez master, the response is sent from prep+AF8-write+AF8-complete+AF8-cb but the call back is never called since gatt+AF8-db+AF8-attribute+AF8-write returns True before func is executed which is the function pointer to prep+AF8-write+AF8-complete+AF8-cb
static void prep+AF8-write+AF8-complete+AF8-cb(struct gatt+AF8-db+AF8-attribute +ACo-attr, int err,
                                                                void +ACo-user+AF8-data)
+AHs-
        struct prep+AF8-write+AF8-complete+AF8-data +ACo-pwcd +AD0- user+AF8-data+ADs-
        uint16+AF8-t handle +AD0- 0+ADs-
        uint16+AF8-t offset+ADs-

        handle +AD0- get+AF8-le16(pwcd-+AD4-pdu)+ADs-

        if (err) +AHs-
                bt+AF8-att+AF8-chan+AF8-send+AF8-error+AF8-rsp(pwcd-+AD4-chan, BT+AF8-ATT+AF8-OP+AF8-PREP+AF8-WRITE+AF8-REQ,
                                                                handle, err)+ADs-
                free(pwcd-+AD4-pdu)+ADs-
                free(pwcd)+ADs-

                return+ADs-
        +AH0-

        offset +AD0- get+AF8-le16(pwcd-+AD4-pdu +- 2)+ADs-

        if (+ACE-store+AF8-prep+AF8-data(pwcd-+AD4-server, handle, offset, pwcd-+AD4-length - 4,
                                                +ACY-((uint8+AF8-t +ACo-) pwcd-+AD4-pdu)+AFs-4+AF0-))
                bt+AF8-att+AF8-chan+AF8-send+AF8-error+AF8-rsp(pwcd-+AD4-chan, BT+AF8-ATT+AF8-OP+AF8-PREP+AF8-WRITE+AF8-RSP,
                                        handle,
                                        BT+AF8-ATT+AF8-ERROR+AF8-INSUFFICIENT+AF8-RESOURCES)+ADs-

        bt+AF8-att+AF8-chan+AF8-send+AF8-rsp(pwcd-+AD4-chan, BT+AF8-ATT+AF8-OP+AF8-PREP+AF8-WRITE+AF8-RSP, pwcd-+AD4-pdu,  +ADw--------------- Response is sent
                                                                pwcd-+AD4-length)+ADs-

        free(pwcd-+AD4-pdu)+ADs-
        free(pwcd)+ADs-
+AH0-




Internal Use - Confidential
-----Original Message-----
From: Luiz Augusto von Dentz +ADw-luiz.dentz+AEA-gmail.com+AD4-
Sent: Thursday, July 11, 2024 1:10 PM
To: Ramsay, Trey +ADw-Trey+AF8-Ramsay+AEA-Dell.com+AD4-
Cc: linux-bluetooth+AEA-vger.kernel.org
Subject: Re: +AFs-PATCH+AF0- ATT: Error (0x01) - Error: Unlikely error (14) Prepare Write req (0x16)


+AFs-EXTERNAL EMAIL+AF0-

Hi Trey,

On Thu, Jul 11, 2024 at 1:17+IC8-PM Ramsay, Trey +ADw-Trey.Ramsay+AEA-dell.com+AD4- wrote:
+AD4-
+AD4- Hi Luiz,
+AD4- Correct, the request is timing out.  The problem is +ACI-prep+AF8-write+AF8-complete+AF8-cb+ACI- is never getting called after the +ACI-prep+AF8-write+AF8-cb+ACI- is called.  The prep+AF8-write+AF8-complete+AF8-cb is responsible for sending the response BT+AF8-ATT+AF8-OP+AF8-PREP+AF8-WRITE+AF8-RSP back.  The patch I provided fixes the code so that prep+AF8-write+AF8-complete+AF8-cb  will get called and the response is sent back.   Sorry, I had debugged this issue a quite a while ago using bluez 5.55 and 5.66 and noticed the same issue in the master branch.  We have been using the patch and it has resolved the issue.

Well your patch is more of a workaround and in case the issue is really the application setting 'authorize' flag the prepare write will need to be authorized even if they are of 0 length, so it is a nack from my side. If you think the application is responding properly then the problem is somewhere else and in that case we probably need to debug the code path it is taking.

+AD4- Thanks,
+AD4- Trey
+AD4-
+AD4- -----Original Message-----
+AD4- From: Luiz Augusto von Dentz +ADw-luiz.dentz+AEA-gmail.com+AD4-
+AD4- Sent: Wednesday, July 10, 2024 4:14 PM
+AD4- To: Ramsay, Trey +ADw-Trey+AF8-Ramsay+AEA-Dell.com+AD4-
+AD4- Cc: linux-bluetooth+AEA-vger.kernel.org
+AD4- Subject: Re: +AFs-PATCH+AF0- ATT: Error (0x01) - Error: Unlikely error (14)
+AD4- Prepare Write req (0x16)
+AD4-
+AD4-
+AD4- +AFs-EXTERNAL EMAIL+AF0-
+AD4-
+AD4- Hi Trey,
+AD4-
+AD4- On Wed, Jul 10, 2024 at 3:55+IC8-PM Ramsay, Trey +ADw-Trey.Ramsay+AEA-dell.com+AD4- wrote:
+AD4- +AD4-
+AD4- +AD4- Hi Luis,
+AD4- +AD4- It is a Prepare Write Request but prep+AF8-write+AF8-complete+AF8-cb is never getting called. In gatt+AF8-db+AF8-attribute+AF8-write, the prep+AF8-write+AF8-complete+AF8-cb function is not getting called since +ACI-attribe-+AD4-write+AF8-func+ACI- is not null and the function will return +ACI-True+ACI-.  The prep+AF8-write+AF8-complete+AF8-cb is supposed to get called after +ACI-goto done+ADsAIg- but it's not getting called.  The prep+AF8-write+AF8-complete+AF8-cb is assigned to +ACI-func+ACI-.    The patch checks to see if len is 0 and will goto done which will call prep+AF8-write+AF8-complete+AF8-cb.
+AD4-
+AD4- Well if it returns true then it should not return unlikely:
+AD4-
+AD4-     status +AD0- gatt+AF8-db+AF8-attribute+AF8-write(attr, offset, NULL, 0,
+AD4-                         BT+AF8-ATT+AF8-OP+AF8-PREP+AF8-WRITE+AF8-REQ,
+AD4-                         server-+AD4-att,
+AD4-                         prep+AF8-write+AF8-complete+AF8-cb, pwcd)+ADs-
+AD4-
+AD4-     if (status)
+AD4-         return+ADs-
+AD4-
+AD4-     ecode +AD0- BT+AF8-ATT+AF8-ERROR+AF8-UNLIKELY+ADs-
+AD4-
+AD4- error:
+AD4-     bt+AF8-att+AF8-chan+AF8-send+AF8-error+AF8-rsp(chan, opcode, handle, ecode)+ADs-
+AD4-
+AD4- +AD4-
+AD4- +AD4- +AD4- ACL data: handle 0 flags 0x01 dlen 3
+AD4- +AD4-     ATT: Prepare Write req (0x16)
+AD4- +AD4-       attr handle 0x0069, value offset 0x0000
+AD4- +AD4-       part attr value  0x80 0x02 0x00 0x01 0xaa 0xd3 0x81 0x51 0x54
+AD4- +AD4- 0x5b 0xea 0xaf 0x68 0x0d 0xeb 0xe6 0x11 0x2d 0x63 0xb1 0x8e 0xbd
+AD4- +AD4- 0xc4
+AD4- +AD4- 0x63 0x8f 0xf6 0xb6 0x10 0x63 0xb5 0x54 0x3f 0x36 0x19 0x41 0x5b
+AD4- +AD4- 0x25 0xcd 0xa7 0xe5 0x9d 0xc7 0x71 0x26 0x33 0x7c 0xe8 0x0e 0x67
+AD4- +AD4- 0xd8 0x9a 0x0a 0xb5 0xe5 0x24 0x87 0x2d 0xcc 0x00 0xa9 0xc8 0xb8
+AD4- +AD4- 0x95 0x76 0x75 0x9f 0x79 0x1f 0x94 0xe4 0xd9 0xbe 0xab 0x22 0xa3
+AD4- +AD4- 0x33 0x18 0x28 0x57
+AD4- +AD4- 0x26 0xae 0x6d 0x0a 0x9b 0x63 0xeb 0x10 0xf3 0xb5 0xea 0x64 0x4a
+AD4- +AD4- 0x81
+AD4- +AD4- 0x55 0xe0 0xa9 0x43 0x8c 0x87 0xb4 0x32 0x1c 0x79 0xd6 0x34 0x97
+AD4- +AD4- 0xff 0xae 0x71 0x1e 0x50 0x7c 0xb6 0x72 0x7b 0x49 0x44 0xef 0xfe
+AD4- +AD4- 0xe2 0x40
+AD4- +AD4- 0xc7 0x3e 0x5e 0x42 0x9b 0xca 0xa4 0x61 0x66 0x72 0x0a 0x1d 0x5c
+AD4- +AD4- 0xb0 0xdb 0xa1 0xbb 0xf7 0xb6 0x27 0xa0 0x67 0xde 0x69 0xd9 0x67
+AD4- +AD4- 0xa7 0x09
+AD4- +AD4- 0x58 0x71 0x37 0x99 0x95 0x5c 0x5d 0x10 0x4d 0xed 0x2f 0xe2 0x85
+AD4- +AD4- 0x6c
+AD4- +AD4- 0x03 0x60 0x80 0x67 0x25 0x1b 0x33 0x02 0x53 0xbe 0x67 0xdb 0xd4
+AD4- +AD4- 0x2a 0x9e 0x8d 0x82 0xe2 0x9d 0xc4 0x86 0x08 0x84 0x2c 0xbf 0xa5
+AD4- +AD4- 0xc5 0xd3
+AD4- +AD4- 0x99 0xf1 0x02 0x09 0x80 0x0c 0xc5 0xf9 0x99 0x06 0x20 0x01 0x75
+AD4- +AD4- 0xdb 0x0c 0x11 0x81 0x87 0x04 0x4d 0xf0 0xcc 0xf7 0x27 0x85 0xcd
+AD4- +AD4- 0x22 0x84
+AD4- +AD4- 0x85 0x04 0xb3 0xa2 0xa9 0xcc 0xe9 0x27 0x8b 0x67 0x02 0x1b 0xe0
+AD4- +AD4- 0x8c
+AD4- +AD4- 0xd7 0x8f 0x51 0x3a 0xa6 0x0c 0x23 0xa0 0x09 0x2b 0x4c 0xb0 0x80
+AD4- +AD4- 0x34
+AD4- +AD4- 0xf9 0x61 0xaa 0x72 0x90 0x3a 0x5e 0xb7 0x11 0xaf 0xc3 0xcd 0x78
+AD4- +AD4- 0x4f
+AD4- +AD4- 0xb6 0x1b 0xbb 0xb4 0xb2 0x42 0x9f 0x87 0xad 0xf6 0xa1 0xae 0xdd
+AD4- +AD4- 0xde
+AD4- +AD4- 0x38 0x09 0x7a 0xc5 0x7c 0xbd 0x98 0x89 0xae 0x49 0x98 0xe7 0xae
+AD4- +AD4- 0x92
+AD4- +AD4- 0x28 0x45 0x5a 0xbc 0x30 0x53 0xe5 0xc1 0x56 0xb3 0x9f 0x56 0x7b
+AD4- +AD4- 0xa1
+AD4- +AD4- 0x02 0xcd 0xc2 0x25 0x2a 0xb2 0xc5 0xc9 0x35 0xec 0xa7 0x26 0x79
+AD4- +AD4- 0x97 0x2e 0x96 0x97 0x3e 0x5b 0x8f 0xc7 0x2f 0xa8 0x39 0x70 0xb1
+AD4- +AD4- 0x22 0x5b 0x2c 0x15 0x41 0xec 0x6b 0xc4 0x1e 0x2d 0xc0 0x47 0x75
+AD4- +AD4- 0x42 0x01 0x40
+AD4- +AD4- 0xc5 0x17 0x69 0xf4 0x0a 0xcd 0x7e 0x62 0x25 0xec 0x1f 0x7c 0xae
+AD4- +AD4- 0x7b
+AD4- +AD4- 0xf9 0x1e 0x9f 0x98 0xbd 0xc7 0xc3 0x44 0x4c 0xe2 0x0a 0x8c 0xbe
+AD4- +AD4- 0xeb 0x1e 0xae 0x7b 0xbc 0x49 0xfa 0x7d 0xa3 0xdf 0xb2 0xc0 0x69
+AD4- +AD4- 0xf7 0x57 0x6b 0x6f 0xe7 0x2e 0x3c 0x90 0x0a 0x16 0xe8 0x03 0x0d
+AD4- +AD4- 0xf1 0x9c 0x4c
+AD4- +AD4- 0xa3 0x4b 0xcf 0x6d 0xc3 0x4a 0x69 0x25 0xc5 0xf6 0x9c 0x4b 0xb3
+AD4- +AD4- 0x77
+AD4- +AD4- 0x67 0x7b 0x00 0xbb 0x1f 0xcd 0x59 0xb0 0xe9 0xf6 0xbe 0xa3 0x41
+AD4- +AD4- 0xd1 0x2c 0x1f 0x09 0x6b 0x4e 0x52 0x01 0x0c 0xe1 0x20 0x6c 0x76
+AD4- +AD4- 0xfd 0xc9
+AD4- +AD4- 0xb9 0xb4 0xd8 0xdf 0xcb 0xac 0x77 0x65 0xcd 0x98 0xe9 0x66 0x6c
+AD4- +AD4- 0xc8 0x8f 0xfc 0xef 0x7e 0x48 0x9f 0xc8 0xd6 0x9c 0x72 0xac 0x44
+AD4- +AD4- 0xa3 0x67
+AD4- +AD4- 0xa3 0x6a 0xe3 0xde 0x3a 0xd5 0x21 0x94 0x29 0x94 0x3d 0x7b 0x88
+AD4- +AD4- 0x29
+AD4- +AD4- 0xc3 0xc2 0x7e 0x82 0x9d 0xe7 0x00 0x7c 0x96 0x28 0x1d 0x20 0xf8
+AD4- +AD4- 0x81
+AD4- +AD4- 0x02 0x7c 0xc2 0xb2 0xfa 0x43 0x90 0x6e
+AD4-
+AD4- That doesn't seem like a zero length, what BlueZ version is this btw?
+AD4-
+AD4- +AD4- +ADw- ACL data: handle 0 flags 0x00 dlen 9
+AD4- +AD4-     ATT: Error (0x01)
+AD4- +AD4-       Error: Unlikely error (14)
+AD4- +AD4-       Prepare Write req (0x16) on handle 0x0069
+AD4-
+AD4- Check what time does this error is generated, since this well be:
+AD4-
+AD4- static bool write+AF8-timeout(void +ACo-user+AF8-data) +AHs-
+AD4-     struct pending+AF8-write +ACo-p +AD0- user+AF8-data+ADs-
+AD4-
+AD4-     p-+AD4-timeout+AF8-id +AD0- 0+ADs-
+AD4-
+AD4-     queue+AF8-remove(p-+AD4-attrib-+AD4-pending+AF8-writes, p)+ADs-
+AD4-
+AD4-     pending+AF8-write+AF8-result(p, -ETIMEDOUT)+ADs-
+AD4-
+AD4-     return false+ADs-
+AD4- +AH0-
+AD4-
+AD4- The -ETIMEOUT would be converted to:
+AD4-
+AD4- static uint8+AF8-t att+AF8-ecode+AF8-from+AF8-error(int err) +AHs-
+AD4-     /+ACo-
+AD4-      +ACo- If the error fits in a single byte, treat it as an ATT protocol
+AD4-      +ACo- error as is. Since +ACI-0+ACI- is not a valid ATT protocol error code, we map
+AD4-      +ACo- that to UNLIKELY below.
+AD4-      +ACo-/
+AD4-     if (err +AD4- 0 +ACYAJg- err +ADw- UINT8+AF8-MAX)
+AD4-         return err+ADs-
+AD4-
+AD4-     /+ACo-
+AD4-      +ACo- Since we allow UNIX errnos, map them to appropriate ATT protocol
+AD4-      +ACo- and +ACI-Common Profile and Service+ACI- error codes.
+AD4-      +ACo-/
+AD4-     switch (err) +AHs-
+AD4-     case -ENOENT:
+AD4-         return BT+AF8-ATT+AF8-ERROR+AF8-INVALID+AF8-HANDLE+ADs-
+AD4-     case -ENOMEM:
+AD4-         return BT+AF8-ATT+AF8-ERROR+AF8-INSUFFICIENT+AF8-RESOURCES+ADs-
+AD4-     case -EALREADY:
+AD4-         return BT+AF8-ERROR+AF8-ALREADY+AF8-IN+AF8-PROGRESS+ADs-
+AD4-     case -EOVERFLOW:
+AD4-         return BT+AF8-ERROR+AF8-OUT+AF8-OF+AF8-RANGE+ADs-
+AD4-     +AH0-
+AD4-
+AD4-     return BT+AF8-ATT+AF8-ERROR+AF8-UNLIKELY+ADs-
+AD4- +AH0-
+AD4-
+AD4- So on write+AF8-timeout it would also generate the unlikely error.
+AD4-
+AD4- Note that normally prepare write don't need authorization, but perhaps you have an application setting 'authorize':
+AD4-
+AD4- https://urldefense.com/v3/+AF8AXw-https://github.com/bluez/bluez/blob/master/doc/org.bluez.GattCharacteristic.rst+ACo-arraystring-flags-read-only+AF8AXwA7-Iw+ACEAIQ-LpKI+ACE-mOAXmul0EbN+AF8-7I2R6edizAu4TW4H0BMt5s6EDMhpj23Ap8xFtV5BRjMJtpqVFcVIZQnbtBdGNs0UyAwX178+ACQ- +AFs-github+AFs-.+AF0-com+AF0-, which means the following code would execute:
+AD4-
+AD4-     if (opcode +AD0APQ- BT+AF8-ATT+AF8-OP+AF8-PREP+AF8-WRITE+AF8-REQ) +AHs-
+AD4-         if (+ACE-btd+AF8-device+AF8-is+AF8-trusted(device) +ACYAJg- +ACE-desc-+AD4-prep+AF8-authorized +ACYAJg-
+AD4-                         desc-+AD4-req+AF8-prep+AF8-authorization)
+AD4-             send+AF8-write(att, attrib, desc-+AD4-proxy,
+AD4-                     desc-+AD4-pending+AF8-writes, id, value, len,
+AD4-                     offset, false, true)+ADs-
+AD4-         else
+AD4-             gatt+AF8-db+AF8-attribute+AF8-write+AF8-result(attrib, id, 0)+ADs-
+AD4-
+AD4-         return+ADs-
+AD4-     +AH0-
+AD4-
+AD4- You can also try adding passing -t -p debug to btmon so it logs the debug messages from bluetoothd and include timing information.
+AD4-
+AD4- +AD4- +AD4- HCI Event: Number of Completed Packets (0x13) plen 5
+AD4- +AD4-     handle 0 packets 1
+AD4- +AD4- +AD4- ACL data: handle 0 flags 0x02 dlen 6
+AD4- +AD4-     ATT: Exec Write req (0x18)
+AD4- +AD4-       cancel all prepared writes (0x00) +ADw- ACL data: handle 0 flags
+AD4- +AD4- 0x00 dlen 5
+AD4- +AD4-     ATT: Exec Write resp (0x19)
+AD4- +AD4- +AD4- HCI Event: Number of Completed Packets (0x13) plen 5
+AD4- +AD4-     handle 0 packets 1
+AD4- +AD4-
+AD4- +AD4- -----Original Message-----
+AD4- +AD4- From: Luiz Augusto von Dentz +ADw-luiz.dentz+AEA-gmail.com+AD4-
+AD4- +AD4- Sent: Tuesday, July 9, 2024 3:34 PM
+AD4- +AD4- To: Ramsay, Trey +ADw-Trey+AF8-Ramsay+AEA-Dell.com+AD4-
+AD4- +AD4- Cc: linux-bluetooth+AEA-vger.kernel.org
+AD4- +AD4- Subject: Re: +AFs-PATCH+AF0- ATT: Error (0x01) - Error: Unlikely error (14)
+AD4- +AD4- Prepare Write req (0x16)
+AD4- +AD4-
+AD4- +AD4-
+AD4- +AD4- +AFs-EXTERNAL EMAIL+AF0-
+AD4- +AD4-
+AD4- +AD4- Hi Trey,
+AD4- +AD4-
+AD4- +AD4- On Tue, Jul 9, 2024 at 1:34+IC8-PM Ramsay, Trey +ADw-Trey.Ramsay+AEA-dell.com+AD4- wrote:
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4- Bluez Maintainers,
+AD4- +AD4- +AD4- Here is a fix for attribute writes not working in
+AD4- +AD4- +AD4- src/shared/gatt-db.c. The prep+AF8-write+AF8-complete+AF8-cb was not getting
+AD4- +AD4- +AD4- called. The attrib-+AD4-write+AF8-func code block should not be called
+AD4- +AD4- +AD4- when len is 0
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4- commit 5a9baa10d4fde7ca8ab88ecd68e17671c33cb587 (HEAD -+AD4- gat-db,
+AD4- +AD4- +AD4- master)
+AD4- +AD4- +AD4- Author: Trey+AF8-Ramsay +ADw-trey+AF8-ramsay+AEA-dell.com+AD4-
+AD4- +AD4- +AD4- Date:   Fri May 31 15:39:27 2024 -0500
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4-     shared/gatt-db: Prepare Write req error BT+AF8-ATT+AF8-ERROR+AF8-UNLIKELY
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4-     Fixes Prepare Write req error: BT+AF8-ATT+AF8-ERROR+AF8-UNLIKELY
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4-         ATT: Error (0x01)
+AD4- +AD4- +AD4-           Error: Unlikely error (14)
+AD4- +AD4- +AD4-           Prepare Write req (0x16) on handle 0x0069
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4-     The prep+AF8-write+AF8-complete+AF8-cb was not getting called
+AD4- +AD4- +AD4-     The attrib-+AD4-write+AF8-func code block does not need to be called
+AD4- +AD4- +AD4- when len is 0
+AD4- +AD4-
+AD4- +AD4- This doesn't sound quite right, 0 length still needs to be passed to the attribute to confirm since we don't know if it could be a procedure or not. Can you explain what attribute is being written and if it could be due to the application not responding and the procedure timing out (e.g. write+AF8-timeout is called?), perhaps if you can paste a btmon trace as well that could help checking what attribute it is trying to use prepare write.
+AD4- +AD4-
+AD4- +AD4- +AD4- diff --git a/src/shared/gatt-db.c b/src/shared/gatt-db.c index
+AD4- +AD4- +AD4- 2c8e7d31e..678aef4cf 100644
+AD4- +AD4- +AD4- --- a/src/shared/gatt-db.c
+AD4- +AD4- +AD4- +-+-+- b/src/shared/gatt-db.c
+AD4- +AD4- +AD4- +AEAAQA- -2127,6 +-2127,10 +AEAAQA- bool gatt+AF8-db+AF8-attribute+AF8-write(struct gatt+AF8-db+AF8-attribute +ACo-attrib, uint16+AF8-t offset,
+AD4- +AD4- +AD4-      if (+ACE-attrib +AHwAfA- (+ACE-func +ACYAJg- attrib-+AD4-write+AF8-func))
+AD4- +AD4- +AD4-          return false+ADs-
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4- +-    /+ACo- Nothing to write just skip +ACo-/
+AD4- +AD4- +AD4- +-    if (len +AD0APQ- 0)
+AD4- +AD4- +AD4- +-        goto done+ADs-
+AD4- +AD4- +AD4- +-
+AD4- +AD4- +AD4-      if (attrib-+AD4-write+AF8-func) +AHs-
+AD4- +AD4- +AD4-          struct pending+AF8-write +ACo-p+ADs-
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4- +AEAAQA- -2162,10 +-2166,6 +AEAAQA- bool gatt+AF8-db+AF8-attribute+AF8-write(struct gatt+AF8-db+AF8-attribute +ACo-attrib, uint16+AF8-t offset,
+AD4- +AD4- +AD4-          return true+ADs-
+AD4- +AD4- +AD4-      +AH0-
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4- -    /+ACo- Nothing to write just skip +ACo-/
+AD4- +AD4- +AD4- -    if (len +AD0APQ- 0)
+AD4- +AD4- +AD4- -        goto done+ADs-
+AD4- +AD4- +AD4- -
+AD4- +AD4- +AD4-      /+ACo- For values stored in db allocate on demand +ACo-/
+AD4- +AD4- +AD4-      if (+ACE-attrib-+AD4-value +AHwAfA- offset +AD4APQ- attrib-+AD4-value+AF8-len +AHwAfA-
+AD4- +AD4- +AD4-                  len +AD4- (unsigned) (attrib-+AD4-value+AF8-len - offset)) +AHs-
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4- -----Original Message-----
+AD4- +AD4- +AD4- From: Ramsay, Trey +ADw-Trey.Ramsay+AEA-dell.com+AD4-
+AD4- +AD4- +AD4- Sent: Thursday, June 20, 2024 1:58 PM
+AD4- +AD4- +AD4- To: linux-bluetooth+AEA-vger.kernel.org
+AD4- +AD4- +AD4- Subject: +AFs-PATCH+AF0- ATT: Error (0x01) - Error: Unlikely error (14)
+AD4- +AD4- +AD4- Prepare Write req (0x16)
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4- Bluez Maintainers
+AD4- +AD4- +AD4- Here is a fix for attribute writes not working in
+AD4- +AD4- +AD4- src/shared/gatt-db.c
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4- https://urldefense.com/v3/+AF8AXw-https://github.com/tramsay/bluez-trams
+AD4- +AD4- +AD4- ay
+AD4- +AD4- +AD4- /c
+AD4- +AD4- +AD4- ommit/246bc960629dff34e744c728f048e9f50f1a005d+AF8AXwA7ACEAIQ-LpKI+ACE-jkJYamzU8b
+AD4- +AD4- +AD4- Od
+AD4- +AD4- +AD4- d1
+AD4- +AD4- +AD4- qt-sWpj6gy1YwS30UyamHLUJj9Uy0UecrB6QxvCdSWFAUH7Dvq2wVJqu1C5jjoX5am
+AD4- +AD4- +AD4- yw
+AD4- +AD4- +AD4- JH
+AD4- +AD4- +AD4- +ACQ- +AFs-github+AFs-.+AF0-com+AF0-
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4- shared/gatt-db: Prepare Write req error BT+AF8-ATT+AF8-ERROR+AF8-UNLIKELY
+AD4- +AD4- +AD4- Fixes Prepare Write req error: BT+AF8-ATT+AF8-ERROR+AF8-UNLIKELY
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4-     ATT: Error (0x01)
+AD4- +AD4- +AD4-       Error: Unlikely error (14)
+AD4- +AD4- +AD4-       Prepare Write req (0x16) on handle 0x0069
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4- The prep+AF8-write+AF8-complete+AF8-cb was not getting called The
+AD4- +AD4- +AD4- attrib-+AD4-write+AF8-func code block should not be called when len is 0
+AD4- +AD4- +AD4-
+AD4- +AD4-
+AD4- +AD4-
+AD4- +AD4- --
+AD4- +AD4- Luiz Augusto von Dentz
+AD4- +AD4-
+AD4-
+AD4-
+AD4- --
+AD4- Luiz Augusto von Dentz



--
Luiz Augusto von Dentz





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux