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

Android BLE for direct advertisment.

Hi, I am trying to write a small android app to send direct advertisement to particular device. i am using 0001 for direct advertisment. But when i advertise the data, message is received for all the devices. can you let me know or share an example for this in android.

Thank you Rohit Iti

Parents
  • There's no such thing as directed advertisement with data. The ADV_DIRECT_IND mode's payload consists only of the advertiser and initiator's device addresses.

    Nor do I know what you mean by 'i am using 0001 for directed advertising', either way, if you are actually setting up ADV_DIRECT_IND then you shouldn't have any data in it. So if you do, I wonder if you are actually in the correct advertising mode.

    Advertising packets are received by all devices. Advertised data is public.

  • every device sees every advertising packet, it has to in order to work out what it is. If it's a ADV_DIRECT_IND, which is the only packet with a directed address in it, it will either discard the packet if it's not the recipient, or connect immediately if it is.

    Here's a better question - in your original post you said "message is received for all the devices", what do you mean by that? If you have truly sent an ADV_DIRECT_IND advertising packet then yes all devices will see it and process it, however the only thing which would happen is the one addressed device will go instantly into connection, the others would see the packet, but ignore it.

    And that's the only directed advertising you can do, ask another device to connect to you, you can't put in manufacturer data or something and send that advertising packet to one recipient only.

Reply
  • every device sees every advertising packet, it has to in order to work out what it is. If it's a ADV_DIRECT_IND, which is the only packet with a directed address in it, it will either discard the packet if it's not the recipient, or connect immediately if it is.

    Here's a better question - in your original post you said "message is received for all the devices", what do you mean by that? If you have truly sent an ADV_DIRECT_IND advertising packet then yes all devices will see it and process it, however the only thing which would happen is the one addressed device will go instantly into connection, the others would see the packet, but ignore it.

    And that's the only directed advertising you can do, ask another device to connect to you, you can't put in manufacturer data or something and send that advertising packet to one recipient only.

Children
No Data
Related