From d61bcaf3a3bbc268ca6e90ed6ee2b460ef7dc02d Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 16 Mar 2018 11:57:09 +0100 Subject: [PATCH] doc: add ENABLE_ATT_DELAYED_READ_RESPONSE --- doc/manual/docs/how_to.md | 31 ++++++++++++++++--------------- doc/manual/docs/profiles.md | 15 ++++++++++++++- doc/manual/docs/protocols.md | 2 +- 3 files changed, 31 insertions(+), 17 deletions(-) diff --git a/doc/manual/docs/how_to.md b/doc/manual/docs/how_to.md index c4155f885..55ec2b13e 100644 --- a/doc/manual/docs/how_to.md +++ b/doc/manual/docs/how_to.md @@ -68,22 +68,23 @@ LE_DEVICE_DB_PATH | Path to stored LE device information BTstack properties: \#define | Description ---------------------------------|--------------------------------------------- -ENABLE_CLASSIC | Enable Classic related code in HCI and L2CAP -ENABLE_BLE | Enable BLE related code in HCI and L2CAP -ENABLE_EHCILL | Enable eHCILL low power mode on TI CC256x/WL18xx chipsets -ENABLE_LOG_DEBUG | Enable log_debug messages -ENABLE_LOG_ERROR | Enable log_error messages -ENABLE_LOG_INFO | Enable log_info messages -ENABLE_SCO_OVER_HCI | Enable SCO over HCI for chipsets (only TI CC256x/WL18xx, CSR + Broadcom H2/USB)) -ENABLE_HFP_WIDE_BAND_SPEECH | Enable support for mSBC codec used in HFP profile for Wide-Band Speech -ENBALE_LE_PERIPHERAL | Enable support for LE Peripheral Role in HCI and Security Manager -ENBALE_LE_CENTRAL | Enable support for LE Central Role in HCI and Security Manager -ENABLE_LE_SECURE_CONNECTIONS | Enable LE Secure Connections +---------------------------------|--------------------------------------------- +ENABLE_CLASSIC | Enable Classic related code in HCI and L2CAP +ENABLE_BLE | Enable BLE related code in HCI and L2CAP +ENABLE_EHCILL | Enable eHCILL low power mode on TI CC256x/WL18xx chipsets +ENABLE_LOG_DEBUG | Enable log_debug messages +ENABLE_LOG_ERROR | Enable log_error messages +ENABLE_LOG_INFO | Enable log_info messages +ENABLE_SCO_OVER_HCI | Enable SCO over HCI for chipsets (only TI CC256x/WL18xx, CSR + Broadcom H2/USB)) +ENABLE_HFP_WIDE_BAND_SPEECH | Enable support for mSBC codec used in HFP profile for Wide-Band Speech +ENBALE_LE_PERIPHERAL | Enable support for LE Peripheral Role in HCI and Security Manager +ENBALE_LE_CENTRAL | Enable support for LE Central Role in HCI and Security Manager +ENABLE_LE_SECURE_CONNECTIONS | Enable LE Secure Connections ENABLE_MICRO_ECC_FOR_LE_SECURE_CONNECTIONS | Use [micro-ecc library](https://github.com/kmackay/micro-ecc) for ECC operations -ENABLE_LE_DATA_CHANNELS | Enable LE Data Channels in credit-based flow control mode -ENABLE_LE_DATA_LENGTH_EXTENSION | Enable LE Data Length Extension support -ENABLE_LE_SIGNED_WRITE | Enable LE Signed Writes in ATT/GATT +ENABLE_LE_DATA_CHANNELS | Enable LE Data Channels in credit-based flow control mode +ENABLE_LE_DATA_LENGTH_EXTENSION | Enable LE Data Length Extension support +ENABLE_LE_SIGNED_WRITE | Enable LE Signed Writes in ATT/GATT +ENABLE_ATT_DELAYED_READ_RESPONSE | Enable support for delayed ATT Read operations, see [GATT Server](profiles/#sec:GATTServerProfile) ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE | Enable L2CAP Enhanced Retransmission Mode. Mandatory for AVRCP Browsing ENABLE_HCI_CONTROLLER_TO_HOST_FLOW_CONTROL | Enable HCI Controller to Host Flow Control, see below ENABLE_CC256X_BAUDRATE_CHANGE_FLOWCONTROL_BUG_WORKAROUND | Enable workaround for bug in CC256x Flow Control during baud rate change, see chipset docs. diff --git a/doc/manual/docs/profiles.md b/doc/manual/docs/profiles.md index aa79f85b5..54d6f87f6 100644 --- a/doc/manual/docs/profiles.md +++ b/doc/manual/docs/profiles.md @@ -438,7 +438,7 @@ Adding NOTIFY and/or INDICATE automatically creates an addition Client Configuration Characteristic. To require encryption or authentication before a Characteristic can be -accessed, you can add ENCRYPTION_KEY_SIZE_X - with $X \in [7..16]$ - +accessed, you can add ENCRYPTION_KEY_SIZE_X - with X in 7..16 - or AUTHENTICATION_REQUIRED. To use already implemented GATT Services, you can import it @@ -454,6 +454,19 @@ Similar to other protocols, it might be not possible to send any time. To send a Notification, you can call *att_server_request_can_send_now* to receive a ATT_EVENT_CAN_SEND_NOW event. +If your application cannot handle an ATT Read Request in the *att_read_callback* +in some situations, you can enable support for this by adding ENABLE_ATT_DELAYED_READ_RESPONSE +to *btstack_config.h*. Now, you can store the requested attribute handle and return +*ATT_READ_RESPONSE_PENDING* instead of the length of the provided data when you don't have the data ready. +For ATT operations that read more than one attribute, your *att_read_callback* +might get called multiple times as well. To let you know that all necessary +attribute handles have been 'requested' by the *att_server*, you'll get a final +*att_read_callback* with the attribute handle of *ATT_READ_RESPONSE_PENDING*. +When you've got the data for all requested attributes ready, you can call +*att_server_read_response_ready*, which will trigger processing of the current request. +Please keep in mind that there is only one active ATT operation and that it has a 30 second +timeout after which the ATT server is considered defunct by the GATT Client. + ### Implementing Standard GATT Services {#sec:GATTStandardServices} Implementation of a standard GATT Service consists of the following 4 steps: diff --git a/doc/manual/docs/protocols.md b/doc/manual/docs/protocols.md index 9e283cca2..ebeb1a7d3 100644 --- a/doc/manual/docs/protocols.md +++ b/doc/manual/docs/protocols.md @@ -771,7 +771,7 @@ implementation. The constant data are automatically served by the ATT server upo request. To receive the dynamic data, such is characteristic value, the application needs to register read and/or write callback. In addition, notifications and indications can be sent. Please see Section on -[GATT server](section:profiles/#sec:GATTServerProfile) for more. +[GATT server](profiles/#sec:GATTServerProfile) for more. ## SMP - Security Manager Protocol {#sec:smpProtocols}