I am setting up the BLE connection parameters on my project, and using the Lesson 3 of the Bluetooth Low Energy Fundamentals as the basis (while I have experience with BLE, I am new to Nordic). My App is a GATT Server / GAP peripheral (it advertises and it offers data to clients).
I got everything ready, and when I compiled, I noticed that the linker was complaining that bt_gatt_exchange_mtu() was not defined. I reviewed Lesson 3, exercise 2, making sure that I followed all the instructions. Then I followed the code until I found the definition of bt_gatt_exchange_mtu() and noticed that in my project, it was disabled, and required definining CONFIG_BT_GATT_CLIENT, which makes sense as the BLE spec says that the MTU exchange procedure is initiated by the client. I checked the Lesson 3, Exercise 2 proj.conf and CONFIG_BT_GATT_CLIENT is set to yes (but not mentioned in the exercise step-by-step description).
I checked the forums, and found a couple of questions that are related, and the response seems to be that "the BLE spec doesn't specifically prohibit the peripheral to request a change of the MTU, so Nordic allows it", but it still requires adding CONFIG_BT_GATT_CLIENT to the proj.conf file. Also, the description of bt_gatt_exchange_mtu() in the documentation says: "This client procedure[...]", reinforcing that is something expected on a client, but still, in Lesson 3 - Exercise 2, we were building a Server/peripheral and the server/peripheral requested the change on connection of a central.
My question is if that (setting CONFIG_BT_GATT_CLIENT=y) in a GATT Server that has no intention to act as a client is the intended behaviour. I am worried as I don't know the implications that enabling the client role could have.
Links to the related posts:
Why is BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST coming from a GATT server? - Nordic Q&A - Nordic DevZone - Nordic DevZone (nordicsemi.com)