This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Write Long Characteristic Values - Unsupported

Hi,

I have a problem with understanding, how bits in ble_gatt_char_props_t are related with Specification of the Bluetooth System v5.1 Table 3.5: Characteristic Properties.

My application has characteristic with enabled only write_wo_resp (rest of ble_gatt_char_props_t and ble_gatt_char_ext_props_t is memset to 0).

According to Table 3.5: Characteristic Properties only procedure defined in Section 4.9.1 shall be supported. I understand that it should not support the procedure from Section 2.9.4. However, when I try to send more than 20 bytes (MTU 23) using IOS application, SoftDevice is trying to process message sequence GATTS Queued Writes: App handled, no attributes require authorization.

What can I do to make this procedure as unsupported? Or at least how should I reject this procedure? In nrf_ble_qwr I found:

#define NRF_BLE_QWR_REJ_REQUEST_ERR_CODE    BLE_GATT_STATUS_ATTERR_APP_BEGIN + 0 

However, in my opinion, BLE_GATT_STATUS_ATTERR_ATTRIBUTE_NOT_LONG fits better. 

Parents
  • Hi,

    Not sure if I fully understand. Is it possible to provide a sniffer log and a frame#/screenshot of the procedure? (For instance I don't quite understand which is server which is client, and by iOS you mean using nrf connect on iphone to send a long write request to your application? And this should be rejected?)

    I would think the iphone should not send the packet when it's long? "If the Characteristic Value write request is the wrong size, or has an invalid value as defined by the profile, then the write shall not succeed and no error shall be generated by the server."

    Best regards,
    Kenneth

  • Hi,

    I will try to give you steps to reproduce in Gherkin like steps:

    Given I am using SoftDevice s112 6.1.1 and IOS nRF Connect Version 1.8.8

    And I set max ATT MTU size to 23

    And I have registered characteristic with a given configuration (Firmware works as a server):

        ble_gatts_char_md_t char_md;
        memset(&char_md, 0, sizeof(char_md));
        char_md.char_props.write_wo_resp = 1;

    When I connect to the device and discover services

    Then I find my characteristic with write without response property.

    When I write the value as text "qwertyuiopasdfghjklzxcvbnm" (26 bytes in total vs max 20)

    Then SoftDevice sends BLE_EVT_USER_MEM_REQUEST event to the application

    When application replies with sd_ble_user_mem_reply(conn_handle, NULL)

    Then SoftDevice sends BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST with BLE_GATTS_AUTHORIZE_TYPE_WRITE and BLE_GATTS_OP_PREP_WRITE_REQ to the application

    My questions:

    •  Why SoftDevice asks for the memory and authorization when this procedure should not be supported (please see Table 3.5: Characteristic Properties)?

    • What should application replay to this request (I do not want to support Long Writes)?
Reply
  • Hi,

    I will try to give you steps to reproduce in Gherkin like steps:

    Given I am using SoftDevice s112 6.1.1 and IOS nRF Connect Version 1.8.8

    And I set max ATT MTU size to 23

    And I have registered characteristic with a given configuration (Firmware works as a server):

        ble_gatts_char_md_t char_md;
        memset(&char_md, 0, sizeof(char_md));
        char_md.char_props.write_wo_resp = 1;

    When I connect to the device and discover services

    Then I find my characteristic with write without response property.

    When I write the value as text "qwertyuiopasdfghjklzxcvbnm" (26 bytes in total vs max 20)

    Then SoftDevice sends BLE_EVT_USER_MEM_REQUEST event to the application

    When application replies with sd_ble_user_mem_reply(conn_handle, NULL)

    Then SoftDevice sends BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST with BLE_GATTS_AUTHORIZE_TYPE_WRITE and BLE_GATTS_OP_PREP_WRITE_REQ to the application

    My questions:

    •  Why SoftDevice asks for the memory and authorization when this procedure should not be supported (please see Table 3.5: Characteristic Properties)?

    • What should application replay to this request (I do not want to support Long Writes)?
Children
Related