Reputation: 3
I am doing some Android programming for a receipt printer from Star Micronics. In the sample code it provides, there is a line I do not quite understand. I am puzzled by the fact that it is somewhat linking to assembly language or some sort of machine specific instructions.
ArrayList<Byte> list = new ArrayList<Byte>();
Byte[] tempList;
// Alignment (center)
list.addAll(Arrays.asList(new Byte[]{0x1b, 0x1d, 0x61, 0x01}));
Can someone tell me how that line achieves the center alignment?
Upvotes: 0
Views: 400
Reputation: 234847
This is almost surely a command sequence that is sent to the printer. The exact meaning depends on the printer model, but the byte values correspond to the following character sequence:
<ESC><GS>a<01>
If this were, say, a TSP200 series printer, then according to the programmer's manual (page 58) it corresponds to the function "Enable/disable automatic status transmission". Since you say that the effect is center alignment, I'm guessing it's simply a different printer model. Just check the escape sequences in the appropriate programmers manual.
Upvotes: 1