Notifications/indications are not the only way to transfer data via BLE
As per BLE spec, an attribute value may have a size of up to 512 bytes, and the "mbuf"s are just generic memory blocks you use to transfer data between the application and the BLE stack; hence, the mbuf API has no idea what the memory is going to be used for and how much data would be valid to allow in a given instance.
Additionally, any negotiated MTU size also applies to notifications/indications, so in theory it is possible to send more than 20 bytes in a notification/indication if and while a larger MTU has been established between the peers; this seems to not be used a lot however, which makes sense because you cannot rely on any MTU size being available for a connection, except for the minimum allowed MTU.
cycle through the buffer and take always only max. 20B, call the ble_gattc_notify_custom and repeat until all data is sent?
Yes, that's an approach that can be taken. - But you may run into problems because notifications may be "lost", so the receiver needs a way to detect that one or more data packets are missing, and a way to request re-transmission of the missing data. Indications are acknowledged, so you know if any data sent has reached the receiver; this, however, incurs a heavy "penalty" in bandwidth because after every packet sent, the sender must wait for the acknowledge to arrive before it can send the next packet.
Besides providing the data as an attribute value to be read by the master (up to 512 bytes, see above), "connection oriented channels" (CoC) may be an option to explore:
https://gitlab2.cip.ifi.lmu.de/riedlbe/ ... ver/main.c