Data transfer via BLE with timer synchronization on nRF5340 (using application core and network core)

Hello

I want to make an application that will be sending data from 3 peripheral BLE devices to the central device which wil be connected to PC and transmitting data (from all 3 peripheral devices) to it.
Sensor data will be received and sent 100 times per second from each device to the central device. Data from sensors must be collected and sent at the same time to prevent the receiver (central device) to receiving data from different moments in time. The measurement should last even 3 hours and clocks of peripheral devices cannot differ so much that the data received by the central device will be shifted relative to each other in time by more than 1 ms during the entire measurement.

I saw this timer synchronization project:
Wireless timer synchronization among nRF5 devices
https://github.com/nordic-auko/nRF5-ble-timesync-demo

But in this sample there is no data transmission.

I have an idea to merge 3 sample projects in one.
 - https://github.com/nordic-auko/nRF5-ble-timesync-demo : for timer synchronization       [it is running on network core]
 - https://github.com/NordicMatt/multi-NUS/tree/master : as a central device           [it is running on application core]
 - \ncs\v2.5.0\nrf\samples\bluetooth\peripheral_uart (sample on computer disk in nRF Connect SDK directory) : as a peripheral device       [it is running on application core]

My idea is to use timesync sample to synchronizing timers (which runs on the network core), and on application core do the rest of things (receiving data from sensors and sending data to central device).
I also want the device to take over the role of the central device after pressing button 1 - when led1 is on (so the device is sending timer state) and receive sensor data from 3 peripheral devices (apart from broadcasting the timer on the network core).
When led1 is off (so the device is receiving timer state), I want the device to take over the role of a peripheral and send data from sensors (apart from receiving frames with timer synchronization at the network core).

I also think it would be good if the peripheral devices had to be paired for the first time using NFC to the device that has Led1 turned on (currently, in both "multi NUS" and "timesync" the devices connect automatically).



So, I have an idea, but I don't know how to do it, how to merge this samples in one solution.
I don't know how to configure project in that way, that this 3 images will be coexistence and cooperate.


Can you help me with it?

I also have a question whether the method I proposed is good or are there better solutions that would suit my application or is there an example with timer synchronization that also offers data transmission between devices ?



Best Regards

Related