Android Question Bluetooth receiving

Discussion in 'Android Questions' started by Cucuro, May 20, 2019.

?

How do make receving bluetooh?

  1. help me please

    0 vote(s)
    0.0%
  2. helpme please

    0 vote(s)
    0.0%
Multiple votes are allowed.
  1. Cucuro

    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
     
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. Cucuro

    Cucuro New Member

    Tyou but how use a fonction newdata
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice