I am trying to call bt_gatt_notify_cb() from a for loop which occurs within a workqueue thread.
The work is submitted periodically through an interrupt call.
This works just fine while testing on the LightBlue app on an iOS device. However, when I test this on a Windows PC running the Python GATT client software Bleak, I get the error "Unable to allocate TX context" with error code -ENOBUFS after running the program for a few seconds.
I attempt to transmit 1952 bytes through this for loop every 488ms. The packet payload is 244 bytes. The number of tx buffers is 255.
I'd very much appreciate some help!
The connection parameters I'm using are:
interval: 30ms, latency: 3, timeout: 6s
I've increased the payload and TX buffer count in the prj.conf file:
CONFIG_BT_CONN_TX_MAX=255
CONFIG_BT_L2CAP_TX_BUF_COUNT=255
CONFIG_BT_L2CAP_TX_MTU=247
CONFIG_BT_BUF_ACL_TX_COUNT=255
CONFIG_BT_BUF_ACL_TX_SIZE=251
CONFIG_BT_BUF_ACL_RX_SIZE=251
CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=y
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
CONFIG_BT_USER_PHY_UPDATE=y
CONFIG_BT_USER_DATA_LEN_UPDATE=y