A Arun Kumar Rajan New Member Licensed User Longtime User Jul 19, 2014 #1 Hello friends, kindly help me to get bluetooth rssi (signal strenth). I am very new to b4a and tried with almost every tutorial about bluetooth rssi with broadcostreceiver library. But i cant get code work. Please anyone help me Thanks in advance
Hello friends, kindly help me to get bluetooth rssi (signal strenth). I am very new to b4a and tried with almost every tutorial about bluetooth rssi with broadcostreceiver library. But i cant get code work. Please anyone help me Thanks in advance
Erel B4X founder Staff member Licensed User Longtime User Jul 20, 2014 #2 Add a service to your project (named Service1). Add this code to the manifest editor: Code: Copy AddReceiverText(service1, <intent-filter> <action android:name="android.bluetooth.device.action.FOUND" /> </intent-filter>) Service_Start will be called whenever a Bluetooth device is discovered: Code: Copy Sub Service_Start (StartingIntent As Intent) If StartingIntent.Action = "android.bluetooth.device.action.FOUND" Then Dim rssi As Int = StartingIntent.GetExtra("android.bluetooth.device.extra.RSSI") Log("rssi: " & rssi) End If End Sub Call BluetoothAdmin.StartDiscovery to search for devices. You can see the list of fields here: http://developer.android.com/reference/android/bluetooth/BluetoothDevice.html#EXTRA_CLASS Last edited: Jul 20, 2014 Upvote 0
Add a service to your project (named Service1). Add this code to the manifest editor: Code: Copy AddReceiverText(service1, <intent-filter> <action android:name="android.bluetooth.device.action.FOUND" /> </intent-filter>) Service_Start will be called whenever a Bluetooth device is discovered: Code: Copy Sub Service_Start (StartingIntent As Intent) If StartingIntent.Action = "android.bluetooth.device.action.FOUND" Then Dim rssi As Int = StartingIntent.GetExtra("android.bluetooth.device.extra.RSSI") Log("rssi: " & rssi) End If End Sub Call BluetoothAdmin.StartDiscovery to search for devices. You can see the list of fields here: http://developer.android.com/reference/android/bluetooth/BluetoothDevice.html#EXTRA_CLASS
A Arun Kumar Rajan New Member Licensed User Longtime User Jul 20, 2014 #3 Thank you friend, Now my code working.... Thanks lot. Upvote 0
techknight Well-Known Member Licensed User Longtime User Jun 28, 2016 #4 How do I match this up to a particular device? How would I know? Upvote 0
techknight Well-Known Member Licensed User Longtime User Jun 28, 2016 #6 Yes, but still relevant on what I am looking to achieve. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jun 28, 2016 #7 You should start a new thread with your question and post a link to this one. Upvote 0