Topics

BLE Central and peripheral role #ble #bluetooth


nrjn
 

Hello,
 
Is there a sample code or documentation explaining how to use a BLE device in both central and peripheral roles concurrently?
 
I have a couple of environmental sensors (BLE peripherals) talking to a hub (BLE Central).
 
I want to control the hub and get data out of the hub through a smartphone.
So, I want the hub to function as both central and peripheral.
 
Thank you


Carles Cufi
 

Hi there,

 

I don’t think there’s a sample that shows both roles, but combining one of the peripheral samples and a central one should be very straightforward.

Please consider contributing such a sample if you put one together that can serve as a starting point for others.

 

Thanks!

 

Carles

 

From: users@... <users@...> On Behalf Of nrjn nrjn via Lists.Zephyrproject.Org
Sent: 18 July 2019 01:02
To: users@...
Cc: users@...
Subject: [Zephyr-users] BLE Central and peripheral role #bluetooth #ble

 

Hello,

 

Is there a sample code or documentation explaining how to use a BLE device in both central and peripheral roles concurrently?

 

I have a couple of environmental sensors (BLE peripherals) talking to a hub (BLE Central).

 

I want to control the hub and get data out of the hub through a smartphone.

So, I want the hub to function as both central and peripheral.

 

Thank you


nrjn
 

Hello Carles,

I created a sample code which enables nrf52840-DK to function as both central and peripheral heart rate monitors.
Herer it is:  https://github.com/nrjn/zephyr-ble-central-and-peripheral-hr

Thank you 


alfredolimams@...
 

Hi,

I recommend that you use an example in subsys->bluetooth->shell. 
There are many commands to shell as connect a central with peripheral, read, write, notify and other functions of Bluetooth (GATT).

The link is https://github.com/zephyrproject-rtos/zephyr/tree/master/subsys/bluetooth/shell .

Em qui, 18 de jul de 2019 às 11:55, nrjn nrjn <nrjnx0@...> escreveu:

Hello Carles,

I created a sample code which enables nrf52840-DK to function as both central and peripheral heart rate monitors.
Herer it is:  https://github.com/nrjn/zephyr-ble-central-and-peripheral-hr

Thank you 


Vinayak Kariappa
 

Take a look at tests/bluetooth/shell that uses subsys/bluetooth/shell/bt.c 

The shell application combines all states and roles into single application


On 18-Jul-2019, at 5:19 PM, Cufi, Carles <carles.cufi@...> wrote:

Hi there,

 

I don’t think there’s a sample that shows both roles, but combining one of the peripheral samples and a central one should be very straightforward.

Please consider contributing such a sample if you put one together that can serve as a starting point for others.

 

Thanks!

 

Carles

 

From: users@... <users@...> On Behalf Of nrjn nrjn via Lists.Zephyrproject.Org
Sent: 18 July 2019 01:02
To: users@...
Cc: users@...
Subject: [Zephyr-users] BLE Central and peripheral role #bluetooth #ble

 

Hello,

 

Is there a sample code or documentation explaining how to use a BLE device in both central and peripheral roles concurrently?

 

I have a couple of environmental sensors (BLE peripherals) talking to a hub (BLE Central).

 

I want to control the hub and get data out of the hub through a smartphone.

So, I want the hub to function as both central and peripheral.

 

Thank you


nrjn
 

Thank you Alfredo and Vinayak, bluetooth/shell is a perfect reference point.