OSDN Git Service

Prevent LE CoC from dropping data when remote MPS>8087
authorJakub Pawlowski <jpawlowski@google.com>
Fri, 5 Jan 2018 10:41:36 +0000 (02:41 -0800)
committerJakub Pawlowski <jpawlowski@google.com>
Mon, 8 Jan 2018 08:30:34 +0000 (08:30 +0000)
commit8452b05b1a21d13e8d97f2f8af1b7cdf77c6cbaa
tree9cc98acef544b739f306443e49ff9d62495b532a
parent97611857726dbfb2a4308d7127e7649b7fff732c
Prevent LE CoC from dropping data when remote MPS>8087

When using LE Coc through Java socket, one can read MPS from
getMaxTransmitPacketSize(). If this value is bigger than
local device L2CAP_MAX_SDU_LENGTH, data sent to remote will be
truncated. This patch fixes that by using properly big buffer for
receiving data from socket on native side.

Test: connect with device with MPS bigger than MPS, alternatively set
L2CAP_MAX_SDU_LENGTH to i.e. 30 on device during test and try to write
"remote MPS" of bytes to remote device.
Bug: 68359837
Change-Id: I02bef80f0dd0f0d6850704ac7787c5f3f5b9b3ab
btif/src/btif_sock_l2cap.cc