You are here

BLE - variable length of String | Cypress Semiconductor

BLE - variable length of String

Summary: 1 Reply, Latest post by Madhu Sudhan on 08 Dec 2015 05:03 PM PST
Verified Answers: 0
Last post
Log in to post new comments.
arkadiuszperka_1506696's picture
4 posts

'String' (ASCII code in array) which i 'reading' have variable length but in custom profile i have to declare constant length of utf8s.

1. For example When i reading value ('0x44, 0x45, 0x46')  BLE sending '0x44, 0x45, 0x46, 0x00, 0x00, 0x00...' because in custom profile i declared length =50 I don't need this 0x00 there is any solution to send it without zeros?

2. When i start notify everything is ok... but when there is more than 20 bytes to send via notification it doesn't send anything.
How can i solve this problem?

3. Maybe there is any other possibility to send more than 20 bytes than notifications without reading? 

mady's picture
Cypress Employee
963 posts

1) Please create a Tech Support case with Cypress

2 and 3) The default MTU Size is 23 Bytes (This includes the size of data to be sent). So when you send more amount of data, the size exceeds MTU Size. 

So (i) Please make sure that in your PSoC Creator-> BLE Component -> GAP Settings -> MTU Size is kept to a high value. (Say 40, 60 or 100). Max value is 256

(ii) Both Central and peripheral should support a higher MTU for transferring more amount of data.

(iii) In addition to setting the MTU Size in PSoC Component, when MTU Size is more than 23 bytes, the server and client should exchange their MTUs after connection is established. Please refer to  CyBle_GattcExchangeMtuReq and CyBle_GattsExchangeMtuRsp APIs in the BLE Component Datasheet.

Please refer the attached package which is a BLE_I2C Bridge implementation. It has both server and peripheral projects. In both these projects go to app_ble.c file and serach for the text "mtu" to see the code related to MTU exchange.


-Madhu Sudhan


Log in to post new comments.