IRNAS / irnas-usersettings-lib

User settings library for Zephyr

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BUG - BT USS Service write errors when MTU size is to small

TjazVracko opened this issue · comments

Describe the bug

If a packet that would be notified as a response to write operation (for example 0x04 (list) is larger than the MTU size, prv_send_notification will return an error, and thus BT_ATT_ERR_UNLIKELY will be returned to the central device.

Firmware/Software Version
v1.3.4 of irnas-usersettings-lib

To Reproduce
Steps to reproduce the behavior:

  1. Connect to device from nrf connect app
  2. Make sure MTU size is low (23).
  3. Subscribe to USS notifications
  4. Send 0x04 command
  5. If a setting has a longer name or value, it will exeede 23 bytes when encoded and will trigger the bug.

How to fix

Two paths:

  1. Return a better error message to indicate MTU size.
  2. if packet is to large, split it and notify it in chunks.