iOS Question Bluetooth ESC/POS Printer Class

MarcoRome

Expert
Licensed User
Longtime User
Do you tried so:

B4X:
Sub Ble_PrinterFound(Name As String, ID As String)
    LabelInfo.Text=$"Found printer: ${Name}"$
    if Name.Contains("NameyourPrinter") then 
       Ble.connect(ID)
    else 
       'Search Again
       Ble.ScanPrinter
    End if  
End Sub
 
Upvote 0

Ali Alsaedi

Member
Licensed User
Longtime User
Is it not possible to display the list of devices and select the user? In this case, the Ble.Scan command must be called until the desired print is found
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
B4X:
Sub Ble_PrinterFound(Name As String, DeviceID As String)
    Dim PrinterMap As Map
    PrinterMap.Put(Name,DeviceID)

    ' List of printer

    For Each Device As String In PrinterMap.Keys
        Log($"DeviceName: ${Device}    DeviceID:${PrinterMap.Get(Device)}"$)
    Next
End Sub
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…