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

cross mob
bula
Employee
Employee
First like given First reply posted First question asked

1. The MTU that we receive from the device as you can see is 23, and the maximum amount of bytes we are allowed to write to the APDU characteristic later is 20 

D/BleGattServiceClient: Device 00:A0:50:BA:C2:69 connection state: Connected
D/BluetoothGatt: configureMTU() - device: 00:A0:50:BA:C2:69 mtu: 512
D/BluetoothGatt: onConnectionUpdated() - Device=00:A0:50:BA:C2:69 interval=6 latency=0 timeout=500 status=0
D/BluetoothGatt: onConfigureMTU() - Device=00:A0:50:BA:C2:69 mtu=23 status=0
D/BleGattServiceClient: On MTU changed called: 23, status: 0

I think this is a limitation of the Android GATT implementation, that might reserve those 3 bytes for ATT headers, but just wanted to confirm it with you and check if a MTU of 23 is normal for the devices or just a limitation of the sample board.

Is this true?

0 Likes
1 Solution
Yugandhar
Moderator
Moderator
Moderator
1000 replies posted 5 likes given First comment on blog

Hello,

Yes, 3 bytes are reserved for ATT headers. For the default ATT_MTU of 23 bytes, 3bytes are opcode and attribute handle, and remaining (ATT_MTU-3) bytes are Attribute data.

Thanks,
P Yugandhar.

View solution in original post

0 Likes
5 Replies
Yugandhar
Moderator
Moderator
Moderator
1000 replies posted 5 likes given First comment on blog

Hello,

Yes, 3 bytes are reserved for ATT headers. For the default ATT_MTU of 23 bytes, 3bytes are opcode and attribute handle, and remaining (ATT_MTU-3) bytes are Attribute data.

Thanks,
P Yugandhar.

0 Likes
bula
Employee
Employee
First like given First reply posted First question asked

Hi

I understand that 3 bytes are reserved for ATT.  Can you help understand if MTU size is restricted to 20+3 bytes or can be more than 20 bytes?

0 Likes
Yugandhar
Moderator
Moderator
Moderator
1000 replies posted 5 likes given First comment on blog

Hello,

For PSoC6 BLE, maximum size of Attribute MTU is 512 bytes. Valid range is from 23 to 512 bytes.

Note: During the MTU Exchange procedure, the negotiated GATT MTU will be considered i.e., Min of (MTU of client device, MTU of server device).

Thanks,

P Yugandhar. 

bula
Employee
Employee
First like given First reply posted First question asked

Thank you for your response.  Can you also help me understand if there are any MTU size restrictions on Android or Iphone side?  Will there be any restrictions with certain Mobiles in communicating if we implement 512 bytes of MTU in PSoC?  Thanks

0 Likes
Yugandhar
Moderator
Moderator
Moderator
1000 replies posted 5 likes given First comment on blog

Hello,

Yes, some mobile phones have the MTU size restricted to a default value 23 bytes. So, for such mobile phones the negotiated MTU size becomes 23bytes regardless of the MTU size of your Peripheral PSoC6 BLE device because your Central device's MTU size is 23.

Thanks,
P Yugandhar.

0 Likes