1) How to send text to printer by using Bluetooth?
I connected with method Serial1.Connect3(BtAdr, 1) only.
Another COMMs 0,2,3,4,5,6,7 and Serial1.Connect(BtAdr) => "BT - not ready" .
Sub Serial1_Connected (Success As Boolean)
Dim tw2 As TextWriter
If Success Then :ToastMessageShow("Bluetooth OK",false)
tw2.Initialize(Serial1.OutputStream)
tw2.Write("Line first" & Chr(13) & Chr(10))
tw2.Flush :tw2.close
serial1.Disconnect
Else :ToastMessageShow("BT - not ready",false)
End If
End Sub
I see info "Bluetooth OK" on display but printer doesn't print.
On Windows Mobile during paring BT device I have to mark in "advanced options" a checkbox "serial port".
My application works fine at WM.
At the android during paring BT device there are not "advanced options" but it has "FTP service" which doesn't work with printers.
I have tested "Bluetooth File Transfer" application from Android Market but it still hasn't helped (no transfer to printer).
2) How to send array of bytes to serial port (Bluetoth)?
Dim mybuff() as Byte
str = File.ReadString(MyDir, "print.txt")
mybuff= str.GetBytes("windows-1250")
I can write it to file as RandomAccesFile.WriteBytes but RAF doesn't have method like raf.Initialize4(Serial1.OutputStream). On b4ppc I used
method Serial1.Output2(mybuff())
Phones:
- HTC Desire HD A9191 with Android 2.3.3
- Samsung Omnia II with Windows Mobile 6.5 (no problems)
Versions of library: B4android: 1.60, Serial: 1.20
I connected with method Serial1.Connect3(BtAdr, 1) only.
Another COMMs 0,2,3,4,5,6,7 and Serial1.Connect(BtAdr) => "BT - not ready" .
Sub Serial1_Connected (Success As Boolean)
Dim tw2 As TextWriter
If Success Then :ToastMessageShow("Bluetooth OK",false)
tw2.Initialize(Serial1.OutputStream)
tw2.Write("Line first" & Chr(13) & Chr(10))
tw2.Flush :tw2.close
serial1.Disconnect
Else :ToastMessageShow("BT - not ready",false)
End If
End Sub
I see info "Bluetooth OK" on display but printer doesn't print.
On Windows Mobile during paring BT device I have to mark in "advanced options" a checkbox "serial port".
My application works fine at WM.
At the android during paring BT device there are not "advanced options" but it has "FTP service" which doesn't work with printers.
I have tested "Bluetooth File Transfer" application from Android Market but it still hasn't helped (no transfer to printer).
2) How to send array of bytes to serial port (Bluetoth)?
Dim mybuff() as Byte
str = File.ReadString(MyDir, "print.txt")
mybuff= str.GetBytes("windows-1250")
I can write it to file as RandomAccesFile.WriteBytes but RAF doesn't have method like raf.Initialize4(Serial1.OutputStream). On b4ppc I used
method Serial1.Output2(mybuff())
Phones:
- HTC Desire HD A9191 with Android 2.3.3
- Samsung Omnia II with Windows Mobile 6.5 (no problems)
Versions of library: B4android: 1.60, Serial: 1.20