Currently I am working with a POS printer mobile application. I have done text, image and barcode or qrcode printing methods. Now I am trying to retrieve printer status using ESC/POS commands. Below I have attached the code to check the status of print.
inStream = btSocket.InputStream;
outStream = btSocket.OutputStream;
byte[] reader = new byte[1024];
//Send command to printer
byte[] @try = "\x10\x04\x01".ToBytes();
outStream.Write(@try, 0, @try.Length);
//Read from printer
if (inStream.CanRead)
{
//string stat_res = inStream.Read(reader).ToString();
inStream.Read(reader, 0, reader.Length);
string text = Encoding.UTF8.GetString(reader, 0, reader.Length);
Debug.WriteLine($"Status res: {text}");
}
I have tested the code above and i received output as stated below.
In string form it output as an up/down arrow
[0:] Status res: ?
or in integer form
[0:] Status res: 1
May I know what mistake I did here? I have referred other questions which developed using python or java and converted to C# and it still doesn't produce correct output as I expect. May I know what I did wrong here? I am using ESCPOS Nuget in order to convert text to byte form.
The printer i am using Bixolon and model is SPP-R410. I am developing this application in Xamarin forms using ESC/POS commands.
Thanks.