This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to get data from multi peripherals to one central via NUS

Dear all, now I am making a data sampling system with multi peripherals and one central. The peripherals sample data from sensor via SPI port and transmit data to the central, and the central board transmit data to the laptop via UART. Now I have made the peripherals with nRF52840s and sensors, and DK52832 as central. 

In firmware development, I copy the project "ble_app_uart__saadc_timer_driven__scan_mode" from NordicPlayground at Github and add some code for my sensor. I modified the "saadc_callback" function for SPI data sampling. This firmware is for the peripherals. Then I copy the project "nrf52-ble-app-uart-c-multilink-master" from NordicPlayground and make it for central firmware. 

The system works well for 1 peripheral and 1 central. But the data is mess up for 2 peripherals and 1 central. After reviewing the record, the data from two peripherals seems mixed together. I have changed the "Device name" in the code and make it different with different peripherals. What should I do for multi peripherals transfer data to the central via UART service? Any help will be appreciated. Thanks.

Parents Reply Children
Related