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

Multirole Connection: can we send a broadcast ini advertising mode while in ble connection mode at the same time?

Hi,

I have 3 Devices that constantly broadcast their position to each other so the other can adjust the position each other. they act like master and slave but ther are no connection between them.

now i want to connect one of those 3 to a smartphone using connection mode but the problem is the smartphone can't detect the device which is now act as broadcaster in advertsing mode. is it possible to use advertising mode and connection mode at the same time?

how can i establish a connection between the device and phone while the device send message as broadcaster to another 2 devices?

is multirole still the most suitable solution to this problem?

  • Hi,

    is multirole still the most suitable solution to this problem?

     Yes ;)

    regards

    Jared

  • Hi Jared,

    thanks for your respond, now i don't want to use multirole because i don't want establish a connection between those 3 devices so there are no master and slave,

    so i already wrote a code for non-connectable advertisiment (the device as broadcaster) and before that i established the connection between the device and the phone but it return an error for function nrf_sdh_enable_request, ble_radio_notification_init, nrf_sdh_ble_enable, sd_ble_gap_adv_set_configure all retuns an invalid_state error.

  • Hi,

    The peripherals shouldn't automatically send a connection request because they've scanned the advertising peripheral. I don't see any issues with using multi-role.  The peripherals can advertise in connectable mode, and then scan the other peripherals when they act as a central without sending a connection request. 

    regards

    Jared 

  • Hi Jared,

    thanks for gettiing back to me,

    at first i also thought about multi-role but after i discussed it with my supervisor, we want to maintain the broadcaster role, we want to maintain their equal role (broadcaster and observer). because what i understood, if i use multi-role than the role between 3 devices changes to master and slave with one central.

    and then scan the other peripherals when they act as a central without sending a connection request.

    so after the connection with the phone established the central role can't broadcast the message? or i missunderstood?

  • My understanding is that you have 3 requirement for each device:

    1. It should scan the advertising packet of the other devices without sending a connection request (Observer role)
    2. It should advertise to the other devices devices without accepting a connection request from them ( Broadcaster role). This requirement might be omitted, see explanation further down. 
    3. It should accept a connection request from the smartphone ( Peripheral role)

    I assume that you want to advertise the same packet to both smartphone and the devices. 

    Andhika said:
    at first i also thought about multi-role but after i discussed it with my supervisor, we want to maintain the broadcaster role, we want to maintain their equal role (broadcaster and observer)

    I'm not sure what you mean with equal role, could you elaborate?

    You could achieve step 1 and 2 if each device scans without sending a connection request ( Observer role) and at the same time advertises. You don't need to implement the broadcast role i.e if the other devices don't send a connection request. The devices can advertise as connectable, which would make it possible for the smartphone to connect.

    I still think multi-role is the way to go. Maybe the forum has a better suggestion ;) 

    regards

    Jared 

Related