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.

Parents
  • 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.

Reply
  • 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.

Children
No Data
Related