EM220II iOS SDK directIO: Documentation

Article ID: 52631810

Details


 
Topic or Information

Documentation for the EM220II iOS SDK does not specify all the parameters for the function directIO.

Applies To

Zebra EM220II Mobile Printer

Details
 
ProtoType (long)directIO:(NSData *)request
requiredSize:(NSInteger) requiredSize
response:(NSData **)response
Parameters [Parameters]
request
It contains the ANSI CODE data to be sent to printer.
requiredSize
It contains the expected size of the response from the printer.
response
        It contains the response from printer.
Example [Example]
BXPrinterController* pController  = [BXPrinterController getInstance];
If(pController != nil)
NSLog (@”getInstance Fail.”);
If (BXL_SUCCESS == [pController msrReadReady] )
NSLog(@”msrReadReady   Success.”);
BYTE test1[] = {0x30, 0x31, 0x32, 0x0d, 0x0a};
if(BXL_SUCCESS ==
[pController directIO:[NSData dataWithBytes:test
length:sizeof(test1)]
requiredSize:0
response:nil])
{
    NSLog(@””directIO Success. ”);
}
BYTE test2[] = {0x10, 0x04, 0x02};
NSData* dataResponse = nil;
if(BXL_SUCCESS ==
[pController directIO:[NSData dataWithBytes:test
length:sizeof(test2)]
requiredSize:1
response:&dataResponse])
{
    NSLog(@””directIO Success. Response : %d”, dataRespons.bytes);
}