Android Question Bluetooth receiving

Cucuro

New Member
I need to make a communication with Smartphone and bluetooh module.
I can you send of information but I don't see how to receive the information that the module sends me and display it on the phone

My program:

Sub Globals

Private Label1 As Label
Private Button2 As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("bt")

If FirstTime Then
bluAdmin.Initialize("bluAdmin") ' initialise la classe bluAmin
bluSPP.Initialize("bluSPP") ' initialise la classe bluSPP
PairedDevices=bluSPP.GetPairedDevices ' récupere la liste des periph BT déja appairé ds la phone
End If
Dim I As List ' variable de liste
Dim j As Int ' pointeur de boucle
I.Initialize ' on initialise la liste
For j = 0 To PairedDevices.Size - 1
I.Add(PairedDevices.GetKeyAt(j)) ' on charge la liste
Next
Dim res As Int
res = InputList(I, "Choisir un appareil", -1) ' affiche la liste des BT dans une boite de dialogue
If res <> DialogResponse.CANCEL Then
bluSPP.Connect(PairedDevices.Get(I.Get(res))) ' connecte celui qui est choisi
End If
End Sub
Sub bluSPP_Connected (Success As Boolean)
ProgressDialogHide
Log("Connecte: " & Success)
If Success= False Then
Log(LastException.Message)
ToastMessageShow("Erreur de connection: " & LastException.Message, True)
Else
If datapipe.IsInitialized= False Then
datapipe.Initialize(bluSPP.InputStream, bluSPP.OutputStream, "datapipe")
End If
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
C=0xFF
cmdbuf(0) = C
If datapipe.IsInitialized=False Then Return ' si datapipe non pret on sort
datapipe.Write(cmdbuf)

ToastMessageShow ("Demande en cours ",False)

End Sub
Sub Button1_Click
C=0Xff
cmdbuf(0)= C
If datapipe.IsInitialized=False Then Return ' si datapipe non pret on sort
datapipe.Write(cmdbuf)
ToastMessageShow ("Demande en cours ",False)

End Sub
Sub Button2_Click
Activity.Finish
End Sub
 
Top