Android Question Send or receive bytes via Bluetooth

djrazvan88

New Member
Licensed User
Longtime User
Hello everyone how can I insert a simple 0-255 bytes Bluetooth because I can not figure out how to do it are conesso external bluetooth module, but I can not send anything.

Thanks in advance for any help

sorry for my english I hope that I did understand what I am looking for
 

djrazvan88

New Member
Licensed User
Longtime User
and this is my code as I enter the string you gave me to send it to the specified touch button1. thank you very much in advance for any help you can give me

B4X:
Sub Process_Globals
  
  
End Sub

Sub Globals

    Dim admin As BluetoothAdmin
    Dim serial1 As Serial
    Dim buffer() As Byte = Array As Byte(0xf0, 0x02, 0x80, 0x0A)
    Dim astream As AsyncStreams
    Private Button1 As Button


End Sub

Sub Activity_Create(FirstTime As Boolean)

    If astream.IsInitialized = True Then
    End If
    If FirstTime Then
    admin.Initialize("admin")
    serial1.Initialize("serial1")
    serial1.Connect("00:12:6F:32:A3:50") 'this is my mac address of the external device
    End If
    Activity.LoadLayout("Layout1")

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub Button1_Click

     'What should I write here to send a byte through bluetooth ????

End Sub
 
Upvote 0
Top