Bluetooth: OTS: Add configuration for OTS channel TX mtu
Add configuration for Object Transfer Service channel MTU for outgoing L2CAP SDUs. Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
parent
8e865a7a88
commit
9f989a0b00
2 changed files with 9 additions and 4 deletions
|
@ -60,6 +60,11 @@ config BT_OTS_OLCP_GO_TO_SUPPORT
|
|||
bool "Support OLCP Go To Operation"
|
||||
default y
|
||||
|
||||
config BT_OTS_L2CAP_CHAN_TX_MTU
|
||||
int "Size of TX MTU for Object Transfer Channel"
|
||||
default 256
|
||||
range 21 65533
|
||||
|
||||
config BT_OTS_L2CAP_CHAN_RX_MTU
|
||||
int "Size of RX MTU for Object Transfer Channel"
|
||||
# RX MTU will be truncated to account for the L2CAP PDU and SDU header.
|
||||
|
|
|
@ -26,9 +26,9 @@ LOG_MODULE_DECLARE(bt_ots, CONFIG_BT_OTS_LOG_LEVEL);
|
|||
*/
|
||||
#define BT_GATT_OTS_L2CAP_PSM 0x0025
|
||||
|
||||
/* Maximum size of outgoing data. */
|
||||
#define OT_TX_MTU 256
|
||||
NET_BUF_POOL_FIXED_DEFINE(ot_chan_tx_pool, 1, BT_L2CAP_SDU_BUF_SIZE(OT_TX_MTU),
|
||||
|
||||
NET_BUF_POOL_FIXED_DEFINE(ot_chan_tx_pool, 1,
|
||||
BT_L2CAP_SDU_BUF_SIZE(CONFIG_BT_OTS_L2CAP_CHAN_TX_MTU),
|
||||
NULL);
|
||||
|
||||
#if (CONFIG_BT_OTS_L2CAP_CHAN_RX_MTU > BT_L2CAP_SDU_RX_MTU)
|
||||
|
@ -46,7 +46,7 @@ static int ots_l2cap_send(struct bt_gatt_ots_l2cap *l2cap_ctx)
|
|||
uint32_t len;
|
||||
|
||||
/* Calculate maximum length of data chunk. */
|
||||
len = MIN(l2cap_ctx->ot_chan.tx.mtu, OT_TX_MTU);
|
||||
len = MIN(l2cap_ctx->ot_chan.tx.mtu, CONFIG_BT_OTS_L2CAP_CHAN_TX_MTU);
|
||||
len = MIN(len, l2cap_ctx->tx.len - l2cap_ctx->tx.len_sent);
|
||||
|
||||
/* Prepare buffer for sending. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue