Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void) randomTest
- {
- char printerInitializeCommand [] = {0x1b,'@'};
- char formFeed[] = "\x1B\x0C\x00";
- char printableWidthCommand[] = {0x1b,0x1e,'A',0x00};
- char setRasterPageLengthCommand [] = {0x1b,'*','r','P','0',0x00};
- char startPageCommand [] = {0x00};
- char printDensityCommand [] = {0x1b,0x1e,'d','3' };
- char rasterModeStartCommand [] = {0x1b,'*','r','R',0x1b,'*','r','A'};
- char printSpeedCommand [] = {0x1b,'*','r','Q','0',0x00};
- char docCutTypeCommand [] = {0x1b,'*','r','E','9',0x00};
- char rasterImage [] = {
- // n1 n2 d1 d2..
- 0x1b, 'b', 0x2, 0, 0x00, 0x00, // data
- 0x1b, 'b', 0x2, 0, 0x1F, 0xF8,
- 0x1b, 'b', 0x2, 0, 0x3F, 0xFC,
- 0x1b, 'b', 0x2, 0, 0x77, 0xEE,
- 0x1b, 'b', 0x2, 0, 0xF8, 0x1F,
- 0x1b, 'b', 0x2, 0, 0xF8, 0x1F,
- 0x1b, 'b', 0x2, 0, 0xF8, 0x1F,
- 0x1b, 'b', 0x2, 0, 0x0F, 0xF0,
- 0x1b, 'b', 0x2, 0, 0x1F, 0xF8,
- 0x1b, 'b', 0x2, 0, 0x1F, 0xF8,
- 0x1b, 'b', 0x2, 0, 0x3E, 0x7C,
- 0x1b, 'b', 0x2, 0, 0x38, 0x1C,
- 0x1b, 'b', 0x2, 0, 0x79, 0x9E,
- 0x1b, 'b', 0x2, 0, 0x73, 0xCE,
- 0x1b, 'b', 0x2, 0, 0x73, 0xCE,
- 0x1b, 'b', 0x2, 0, 0xF9, 0x9F,
- 0x1b, 'b', 0x2, 0, 0xF8, 0x1F,
- 0x1b, 'b', 0x2, 0, 0xFE, 0x7F,
- 0x1b, 'b', 0x2, 0, 0xFF, 0xFF,
- 0x1b, 'b', 0x2, 0, 0xFF, 0xFF,
- 0x1b, 'b', 0x2, 0, 0x00, 0x00,
- 0x1b, 'b', 0x2, 0, 0x00, 0x00,
- 0x1b, 'b', 0x2, 0, 0x00, 0x00,
- 0x1b, 'b', 0x2, 0, 0x00, 0x00};
- char endPageCommand [] = {0x1b,'*','r','Y','1',0x00,0x1b,0x0c};
- char endJobCommand [] = {0x04,0x1b,'*','r','B'};
- [self sendBytes:printerInitializeCommand ofLength:sizeof(printerInitializeCommand)];
- [self sendBytes:printableWidthCommand ofLength:sizeof(printableWidthCommand)];
- [self sendBytes:printDensityCommand ofLength:sizeof(printDensityCommand)];
- [self sendBytes:rasterModeStartCommand ofLength:sizeof(rasterModeStartCommand)];
- [self sendBytes:printSpeedCommand ofLength:sizeof(printSpeedCommand)];
- [self sendBytes:setRasterPageLengthCommand ofLength:sizeof(setRasterPageLengthCommand)];
- [self sendBytes:docCutTypeCommand ofLength:sizeof(docCutTypeCommand)];
- [self sendBytes:startPageCommand ofLength:sizeof(startPageCommand)];
- [self sendBytes:rasterImage ofLength:sizeof(rasterImage)];
- [self sendBytes:endPageCommand ofLength:sizeof(endPageCommand)];
- [self sendBytes:endJobCommand ofLength:sizeof(endJobCommand)];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement