Hello everyone,
I have a Bluetooth Rfid reader, the conexion with it I have made with BLE 2, I can read and write characteristics to reader.
Now I need to receive the data from the readings TAGS, I read this post https://www.b4x.com/android/forum/threads/rfid-reader-connection.73322/#post-465827 and it says "Make sure to initialize AsyncStreams in non-prefix mode"
I am trying the way to connect AsyncStreams, but I only found examples with Bluetooth Admin and serial.
Anyway I tried serial but I do not have good results, I do not know if I'm doing it right.
Can you help me with how I can receive the data with AsyncStreams or by other way ???
Thanks in advance.
I have a Bluetooth Rfid reader, the conexion with it I have made with BLE 2, I can read and write characteristics to reader.
Now I need to receive the data from the readings TAGS, I read this post https://www.b4x.com/android/forum/threads/rfid-reader-connection.73322/#post-465827 and it says "Make sure to initialize AsyncStreams in non-prefix mode"
I am trying the way to connect AsyncStreams, but I only found examples with Bluetooth Admin and serial.
Anyway I tried serial but I do not have good results, I do not know if I'm doing it right.
B4X:
Sub Process_Globals
Public manager As BleManager2
Dim BTConnection As Serial
Dim Astream As AsyncStreams
End Sub
Sub Manager_DeviceFound (Name As String, Id As String, AdvertisingData As Map, RSSI As Double)
Log("Found: " & Name & ", " & Id & ", RSSI = " & RSSI & ", " & AdvertisingData)
manager.StopScan
manager.Connect2(Id, False) 'disabling auto connect can make the connection quicker
BTConnection.Initialize("RFIDreader")
BTConnection.Connect(Id)
End Sub
Sub RFIDreader_Connected (Success As Boolean)
If Success Then
Log("RFID conectado")
Astream.Initialize(BTConnection.InputStream,Null,"RFIDreaderAs")
Else
ToastMessageShow("RFID no encontrado...",False)
End If
End Sub
Can you help me with how I can receive the data with AsyncStreams or by other way ???
Thanks in advance.