Below are the abstract of some information I have known so far:
When a Bluetooth® connection is established, one device, the peripheral, will advertise or broadcast information about itself to any near devices. At the same time, another device, the central, will be performing a scan and will be listening for any device or devices that are broadcasting information. As soon as the central device picks up the advertising information from the peripheral device, an attempt to connect the peripheral device will be made.
There are three ways data can be exchanged between two connected devices: reading , writing , or notifying .
However, neither of these information tells how to choose which device as central, and which device as peripheral practically.
Assume I have a ESP32, and 2 Arduino nano BLE sense. I want the nanos to send sensor data to ESP32. Also, I want sometime ESP32 would send some signal like "on" or "off", which obtain from WiFi, to nanos. How should I configure them as central or peripheral?
I like to think in terms of functions: I would keep as peripheral the devices capturing the sensor data and the central would be where data is aggregated / exported / analysed.
a bit more on the terminology (my cheat sheet);
BLE roles can be viewed at 3 specific moments: pre-connection, when connecting and post-connection and you'l find specific vocabulary to describe the roles.
Pre-connection:
You indeed need to define the role ( peripheral or a central)
A peripheral advertises itself and awaits for a central to connect to it
A central looks (scan) for other devices
when connecting:
The peripheral becomes known as a slave and the central as a master
Post-connection:
Both can be either a client (accesses remote resources) or a server (provides resources)
In the typical scenario, the client is the master (central) and the server is the slave(peripheral)
resources on the server are available in a hierarchy profiles/services/characteristics
The client can send read and write requests to the server which responds with data (and update its data hierarchy when needed).
The server can send data to the client without a read/write request using indicate (to be acknowledged by the client ) and notify (without ack) operations