This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Bluetopia stack - BLE Writing more than 20 bytes



Hi all,

According to the documents, the GATT_Read_Long_Value_Request  API is implemented. However, there's no equivalent function to write a Long Value to a GATT client. In my case, I need to send a frame of around 100 bytes and looks like it's not possible to do so without consuming 5 connection events (ie, a GATT_Write_Value_Request of 20B call in each connection event). Is this API meant to be released soon in Bluetopia stack or there are no plans for it?

In this case, is there anything suggested to write more than 20B in a single connection event to a GATT client?

Many thanks in advance,

Daniel

  • In fact you can use only 2 connection events, can't you?

    http://processors.wiki.ti.com/index.php/CC2540_Data_Throughput

    Up to 4 notifications per connection event are enabled in TI BLE stack if size is = 20 bytes, so you could embed 3 of them in the first connection event and the pending 2 in the second one. The link above is the maximum throughput test. It contains simple code.

    Have I understood your question?

  • Hi kazola,

    First of all, thanks for your answer, it's really appreciated.

    Secondly, I was wondering about the Bluetopia stack on Stellaris microcontrollers (wrong forum maybe?). It offers an API to read a long (more than 20B) value and I was actually wondering why there's no equivalent function to write it. I don't know if it's simply missing or there's a good reason for it not to be implemented.

    As I'm also using the TI BLE stack, your answer is also useful to me and I guess that everything's automatically done by the stack internally if I try to send out a notification of a characteristic which is 100 bytes long, isn't it?

    Best

    Daniel

  • Ah, ouch, sorry!

    Well, you can always observe how the things are done over the air by using the BLE sniffer. I cannot further help you since I have never worked with the platform you are mentioning :)

  • Daniel,

    The only way to write a long characteristic is using a Preprare Write Request which allows the user to specify the offset in the characteristic to write.  The idea is that the first write has an offset of 0, the second write has an offset of 18and so on.  At the moment this is not supported in the current release.

    However whether you need to use this feature depends on if you can control the applications on both sides of the connection.   The limitation in the number of bytes that can be sent in 1 GATT packet is due to the fact that the default maximum transmission unit (MTU) is 23 bytes.  However this value can be updated by performed an Exchange MTU Request procedure which is supported in the MSP430 release (the remote device will need to support this as well).  The Bluetopia stack in the MSP430 release is configured to support an MTU up to 48 bytes.   

    Then the next possibility is packetizing the data that you write using the GATT APIs.  So you could define that each packet that you send as an offset in the data.  If you controlled the remote side of the connection you can read the offset in each packet to determine where in the characteristic the value goes.  

    As a general note for any GATT transaction that requires a response (Write Request, Indication etc) it takes at least 2 connection events before the next transaction can go out.  This is due to the fact that only 1 GATT transaction that requires a response can be outstanding at a time.  However if you use GATT packets that do not require responses (Write Commands, Notifications) you can fit many more packets into 1 connection event and achieve much higher throughput.

    Tim

    Stonestreet One

  • Tim,

    How do you recommend to send a user variable string that is for example 90 characters long?

    We have tried the GATT_WriteLongCharValue, and the combination of ATT_PrepWriteReq, and ATT_ExecuteWriteReq. GATT_WriteLongCharValue returns a response indicating the attribute does not support that function as does ATT_ExcuteWriteReq.

    Is it possible to perform long writes?
    What API do you recommend we use?

    LPRF Rocks the World  

  • Hi,

    Prepare Write Procedure is currently not supported but the next release will support the feature.

    Regards,

    Stonestreet One

  • Hello,

    When is this release available?

    LPRF Rocks the World

  • Any updates for the next Bluetopia release with support for long GATT write packets?

    LPRF Rocks the World

  • Tim,

    Does the current Bluetopia Version 1.4 stack support MTU sizes of 50 bytes?   (Bluetooth Low Energy).   For IOS7 I'm seeing GATT_Connection_Event_Callback 
    etGATT_Connection_Device_Connection_MTU_Update with a value of 50 when pairing with an iPhone 5 running IOS7.    (The etGATT_Connection_Device_Connection_MTU_Update does not happen with IOS6).

    We need to be able to support both iOS6 and iOS6 on our device and we're using the 1.4 version of the Bluetopia stack.

    Do you have any sample code showing how we should handle the etGATT_Connection_Device_Connection_MTU_Update callback?

    Regards,

    Brian

  • Brian,

    The 1.4 SDK supports up to 50 byte GATT MTU and the etGATT_Connection_Device_Connection_MTU_Update event is informational only.  No processing is needed.

    Thanks,

    Stonestreet One.

  • Does 1.4 support Prepare and execute write ?

    When sending an data larger than MTU ( either 20 bytes or 50 bytes),  iOS would automatically use prepare write/execute to send the request,  does new 1.4 release can handle this request?

  • Hi,

    The 1.4 version of the stack does support Prepare and execute write(in the client role only).

    Regards,

    Stonestreet One.

  • Can you elaborate what "in the client role only" mean?

    Does this mean

    1) client side can send prepare_write and execute_write, but server will not be able to fulfill the request ?

    OR

    2) Client side can send prepare_write and execute_write AND server can fulfill the request,

    BUT server can not send prepare_write and execute_write.

  • Hi,

    When operating in the client side role the GATT libraries allow a client to send Prepare Write Requests and Execute Write Requests.  When operating in the server role the GATT layer will reject incoming prepare writes as an unsupported request (these are optional per the spec).

    Regards,

    Stonestreet One.

  • Just tried prepare write with 1.4,

    our BLE device is in server role, iOS App is client role,

    obviously, this release does not support prepare write in server role.

    (server could not fulfill prepare write request)