I am a beginner to Nordic devices and to Bluetooth technology in general.
I have set up a Bluetooth connection using the nRF51 Development Kit and an nRF51-Dongle.
The dongle works as the master, the DK as the slave.
I access the dongle using the software nRF Connect running on a Windows 64bit OS.
The DK runs with:
- softdevice version s130
- an application firmware based on the example project "[software development kit]\examples\ble_peripheral\ble_app_uart" as documented here: infocenter.nordicsemi.com/index.jsp
The example project transmits data sent from Bluetooth to the UART interface and vice versa. This is not my use case, but the connection setup is still the same.
Setting up the connection works fine. The problem is that I do not understand what happens on a more technical level.
What I see is:
- The master starts the connection.
- The master reads (or sets) the connection parameters.
- The master makes the slave open the UART TX queue
-> manually, so I know this is caused by the master side
-> but I do not see any data sent from master to slave.
- The slave sends a 2-byte-message 0x100 and
- the master answers with a 2-byte-message 0x100
-> both of these messages come with a handle 0x0C
-> that is never used again. Later, the slave sends messages with 0x0B, and the master uses 0x0E.
I do not see this reflected in the code.
I looked into the init functions. gap_params_init() calls sd_ble_gap_ppcp_set() and sd_ble_gap_device_name_set() (which set the parameters and the name), and services_init() calls ble_nus_init() (that sets the UUID and the RX and TX parameters).
Neither handles an event like "now a connection is set, sent 0x0100". Neither uses any handle with the value 0x0C.
I also tried to search the documentation on the project, but I do not really know what string to search for.
Now, my questions are:
- Why is there an exchange of "0x0100"? Is this a general Bluetooth convention or is this a decision made in this project?
- Is this something I can change in the code? Is it part of the application firmware or the softdevice?
- Which part of the code handles all these things (exchanged messages, connection handles etc.)? Where/how do I find it?
- Is there any documentation that provides more basic information on the connection process?