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

Make communication between ble central and ble peripheral

I am using Nordic NRF528321 with SDK 11.0 and soft device S132 as ble central.At peripheral side it is Nordic NRF51422 with SDK12.2 and soft device S130.I am trying to pair these two devices using the example codes. Ble peripheral starts advertising and Ble central starts scanning but the problem is ble central not able detect the uuid of the peripheral,simply it displays the 'scanning times out' message.I am newbie to the nordic.

I don't have any idea on where to update the Peripheral uuid at central side.Is there any updation in the program is required to make pairing in the example code or else just example code enough.I need to send some 25 bytes of data from the uart to peripheral and has to receive some 25 bytes of response from the peripheral.I was struggling to understand the events occurred between these two from the past two days.Please explain me the happenings in a simple way.

Kindly give me some suggestions where I need to add the update and what has to be included.

Awaiting for your responses.Thanks in advance.

Parents
  • Thank you so much for your response,Just started to going through the basic tutorials like making communication between android device as central and nordic peripheral.My requirement is,based on the request from the BLE central, I need to fetch some sensor data at regular intervals from the nordic peripheral and send back to the central device via nus and store it in database through uart serial communication.Really I am not having any idea,how to give the connection interval,at central side where I need to enter the UUID of the device which is advertising,to detect the device while scanning happens.Please tell me from where I need to start and share some sample code for ble central and peripheral communication.I can able to understand the concept,but it is very confusing while implementing it with the events.

  • NUS_BASE_UUID is the base for the Nordic UART Service(NUS) UUID.

    The peripheral(ble_app_uart) is advertising this BLE service NUS UUID in its advertising packet. When the central(ble_app_uart_c) is scanning, you will get a BLE_GAP_EVT_ADV_REPORT event with the content of any advertising packet it finds. The central application then calls the function is_uuid_present(), where it looks for the NUS UUID. If the UUID is found, it will connect to the peripheral.

    You can use the same UUID on all your peripherals. The most common way to uniquely identify the peripherals is by using the unique Bluetooth address of the peripheral device. You could also give the peripherals different names(DEVICE_NAME), the default name for ble_app_uart example is Nordic_UART.

  • Hi,

    Where can i get the unique bluetooth address of peripheral device when it is connected to the central?

    My application needs the unique bluetooth address of the peripheral,so that the central can identify each peripheral.

    Thank You

  • Hi vprasath,

    When the peripheral devices connects to your central, you will get a event BLE_GAP_EVT_CONNECTED. In this event you can find the 48-bit BLE address of the peripheral

    p_ble_evt->evt.gap_evt.params.connected.peer_addr

    While the device is connected, you can then use the associated connection handle to identify the device. p_ble_evt->evt.gap_evt.conn_handle

Reply
  • Hi vprasath,

    When the peripheral devices connects to your central, you will get a event BLE_GAP_EVT_CONNECTED. In this event you can find the 48-bit BLE address of the peripheral

    p_ble_evt->evt.gap_evt.params.connected.peer_addr

    While the device is connected, you can then use the associated connection handle to identify the device. p_ble_evt->evt.gap_evt.conn_handle

Children
No Data
Related