How BLE knows about the peripheral disconnection when there is no data send and receive from application?
The RF link between central and peripheral is always "checked" by the devices at lower levels of the bluetooth stack because there is always a minimal data exchange (at a predefined timings) between devices also when there is no data exchange at application level (the code you directly write);
These "predefined timings" are defined by the GAP connection parameters, in which you specify:
Max C. is right, when app is sending no data, the Link_Layer is always sending empty packets from each side just to keep the connection alive. It also uses supervision timeout value to rest and choose not even send empty packets within the supervision timeout as those transfer miss will not make the connection to lose, but that depends on many factors and the Link Layer is smart enough to make a wise decision.
Hi Swetika, please accept the appropriate answer by clicking on the right mark so that we can close this issue.