Hi All
I am using the BLE sample code to print to a bluetooth mini printer
The Log in the connected event looks like this
I was trying to figure out the proper service and id to use to print.
So what I did is this:
The data is printed for the following 3 cases:
What is the proper way of determining which service and id to use for printing?
Thanks in advance
I am using the BLE sample code to print to a bluetooth mini printer
The Log in the connected event looks like this
B4X:
Found: Thermal Printer, 7707E342-B321-4E40-ABB8-EF384D43CD92, RSSI = -38, (read only map) {
kCBAdvDataIsConnectable = 1;
kCBAdvDataLocalName = "Thermal Printer";
kCBAdvDataServiceUUIDs = (
18F0,
"E7810A71-73AE-499D-8C15-FAA9AEF0C3F2"
);
kCBAdvDataTxPowerLevel = 4;
}
I was trying to figure out the proper service and id to use to print.
So what I did is this:
B4X:
Sub Manager_DataAvailable (Service As String, Characteristics As Map)
ActivityIndicator2.Visible = False
clv.Add(CreateServiceItem(Service), 30, "")
For Each id As String In Characteristics.Keys
clv.Add(CreateCharacteristicItem(id, Characteristics.Get(id)), 40, "")
Dim s As String = "abcde"
Dim msg() As Byte = s.GetBytes("ASCII")
Dim msg2(msg.Length + 2) As Byte
ByteConv1.ArrayCopy(msg,0,msg2,0,msg.Length)
msg2(msg.Length) = 10
msg2(msg.Length+ 1) = 13
Log ( " ID " & Service & " " & id)
manager.WriteData(Service,id, msg2)
Next
End Sub
The data is printed for the following 3 cases:
B4X:
ID 49535343-FE7D-4AE5-8FA9-9FAFD205E455 49535343-8841-43F4-A8D4-ECBE34729BB3
ID 18F0 2AF1
ID E7810A71-73AE-499D-8C15-FAA9AEF0C3F2 BEF8D6C9-9C21-4C9E-B632-BD58C1009F9F
What is the proper way of determining which service and id to use for printing?
Thanks in advance