• Qiyu Hu's avatar
    bluetooth: Implement "PrepareWriteValue" for GATT characteristic · 39c6286b
    Qiyu Hu authored
    PrepareWriteValue is a procedure to reliably write to GATT
    characteristics in a GATT service. A client can PrepareWrite to
    various characteristics in a reliable write session and Execute or Abort
    those writes later.
    
    For now, BlueZ handles prepare writes by caching them and then sends out
    regular write requests to the application in the case of commit, or
    silently drops them in the case of abort.
    
    We keep the caching in BlueZ but implement a new function named
    PrepareWriteValue() such that applications can tell prepare write
    requests from regular write requests. Since BlueZ only sends out the
    write requests when the remote device commits, applications not
    interested in achieving reliable writes can safely regard all prepare
    write requests as regular ones.
    
    A relevant patch is crrev.com/c/1094214
    
    Bug: b:78650442
    CQ-DEPEND: CL:1094214
    Test: Pass Android CtsVerifier test on GATT server reliable write
    Change-Id: If2464cf3a17e7c91dc11dc8f4c37734a2987543e
    Reviewed-on: https://chromium-review.googlesource.com/1094316
    Commit-Queue: Qiyu Hu <qiyuh@google.com>
    Reviewed-by: default avatarGreg Kerr <kerrnel@chromium.org>
    Reviewed-by: default avatarRahul Chaturvedi <rkc@chromium.org>
    Reviewed-by: default avatarLuis Hector Chavez <lhchavez@chromium.org>
    Reviewed-by: default avatarMiao-chen Chou <mcchou@chromium.org>
    Reviewed-by: default avatarToni Barzic <tbarzic@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#573539}
    39c6286b
arc_bluetooth_bridge.cc 112 KB