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

Communicate Data Via BLE only between 2 devices

Hello,

I want to transmit data gain from an i2C sensor from one nRF52832 to another via BLE.

I have successfully configured i2C and now I can store those values to Variables.

What I want is, Transmit those values to a specified device within range. Like the deviceID of both Transmitter and Receiver is "A0005". So the transmitter should automatically connect with the corresponding Receiver and transmit Data.

Can you tell me a source to begin? I am using SDK17. What example from BLE_Pheripheral and BLE_Cetral I should use?

How to implement above-mentioned things?

Thanks in advance.

Parents
  • Hi,

    You can start with the ble_app_uart example which instead of TWI uses UART. After you have understood how that example works, you can try to merge the TWI scanner example into the ble_app_uart example and replace the UART part with TWI. Try to search in the forum, I'm pretty sure this has been discussed before.

    regards

    Jared 

  • Thank you. Now I can communicate with 2 devices via BLE.

    But I am getting errors while combining 2 programs(Twi read program and Ble communication Program)

     

    I have updated Config.h file and Included other .h and .c files.

    It successfully Builds when there is No function in main.c for TWI communication.

    But if I add any function of TWI to the main.c it shows errors and doesn't build.

    For example when I use the function "twi_master_nit()" which was exactly used in the separate TWI program. it shows the following error.

     

  • Hi,

    Most probably this is due to one or more of the following reasons:

    • The config file hasn't been configured properly. Diff your config file with the TWI example config file, and see what's different.
    • The path to the added source file isn't included in the project settings.
    • The proper header/source files haven't been included.

    regards

    Jared

Reply Children
No Data
Related