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

Multicast message over BLE

Hello,

Is there a way to multicast messages from BLE client to multiple servers? I know mesh does the same job but we are exploring a possibility to do the same using standard BLE SDK.

Regards.

Parents Reply Children
  • Edvin said:
    A GATT Connection has Acknowledgements, and retransmissions if the packet is lost on air. Advertisements doesn't have this, and typically phones doesn't allow you to scan 100% of the time either. So the reliability of advertisements reaching the phones depends heavily on how long (how many times) you advertise with the same message, the advertising interval of the peripheral and the scan settings on the phone (which you do not have full access to). 

     I don't think the type of broadcast you are looking for is possible in BLE. 

     

    Aftab said:
    Can a central device broadcast the advertisement messages? Or it has to be a peripheral and central only listens to the packets?

     A central can advertise, if that is what you are asking, but then the advertisements are as a peripheral/advertiser role. Any device can scan and advertise, but it is not reliable for data transfer.

    One case where it can be applied:

    You have a temperature sensor, and this device can advertise the current temperature in it's advertisements.

    One case where it will not work:

    You want to transfer a file that is too large to fit in an advertisement. The reason this doesn't work is that you would need to update the advertising data, but you don't know if/when the scanner has received the advertising packet, and when it is safe to update to the next advertising packet containing the next dataset. You can of course wait some seconds before you update, but that would be very slow.

    What you can do is to send the data that you want to send to all connected devices. Something like this (pseudo code):

    static void send_to_all(uint8_t *data)
    {
        for (int i=0; i< connected_devices; i++)
        {
            send_data(data, connected_device[i]);
        }
    }

Related