AgentKnopf
AgentKnopf

Reputation: 4335

Requesting Battery status from Mobile Bluetooth Printer (ESC/POS)

I am successfully printing to a Bixolon SPP-R200 mobile bluetooth printer.

I would now like to ask the printer for it's current battery level. Based on the Bixolon command manual, the following command should accomplish this:

enter image description here

I am able to successfully send data to and read data from the printer (so that's not part of the issue as far as I can see). My problem is understanding the above given command:

  1. Is there a special reason to write the value of fn and m directly into the format and later define the values of fn and m AGAIN ? In a previous command it was done differently: Instead of writing plain numbers into the Format, the variables were used and later defined in the range.
  2. Am I correct in assuming a 4-byte long response from the printer?

My second issue is the ESC= n (Select peripheral device) command:

enter image description here

  1. My printer has no display, it's a simple ESC/POS bluetooth printer. On the other end I have a smartphone (running Android, hence my code is in Java) that is sending these commands to the printer. Is the point of this command to send data to different interfaces within a printer (the display, the printing unit itself etc...)?
  2. If my assumption at the end of question one is correct, then I suppose I'd have to pass n = 2, because the printer battery command specifically says: "This command is effective, when the printer is disabled by ESC = n"
  3. How do I get "back to normal" after sending the battery command and evaluating the reponse, so I can continue printing to the printer? Would it be as simple as writing ESC = 1 (which would enable the printer again)?

Thanks in advance and please let me know if there are further questions.

Upvotes: 1

Views: 1756

Answers (1)

Manivannan Radhakannan
Manivannan Radhakannan

Reputation: 185

My printer has no display, it's a simple ESC/POS bluetooth printer. On the other end I have a smartphone (running Android, hence my code is in Java) that is sending these commands to the printer. Is the point of this command to send data to different interfaces within a printer (the display, the printing unit itself etc...)?

Point of this command is to identify which devices' battery status you are interested in. Your assumption is correct. So for your ESC/POS n=1 should be sufficient

If my assumption at the end of question one is correct, then I suppose I'd have to pass n = 2, because the printer battery command specifically says: "This command is effective, when the printer is disabled by ESC = n"

The instruction does not make sense. I believe the ESC points to the peripheral from which we need data.

How do I get "back to normal" after sending the battery command and evaluating the response, so I can continue printing to the printer? Would it be as simple as writing ESC = 1 (which would enable the printer again)?

This is a information related command and to my understanding it should not disturb the printer functionality. On receiving battery status , you can carry out the normal printing activity.

Upvotes: 1

Related Questions