Android Question serial.connect dosn't work (b4a 6.5, serial 1.26)

wigigo

Member
Licensed User
Longtime User
wigigoNew MemberLicensed User
I'm using serial 1.26. I add the permission access_coarse_location. i'm running b4a 6.5
the discovery process fires the start and finished event, but never the devicefound event

the serial getpaireddevices show all possible devices, but serial.connect dosn't connect to the choosen device.

manually i can choose the device, it's working fine.
 

Cableguy

Expert
Licensed User
Longtime User
Without posting your code, or a sample code that demonstrates this behaviour there's not much we can do to help...
 
Upvote 0

wigigo

Member
Licensed User
Longtime User
Sub connect_Philips
Dim m As Map, i As Int
m= serial1.GetPairedDevices
For i = 0 To m.Size - 1
If m.GetKeyAt(i)="Philips AEA2700" Then
serial1.Listen
serial1.Connect(m.GetValueAt(i))
ToastMessageShow("MAP: Verbinden " & m.GetKeyAt(i) & " " & m.GetValueAt(i),True)
File.WriteString(sd_root,sd_pfad & "/cp_mp3_PhilipsAEA2700.txt",m.GetValueAt(i))
Exit
End If
Next
End Sub

Beim Debuggen sieht man, dass alle gekoppelten Devices gefunden werden, der Philips Device ist dabei, die Toastmessage wird angezeigt, verbunden wird nicht.

das manifest file:

'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="4" />
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTHADMIN" /> )

SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")


'End of default text.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
the discovery process fires the start and finished event, but never the devicefound event
Is the other device in discoverable mode?

I add the permission access_coarse_location. i'm running b4a 6.5
This is not needed. It is added automatically.

but serial.connect dosn't connect to the choosen device.
You can only connect to devices that are waiting for SPP connections.
 
Upvote 0

wigigo

Member
Licensed User
Longtime User
Ok, many thanks. This would be the problem. It's the conentor to my amplifyer to transfer mp3 in high quality, i think this is not spp.
 
Upvote 0
Top