This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Communicate with two Nrf51822

I want to Communicate with two Nrf51822 device

The slave (S110 SDK6.1) will do a echo function . For example Get uart data and will send out same data but over BLE. And get data by BLE will send it out over UART.It tested by mobile,it's ok.

And I try to use the master Nrf51822 device to do the same thing, let two devices Communicate. (s120 nrf51_2.1 SDK 9.0 ) I use the project in the SDK .

C:\Keil_v5\ARM\Device\nRF51_SDK_9.0.0_2e23562\examples
ble_central\ble_app_multilink_central\pca10028\s120\arm5_no_packs

I Can let two devices's BLE connected .(Use LED to show it's connected or not ). But I don't know how to send data from Master to the Slave over BLE.

My question is,it's there a function or command that can do the thing i want? Send data from Master to Slave by BLE?

Please,if anyone have some direction or suggestion please let me know. Thank you.

  • Have a look at this example.

    More specifically the ble_uart_c_write_string() function.

  • thank you.This example is different from which i found before,same project name,It's little strange.But whatever it's work now!Can send data from Master to slave by BLE.Thank you for your answer again. But some how it will goes to HardFault_Handler. I only add some simple code. uint8_t data_array[5]; uint8_t index=5; data_array[0]=0xAA; data_array[1]=0xBB; data_array[2]=0xCC; data_array[3]=0xDD; data_array[4]=0xEE; for (;;) {

    		if(connected==1)
    		{
    			nrf_delay_ms(1000);
    			ble_uart_c_write_string(&m_ble_uart_c, data_array, index);
    		}				
    		
    		power_manage();
    }
    

    It's there any problem i made? Sorry for further question.

  • I think i got the problem and it seems solved. And it's possible that the master send the data by BLE without send out data with UART in the same time? I whant to keep the UART for other use.

  • You can use the UART for something else.

  • Thank you. Is it possible that use the example you provided to connect two or more slave devices? I tried edit the

    DEVICE_MANAGER_MAX_APPLICATIONS

    DEVICE_MANAGER_MAX_CONNECTIONS

    But it is no use. Only can one slave to be connected. And the master goes to error 0x11. Should I edit the slave UUID?If yes where can i edit? It's there relationship the UUID between the devicename? Thank you again.

Related