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.