How to broadcast a custom action in android

189 views Asked by At

I am writing an application that uses the bluetooth capability. I would like to broadcast a custom string and then have devices that are listening, be able to receive that string and proceed with the program. I understand how to capture a broadcast(BroadCastReceiver). My issue is "braodcasting" the custom string(action). If someone could point me in the right direction, it would be greatly appreciated.

1

There are 1 answers

0
JavaDM On

Once Bluetooth devices are put into operation, the individual Bluetooth controller sends within two seconds to identify an individual and unique 48-bit long MAC address. In standby mode, unconnected listening devices at distances of up to 2.56 seconds for messages (Scan mode) and check that 32 hop frequencies. The contact with the slaves is made by an inquiry message, and then by a Page message if the hardware address of the device is unknown. With a known address, the first step wouldn't be done. In the Page state, the master sends 16 identical page messages on 16 different hopping frequencies are determined for the slaves. After the stations are in the Connected state. Average up a connection within half the scan interval, eg 2.56 / 2 seconds (1.28 seconds) achieved.