When I am sending notifications or indications using the Nordic SDK, what do I need to be concerned about, the MTU size or the PDU Data length or both?
I negotiate both with the client (well the client asks for 512 Mtu so I settle on Mtu of 253). But I negotiate for a data length and get
Data length update: max_rx_octets 27, max_rx_time 328, max_tx_octets 27, max_tx_time 328
I am not sure how these value affect me. I am only concerned about the size of the PDU when I notify or indicate.
Should I use Mtu - overhead or max_tx_octets? I am guessing it is Mtu. However, I am getting an a size error with a packet size of 246 but not of size 111. Maybe I set up the extra room for SoftDevice incorrectly? I am trying to figure out how that was done and I don't recall.
Also it is not clear how to use the method sd_ble_gap_data_length_update
I invoke the method on a connection. I get the BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST event. Then I am supposed to respond with sd_ble_gap_data_length_update but that might only be the case if the client initiates the request. How can I tell if the event is from my request or a client-initiated request?
Very confusing!!!! The documentation is not helpful here.