B4R Question Bluetooth-Example to communicate with Android

Erel

B4X founder
Staff member
Licensed User
Longtime User
Are you monitoring the logs?

See the code in the starter service. You need to change the device name:
B4X:
Private Sub admin_DeviceFound (Name As String, MacAddress As String)
   Log($"Device found: ${Name}"$)
   If Name = "HC-05" Then '<-------------------------------------
     Log("Trying to connect...")
     admin.CancelDiscovery
     serial.Connect(MacAddress)
   End If
End Sub
 
Upvote 0

newbie

Member
Licensed User
Longtime User
Are you monitoring the logs?

See the code in the starter service. You need to change the device name:
B4X:
Private Sub admin_DeviceFound (Name As String, MacAddress As String)
   Log($"Device found: ${Name}"$)
   If Name = "HC-05" Then '<-------------------------------------
     Log("Trying to connect...")
     admin.CancelDiscovery
     serial.Connect(MacAddress)
   End If
End Sub

Thanks, now it works :)
another question: is ther a possibility to handle more than one arduino devices with HC-06 ??
 
Upvote 0
Top