Hi,
I am implementing NUS which is based on example BLE_NUS & BLE_NUS_C.
The connection is not 1-to-1 but 1-to-7. i.e. 1 Central connects to 7 Peripherals.
Although ultimate goal is 7 peripherals, I am just testing with 2 peripherals in the current phase.
So far I have implemented:
Peripheral side (BLE_NUS) is sending 78 Bytes data every 3 seconds.
Central side (BLE_NUS_C) can accept 7 device (
NRF_SDH_BLE_CENTRAL_LINK_COUNT = 7).
Both NRF_SDH_BLE_GATT_MAX_MTU_SIZE is set to 300 in config.h.
In gatt_init(void), I have added a log to print out the NRF_SDH_BLE_GATT_MAX_MTU_SIZE to confirm.
NRF_LOG_INFO("NRF_SDH_BLE_GATT_MAX_MTU_SIZE = %u", NRF_SDH_BLE_GATT_MAX_MTU_SIZE) and confirmed it is 300 in log.What is the problem:
When peripheral sends the data, let's say the conent is: "ABCDEFGHIJKLMNOPQRSTUVWXYZ......." (78 Bytes in total).
On Central side (BLE_NUS_C_EVT_NUS_TX_EVT), the received data is only 20 Bytes.
i.e. p_ble_nus_evt->p_data is "ABCDEFGHIJKLMNOPQRST" and p_ble_nus_evt->data_len is 20.
I am quite sure that the Peripheral side is sending out whole 78 Bytes datas because if I connect to iOS nRF Connect App. I can see the whole 78 Bytes data and it keeps updating every 3 seconds.
According from the RTT Log from Peripheral, I found that if the Peripheral connect with iOS nrfConnect, the log has printed out a message "ATT MTU exchange completed. central 0x12C peripheral 0x12C", where this log does not show up if it is connect to BLE_NUS_C (Central)
Is there any hint how could I fix it?
Or can I force update the MTU after connected?
Thank you very much.
Joe