Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
bpelesh
Level 1
Level 1
10 sign-ins 5 sign-ins First reply posted

Hello,

We have a PSOC 4 MCU with BLE 4.1 and mobile application like as CySmart.

 

Actual behaviour
The application cannot get a response from characteristic on ios device

 

Devices:

iPad Air 2 iOS 14.4.1

PSoC 4

 

Steps what I am doing on the app:
- connect to the device
- enable short and long notifications
- request MTU (Android only API 21+)

- write value

 

Description

According to Apple documentation  - The MTU is negotiated during connection process. iOS will automatically use the largest value supported by both devices.

 

We set up attribute MTU size which equals 512 bytes on the PSoC side.

 

On the iOS device we used maximumWriteValueLengthForType (https://developer.apple.com/documentation/corebluetooth/cbperipheral/1620312-maximumwritevaluelength...). It has got 512 bytes. But unfortunately the app has not received a response from the peripheral.

 

However, we had the same issue when we have worked with Android. After a long search we found resolve. It was necessary to using requestMtu (https://developer.android.com/reference/android/bluetooth/BluetoothGatt#requestMtu(int)). When we added requestMtu, the android app started getting a response from characteristic.

 

Logs from Xcode (iOS):

2021-03-31 17:43:42.445821+0300 emeter_testing_environment[7235:730555] Get connected peripherals

2021-03-31 17:43:43.406298+0300 emeter_testing_environment[7235:730555] retrieveServices (null)

2021-03-31 17:43:43.410845+0300 emeter_testing_environment[7235:730235] Services Discover

2021-03-31 17:43:43.411516+0300 emeter_testing_environment[7235:730235] Service 12345633-0000-1000-8000-00805F9B24FB <CBService: 0x283b14b00, isPrimary = YES, UUID = 12345633-0000-1000-8000-00805F9B24FB >

2021-03-31 17:43:43.467310+0300 emeter_testing_environment[7235:730235] Characteristics For Service Discover

2021-03-31 17:43:43.473929+0300 emeter_testing_environment[7235:730555] startNotification

2021-03-31 17:43:43.474878+0300 emeter_testing_environment[7235:730555] Looking for FC27 with properties 16

2021-03-31 17:43:43.475536+0300 emeter_testing_environment[7235:730555] Found FC27

2021-03-31 17:43:43.597629+0300 emeter_testing_environment[7235:730235] Notification began on FC27

2021-03-31 17:43:43.636951+0300 emeter_testing_environment[7235:730618] startNotification

2021-03-31 17:43:43.637658+0300 emeter_testing_environment[7235:730618] Looking for AEF9 with properties 16

2021-03-31 17:43:43.638046+0300 emeter_testing_environment[7235:730618] Found AEF9

2021-03-31 17:43:43.755061+0300 emeter_testing_environment[7235:730235] Notification began on AEF9

2021-03-31 17:43:46.404088+0300 emeter_testing_environment[7235:730555] Write

2021-03-31 17:43:46.405077+0300 emeter_testing_environment[7235:730555] Looking for 8AA5 with properties 8

2021-03-31 17:43:46.405881+0300 emeter_testing_environment[7235:730555] Found 8AA5

2021-03-31 17:43:46.407011+0300 emeter_testing_environment[7235:730555] [native] Message to write(1): (

    1

)

2021-03-31 17:43:46.407912+0300 emeter_testing_environment[7235:730555] [native] Message to write(1): 01

2021-03-31 17:43:46.408064+0300 emeter_testing_environment[7235:730555] MAX WRITE --> 512

2021-03-31 17:43:46.477202+0300 emeter_testing_environment[7235:730235] didWrite

2021-03-31 17:44:47.030206+0300 emeter_testing_environment[7235:730235] Peripheral Disconnected: 2D3F177A-15BE-0C3C-6729-EA6F779F5E67

 

Also I attached logs from CySmart.

 

Maybe we are missing something on the PSoC side.

Can we get a detailed description of the MTU installation?

 

Thank you and Best Regards,

Bohdan

 

0 Likes
6 Replies
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello,

Could you please let me know the write property set for a characteristic in your peripheral device ? If it is 'WriteWithoutResponse' property, then client won't receive response for a write request. 

The amount of data that can be send/receive by the connected BLE devices depends on the negotiated MTU size. When you connect BLE device with the central device, negotiated GATT MTU will be Min of (MTU of client device, MTU of server device). The valid range for the negotiated MTU size for a Cypress BLE connection is from 23 to 512 bytes.

Thanks,

P Yugandhar.

 

0 Likes
lock attach
Attachments are accessible only for community members.

Thank you for the reply.

Yes, we are using 'CBCharacteristicWriteWithResponse'. 

However, we tried to use CySmart iOS and we have not got a response from peripheral too.

I attached screenshots of PSoC4 configuration. Could you please review them? Do these settings meet the requirements?

 

Thank you,

Bohdan

0 Likes
lock attach
Attachments are accessible only for community members.
 
0 Likes
lock attach
Attachments are accessible only for community members.
 
0 Likes
lock attach
Attachments are accessible only for community members.
 
0 Likes
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello,

If possible, could you please share your project so that we can check at our end ?

Thanks,

P Yugandhar.

0 Likes