Android Question Module bluetooth problem

i have this kind of problem with a bluetooth module:

Start with this i wirte this Log:
Connected, servizi: (ArrayList) [00001800-0000-1000-8000-00805f9b34fb, 00001801-0000-1000-8000-00805f9b34fb, 00005301-0000-0041-4c50-574953450000] DONE
The service that i want is only Servizio id: 00005301-0000-0041-4c50-574953450000 DONE
This service have now 2 Characteristic: Key: 00005303-0000-0041-4c50-574953450000 (NOTIFY) RX | Key: 00005302-0000-0041-4c50-574953450000(WRITE) TX

The problem is here:

I have to send this value at TX:
B4X:
Dim startCommandBytes() As Byte = Array As Byte(5,6,64,0,8,1,91,149)
And
B4X:
Dim passwordLogin As String = "00000000"
Dim passwordBytes() As Byte = passwordLogin.GetBytes("UTF8")

The problem is that the RX not return me nothing......
The attach file is the File.txt that i have Vs the File.txt that i have to have

Example of Code:
Piece Of Code:
Dim startCommandBytes() As Byte = Array As Byte(5,6,64,0,8,1,91,149)
                Dim passwordLogin As String = "00000000"
                Dim passwordBytes() As Byte = passwordLogin.GetBytes("UTF8")
                
                
                blmanager.WriteData("00005301-0000-0041-4c50-574953450000", "00005302-0000-0041-4c50-574953450000", startCommandBytes) 'TX
                blmanager.WriteData("00005301-0000-0041-4c50-574953450000", "00005302-0000-0041-4c50-574953450000", passwordBytes)
                blmanager.SetNotify("00005301-0000-0041-4c50-574953450000", "00005303-0000-0041-4c50-574953450000",True) 'RX
 

Attachments

  • CorrectFile.txt
    18.6 KB · Views: 13
  • MyFile.txt
    3.4 KB · Views: 18

jimseng

Active Member
Licensed User
Longtime User
I'm not the best person to answer this but since no-one else has yet...For me I had to put the blmanager.SetNotify() in the Sub StateChanged event, just once when the connection was established. When you say RX doesn't return anything, do you mean the _DataAvailable event doesn't get triggered?
 
Upvote 0
i'll give you the right example that the company give it to me
if you look the image in this message that i attach, you can see the:
CUSTOM SERVICE
with the 2 characteristic and the message that the company give to me was this:
"The first one is a RX and the second one is TX, you have to send START msg -> (5,6,64,0,8,1,91,149) and the set the RX for receive the data, and in a instant you receive all EVA-DTS data"
but i cannot do to have this result, even in B4A on my app and even in BLE_Manager App
 

Attachments

  • Screenshot_20240508-092359_BLE_Scanner_1_407x837_100.jpg
    Screenshot_20240508-092359_BLE_Scanner_1_407x837_100.jpg
    95.5 KB · Views: 15
Upvote 0
Top