Native App Print for iOS
API Download
SDK Download for iOSReference Guide
Setting SDK Project
Registration with the Apple Developer Program is required to develop iOS applications. Refer to the Apple Developer’s Website (http://developer.apple.com/devcenter/ios) for detail.
1 Adding ExternalAccessory.framework
1) Select project file
2) Select [Info] tab
3) Ctrl-click in the Area 3
4) Select [Add Row] from the pop up menu
5) Enter “Supported external accessory protocols”.
6) Enter “com.bixolon.protocol” in the Items field.
2 Adding Bluetooth Protocol
1) Select Project, Info, and + in the order shown below.
2) Search “ExternalAccessory.framework” and click the [Add] to add it.
3 Adding Library to Project
Drag the library folder and drop it to the project.
mPOS Controller Devices
Inherits from |
NSObject |
Framework |
MPosSDK.a |
Declared |
MPosControllerDevices .h |
1 Overview
MPosControllerDevices class is an object that provides the most basic functions related to the target control device.
2 Instance Methods
This method configures the interface connected to mPOS Thermal Printer.
[Syntax]
-(__MPOS_RESULTS_) selectInterface:(__MPOS_INTERACE_TYPE_)interfaceType
address:(NSString*)address;
[Return Value]
_MPOS_SUCCESS returns if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Discussion]
[Example]
MPosControllerDevices _devices = [MPosControllerDevices new]; if(_MPOS_SUCCESS == [_devices selectInterface:_MPOS_INTERFACE_BLUETOOTH address:@”74:F0:7D:12:34:56”]) { // Success } else { // Fail } // ……. Continue to other processes [_devices release]; |
mPOS that are assigned to the current class returns the deviceID of the device.
[Syntax]
-(NSInteger) getCurrentDeviceID;
[Return Value]
(NSInteger) Device ID of the current device
[Discussion]
[Example]
MPosControllerDevices _devices = [MPosControllerDevices new]; NSInteger myID = [_devices getCurrentDeviceID]; NSLog(@”myID : %d”, myID); [_devices release]; |
This method initializes communication if a device corresponding to this class is connected to the mPOS Thermal Printer.
[Syntax]
-(__MPOS_RESULTS_) openService;
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerDevices _devices = [MPosControllerDevices new]; if(_MPOS_SUCCESS == [_devices openService]) { // Success } else { // Fail } // ……. Continue to other processes [_devices release]; |
4) OpenService:(NSInteger)DeviceID
This method initializes communication if there is a device with the given DeviceID in the list of devices connected to the mPOS Thermal Printer.
[Syntax]
-(__MPOS_RESULTS_) openService:(NSInteger)DeviceID
[Discussion]
Failure code will be returned if the given DeviceID is not associated with this class or if it is not connected.
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
This method terminates the use of the corresponding device.
[Syntax]
-(__MPOS_RESULTS_) closeService;
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerDevices _devices = [MPosControllerDevices new]; if(_MPOS_SUCCESS == [_devices closeService]) { // Success } else { // Fail } [_devices release]; |
This method checks whether a device is connected using this class.
[Syntax]
-(BOOL) isOpen;
[Return Value]
If a device is connected: YES
[Example]
MPosControllerDevices _devices = [MPosControllerDevices new]; if( YES == [_devices isOpen]) { // If device is open } else { // If device is closed. } [_devices release]; |
This method sends or reads user-defined data.
[Syntax]
-(__MPOS_RESULTS_) directIO:(NSData*) data;
[Parameters]
data
It contains the ANSI CODE data to send to printer.
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerDevices _devices = [MPosControllerDevices new]; if( MPOS_SUCCESS == [_devices directIO: [NSData dataWithBytes:"\n\n\n" length:3]]) { // Success. } else { // Fail. } [_devices release]; |
8) selectForceConvertHIDInputDeviceTo:
Assigns a device which is recognized as HID Input device to a certain device by force, and then make it work.
[Syntax]
-(__MPOS_RESULTS_) selectForceConvertHIDInputDeviceTo:(__MPOS_DEVICE_TYPE_)deviceType;
[Return Value]
MPOS_SUCCESS returns if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Discussion]
If any of the devices connected to mPOS is identified as Open through isOpen Method, it may not operate.
[Example]
MPosControllerDevices _devices = [MPosControllerDevices new]; if(_MPOS_SUCCESS == [_devices selectForceConvertHIDInputDeviceTo:_MPOS_DEVICE_SCANNER ]; { // Success } else { // Fail } // ……. Do other process you want. [_devices release]; |
• Selects a device which is connected with mPOS or a device which is directly connected with iDevice for data communications.
[Syntax]
-(__MPOS_RESULTS_) selectCommandMode:(__MPOS_COMMAND_MODE_)commandMode;
[Return Value]
MPOS_SUCCESS returns if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Discussion]
This method may fail if any of the devices in the list that are connected to mPOS is open when checked with the isOpen method.
[Example]
MPosControllerDevices _devices = [MPosControllerDevices new]; if(_MPOS_SUCCESS == [_devices selectCommandMode:_MPOS_COMMAND_MODE_BYPASS ]; { // Success } else { // Fail } // ……. Do other process you want. [_devices release]; |
Configures the timeout value (unit: seconds) when the openService function is running.
The default value of the timeout will be applied if this function is not used. This function must be used before calling the openService function.
[Syntax]
long setTimeout(int timeout);
[Parameters]
int timeout: Use only values larger than 0 (default value: 3 seconds)
[Return Value]
MPOS_SUCCESS returns if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
mPOS Controller Printer
Inherits from |
MPosControllerDevices |
Framework |
MPosSDK.a |
Declared |
MPosControllerPrinter .h |
1 Overview
MPosControllerPrinter class is an object that provides various functions of the printer among the devices connected to the mPOS Thermal Printer.
2 Notification
This is for the registration of Notification about the data that can be obtained from the device corresponding to this class.
[Notification Name]
_MPOS_NOTIFICATION_NAME_PRINTER_DATA_IN
[Example]
// Registration [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceivePrinterData:) name:_MPOS_NOTIFICATION_NAME_PRINTER_DATA_IN object:nil]; } // Removal of registration [[NSNotificationCenter defaultCenter] removeObserver:self name:_MPOS_NOTIFICATION_NAME_PRINTER_DATA_IN object:nil]; |
2) Notification Key - _MPOS_NOTIFICATION_KEY_PRINTER_MODELNAME
To read the corresponding data if there is a Printer Model Name in the notified data. It occurs when calling.
[Example]
-(void) didReceivePrinterData:(NSNotification *)notification { if([_printer isEqual:[[notification userInfo] objectForKey:_MPOS_NOTIFICATION_KEY_OBJECT]]) { NSString * strPrinterName = [[notification userInfo] objectForKey:_MPOS_NOTIFICATION_KEY_PRINTER_MODELNAME]; } // … } else { [self updateResultHistory:@"***** [Other Data Received] "]; } } |
3) Notification Key - _MPOS_NOTIFICATION_KEY_PRINTER_FWVersion
It is for reading the corresponding data if there is a Printer Fw Version in the notified data.
It occurs when calling.
[Example]
-(void) didReceivePrinterData:(NSNotification *)notification { if([_printer isEqual:[[notification userInfo] objectForKey:_MPOS_NOTIFICATION_KEY_OBJECT]]) { NSString * strPrinterName = [[notification userInfo] objectForKey:_MPOS_NOTIFICATION_KEY_PRINTER_FwVersion]; } // … } else { [self updateResultHistory:@"***** [Other Data Received..] "]; } } |
3 Instance Methods
This method initializes communication if a device corresponding to this class is connected to the mPOS Thermal Printer Thermal Printer.
[Syntax]
-(__MPOS_RESULTS_) openService;
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerPrinter* _printer = [MPosControllerPrinter new]; if(_MPOS_SUCCESS == [_printer openService]) { // Success if([_printer isOpen]) { // Notification setting [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceivePrinterData:) name:_MPOS_NOTIFICATION_NAME_PRINTER_DATA_IN object:nil]; } } else { // Fail } // ……. Continue to other processes [_printer release]; |
This method closes the device corresponding to this class.
[Syntax]
-(__MPOS_RESULTS_) closeService;
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerPrinter* _printer = [MPosControllerPrinter new]; if(_MPOS_SUCCESS == [_printer closeService]) { // Success [[NSNotificationCenter defaultCenter] removeObserver:self name:_MPOS_NOTIFICATION_NAME_PRINTER_DATA_IN object:nil]; } else { // Fail } [_printer release]; |
This method prints text.
[Syntax]
-(__MPOS_RESULTS_) printText:(NSString *)string
[Parameters]
string
Target text string, unicode data with null as terminator Character string attributes that can be configured in FontAttribute can be substituted by ESC Sequence. Please refer to [ESC Sequence] for details on
ESC Sequence.
* ESC Sequences
These are commands that begin with the characters ESC(0x1B) + ‘|’(0x7C).
Out of the commands below, “#” represents a decimal number value, and a range value exists for each command. “[]” indicates commands that can be omitted. If a number value is omitted, it will become “0”. “!” is a command that cancels the relevant configuration.
An ESC Sequence command that is unsupported by the printer will be ignored.
Escape Sequence |
Supported or unsupported, and configuration value range |
Description |
[#]P |
O (# : 0~100) |
Cutting |
[#]fP |
O (# : 0~100) |
Cutting after feed |
[#]lF |
O (# : 0~50) |
Line feeding as much as # number |
#fT |
O (# : 0~3) |
Configures font types according to # value 0: Default font (A), 1 = Font B, 2 = Font C |
[!]bC |
O |
Bold |
[!][#]uC |
O (# : 1~2) |
Underline |
[!]rvC |
O |
Reverse |
1C |
O |
Font size 1 times width, 1 times height |
2C |
O |
Font size 2 times width, 1 times height |
3C |
O |
Font size 1 times width, 2 times height |
4C |
O |
Font size 2 times width, 2 times height |
#hC |
O |
# times font width proportion |
#vC |
O |
# times font height proportion |
cA |
O |
Align center |
rA |
O |
Align right |
lA |
O |
Align left |
N |
O |
Initialize value that is configurable as ESC Sequence Font type A, font size 1 times width, 1 times height Cancel bold, cancel underline, cancel reverse |
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Discussion]
It does nothing if there is no printer connected to the mPOS Thermal Printer.
[Example]
MPosControllerPrinter* _printer = [MPosControllerPrinter new]; if(_MPOS_SUCCESS == [_printer [pController printText:@”This is printText\r\n”]) { // Success } else { // Fail } [_printer release]; |
This method prints image file.
[Syntax]
-(__MPOS_RESULTS_) printBitmapWithPath:(NSString *)path
width:(long)width
level:(long)level
[Parameters]
path
Path of image file
width
Width of image file to convert and print, with the range of 0 ~ maximum width.
If the value is smaller than 0, image will be converted with the following conditions.
level
Image color level and diffusion option.
Value |
Description |
0 ~ 100 |
Color level value |
If fourth digit is 1 |
Enable diffusion processing |
If fifth digit is 1 |
Print image using ESC * command |
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerPrinter* _printer = [MPosControllerPrinter new]; NSString *path = [[NSBundle mainBundle] pathForResource:@"Sample" ofType:@"png"]; if(_MPOS_SUCCESS == [_printer printBitmapWithPath:path width:512 level:1050]) { // Success } else { // Fail } [_printer release]; |
This method prints 1D and 2D barcode.
[Syntax]
- (__MPOS_RESULTS_) printBarcode : (NSString*) data
symbology : (NSInteger) symbology
height : (NSInteger) height
width : (NSInteger) width
alignment : (NSInteger) alignment
textPostion : (NSInteger) textPosition;
[Parameters]
data
ANSI code data with null terminator.
symbology
Barcode type
Refer to 6-4-3-11 Appendix - 1 Defines - 4) Barcode Symbology
height
Height of barcode in Dot unit with the range of 1~255
It has no effect in 2D barcode.
width
Width of barcode with 2~7 steps in width
If barcode print area exceeds the size of paper, printing may stop or only part of the barcode is printed.
This setting has no effect to 2D barcode.
alignment
Barcode alignment setting
Refer to 6-4-3-11 Appendix - 1 Defines - 2) Barcode/Image/Text Alignmen
textPosition
Barcode text position setting
[Example]
if(_MPOS_SUCCESS == [_printer printBarcode:“123456789012” symbology: _MPOS_BARCODE_Code128 width: 100 height:200]; { // Success } else { // Fail } [_printer release]; |
This method checks the printer status.
[Syntax]
-(__MPOS_RESULTS_) checkPrinterStatus:(blockType3)statusReceiver;
[Parameters]
statusReceiver
This method checks the printer status.
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
This method checks the printer status automatically.
[Syntax]
-(__MPOS_RESULTS_) asbEnable:(BOOL) bEnable;
[Parameters]
bEnable
This method enables the printer status data.
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
mPOS Controller MSR
Inherits from |
MPosControllerMSR |
Framework |
MPosSDK.a |
Declared |
MPosControllerMSR.h |
1 Overview
MPosControllerMSR Class is an object that provides various functions of the MSR among the devices connected to the mPOS Thermal Printer.
2 Notification
This is for the registration of Notification for the data that can be obtained from the device corresponding to this class.
[Notification Name]
_MPOS_NOTIFICATION_NAME_MSR_DATA_IN
[Example]
// Registration [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveMSRData:) name:_MPOS_NOTIFICATION_NAME_MSR_DATA_IN object:nil]; // Removal of registration [[NSNotificationCenter defaultCenter] removeObserver:self name:_MPOS_NOTIFICATION_NAME_MSR_DATA_IN object:nil]; |
2) Notification Key - MPOS_NOTIFICATION_KEY_MSR_TrackAll
It is for reading the corresponding data if there is MSR Track Data in the notified data.
[Example]
-(void) didReceiveMSRData:(NSNotification *)notification { if([_msr isEqual:[[notification userInfo] objectForKey:_MPOS_NOTIFICATION_KEY_OBJECT]]) { NSString * strMSRTrackData = [[notification userInfo] objectForKey:_MPOS_NOTIFICATION_KEY_MSR_TrackAll]; } // … } else { [self updateResultHistory:@"***** [Other Data Received] "]; } } |
3 Instance Methods
This method initializes communication if a device corresponding to this class is connected to the mPOS Thermal Printer.
[Syntax]
-(__MPOS_RESULTS_) openService;
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerMSR* _msr = [MPosControllerMSR new]; if(_MPOS_SUCCESS == [_msr openService]) { // Success if([_msr isOpen]) { // Notification setting [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveMSRData:) name:_MPOS_NOTIFICATION_NAME_MSR_DATA_IN object:nil]; } } else { // Fail } // ……. Continue to other processes [_msr release]; |
This method closes the device corresponding to this class.
[Syntax]
-(__MPOS_RESULTS_) closeService;
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerMSR* _msr = [MPosControllerMSR new]; if(_MPOS_SUCCESS == [_msr closeService]) { // Success [[NSNotificationCenter defaultCenter] removeObserver:self name:_MPOS_NOTIFICATION_NAME_MSR_DATA_IN object:nil]; } else { // Fail } [_msr release]; |
mPOS Controller Scanner
Inherits from |
MPosControllerDevices |
Framework |
MPosSDK.a |
Declared |
MPosControllerScanner.h |
1 Overview
MPosControllerScanner Class is an object that provides various functions about Scanner among the devices connected to the mPOS Thermal Printer.
2 Notification
This is for the registration of Notification about the data that can be obtained from the device corresponding to this class.
[Notification Name]
_MPOS_NOTIFICATION_NAME_SCANNER_DATA_IN
[Example]
// Registration [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveScannerData:) name:_MPOS_NOTIFICATION_NAME_SCANNER_DATA_IN object:nil]; // Removal of registration [[NSNotificationCenter defaultCenter] removeObserver:self name:_MPOS_NOTIFICATION_NAME_SCANNER_DATA_IN object:nil]; |
2) Notification Key - MPOS_NOTIFICATION_KEY_SCANNER_BAR_DATA
It is for reading the corresponding data if there is a Barcode in the notified Scanner Data.
[Example]
-(void) didReceiveScannerData:(NSNotification *)notification { if([_msr isEqual:[[notification userInfo] objectForKey:_MPOS_NOTIFICATION_KEY_OBJECT]]) { NSString * strMSRTrackData = [[notification userInfo] objectForKey:_MPOS_NOTIFICATION_KEY_SCANNER_BAR_DATA]; } // … } else { [self updateResultHistory:@"***** [Other Data Received] "]; } } |
3) Notification Key - MPOS_NOTIFICATION_KEY_SCANNER_BAR_TYPE
It is for reading Barcode Type if there is a Barcode in the notified Scanner Data.
[Example]
-(void) didReceiveScannerData:(NSNotification *)notification { if([_scanner isEqual:[[notification userInfo] objectForKey:_MPOS_NOTIFICATION_KEY_OBJECT]]) { NSNumber * BarType = [[notification userInfo] objectForKey:_MPOS_NOTIFICATION_KEY_SCANNER_BAR_TYPE]; } // … } else { [self updateResultHistory:@"***** [Other Data Received] "]; } } |
3 Instance Methods
This method initializes communication if a device corresponding to this class is connected to the mPOS Thermal Printer.
[Syntax]
-(__MPOS_RESULTS_) openService;
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerScanner* _scanner = [MPosControllerScanner new]; if(_MPOS_SUCCESS == [_scanner openService]) { // Success // Registration [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveScannerData:) name:_MPOS_NOTIFICATION_NAME_SCANNER_DATA_IN object:nil]; } else { // Fail } // ……. Continue to other processes [_scanner release]; |
This method terminates the use of the corresponding device.
[Syntax]
-(__MPOS_RESULTS_) closeService;
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerScanner* _scanner = [MPosControllerScanner new]; if(_MPOS_SUCCESS == [_scanner closeService]) { // Success [[NSNotificationCenter defaultCenter] removeObserver:self name:_MPOS_NOTIFICATION_NAME_SCANNER_DATA_IN object:nil]; } else { // Fail } [_scanner release]; |
mPOS Controller BCD
Inherits from |
MPosControllerDevices |
Framework |
MPosSDK.a |
Declared |
MPosControllerBCD.h |
1 Overview
MPosControllerBCD Class is an object that provides the functions of the BCD among the devices connected to the mPOS Thermal Printer.
2 Instance Methods
This method initializes communication if a device corresponding to this class is connected to the mPOS Thermal Printer.
[Syntax]
-(__MPOS_RESULTS_) openService;
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerBCD* _bcd = [MPosControllerBCD new]; if(_MPOS_SUCCESS == [_bcd openService]) { // Success } else { // Fail } // ……. Continue to other processes [_bcd release]; |
This method closes the device corresponding to this class.
[Syntax]
-(__MPOS_RESULTS_) closeService;
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerBCD* _bcd = [MPosControllerBCD new]; if(_MPOS_SUCCESS == [_bcd closeService]) { // Success } else { // Fail } [_bcd release]; |
3) writeStringToUpperLine:(NSString*) string
This method is for displaying the given string on the upper side of the screen of BCD device.
[Syntax]
-(__MPOS_RESULTS_) writeStringToUpperLine:(NSString*)string;
[Parameters]
string
Character strings to be displayed on the device
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerBCD* _bcd = [MPosControllerBCD new]; __MPOS_RESULTS_ result = [_bcd writeStringToUpperLine:@"*** UpperLine Test!!"]; if(_MPOS_SUCCESS == result ) { // Success } else { // Fail } [_bcd release]; |
4) writeStringToLowerLine:(NSString*) string
This method is for displaying the given string on the lower side of the screen of BCD device.
[Syntax]
-(__MPOS_RESULTS_) writeStringToLowerLine:(NSString*)string;
[Parameters]
string
Character strings to be displayed on the device
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerBCD* _bcd = [MPosControllerBCD new]; __MPOS_RESULTS_ result = [_bcd writeStringToLowerLine:@"*** Lower Line Test!!"]; if(_MPOS_SUCCESS == result ) { // Success } else { // Fail } [_bcd release]; |
This method removes all the contents from the screen of BCD device.
[Syntax]
-(__MPOS_RESULTS_) clearScreen;
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerBCD* _bcd = [MPosControllerBCD new]; __MPOS_RESULTS_ result = [_bcd clearScreen];
if(_MPOS_SUCCESS == result ) { // Success } else { // Fail } [_bcd release]; |
This method displays strings on the BCD device.
[Syntax]
-(__MPOS_RESULTS_) displayString:(NSString*)string;
[Parameters]
string
Character strings to be displayed on the device
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerBCD* _bcd = [MPosControllerBCD new]; __MPOS_RESULTS_ result = [_bcd displayString:@"*** displayString!!"];
if(_MPOS_SUCCESS == result ) { // Success } else { // Fail } [_bcd release]; |
This method stores images on the BCD device.
[Syntax]
-(__MPOS_RESULTS_) storeImage:(UIImage*)image
width:(NSInteger) width
imageNumber:(NSInteger)imageNumber;
[Parameters]
image
Image to be stored on the device
width
Image width
imageNumber
Address of the device where the image is stored
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerBCD* _bcd = [MPosControllerBCD new]; NSString *path = [[NSBundle mainBundle] pathForResource:@"Sample" ofType:@"png"]; UIImage* image = [UIImage imageWithContentsOfFile:path]; __MPOS_RESULTS_ result = [_bcd storeImage:image width:160 imageNumber:1];
if(_MPOS_SUCCESS == result ) { // Success } else { // Fail } [_bcd release]; |
This method displays images on the BCD device screen.
[Syntax]
-(__MPOS_RESULTS_) displayImage:(NSInteger)imageNumber;
xPos:(NSInteger)xPos
yPos:(NSInteger)yPos
[Parameters]
imageNumber
Address of the image stored on the device (1~5)
xPos
X coordinates of the display position
yPos
Y coordinates of the display position
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerBCD* _bcd = [MPosControllerBCD new]; __MPOS_RESULTS_ result = [_bcd displayImage:1 xPos:0 yPos:0];
if(_MPOS_SUCCESS == result ) { // Success } else { // Fail } [_bcd release]; |
This method clears images stored on the BCD device.
[Syntax]
-(__MPOS_RESULTS_) clearImage:(BOOL)isAll
imageNumber:(NSInteger)imageNumber
[Parameters]
isAll
Whether to clear all the stored images
(YES: clear all NO: clear only the images designated by imageNumber)
imageNumber
If isAll is NO, the images stored on imageNumber are cleared.
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerBCD* _bcd = [MPosControllerBCD new]; __MPOS_RESULTS_ result = [_bcd clearImage:NO imageNumber:1];
if(_MPOS_SUCCESS == result ) { // Success } else { // Fail } [_bcd release]; |
mPOS Controller TTYUSB
Inherits from |
MPosControllerDevices |
Framework |
MPosSDK.a |
Declared |
MPosControllerTTYUSB.h |
1 Overview
MPosControllerTTYUSB Class is an object that provides various functions of the undefined USB device among the devices connected to the mPOS Thermal Printer.
2 Notification
This is for the registration of Notification about the data that can be obtained from the device corresponding to this class.
[Notification Name]
_MPOS_NOTIFICATION_NAME_TTYUSB_DATA_IN
[Example]
// Registration [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveMSRData:) name:_MPOS_NOTIFICATION_NAME_TTYUSB_DATA_IN object:nil]; // Removal of registration [[NSNotificationCenter defaultCenter] removeObserver:self name:_MPOS_NOTIFICATION_NAME_TTYUSB_DATA_IN object:nil]; |
2) Notification Key - _MPOS_NOTIFICATION_KEY_TTYUSB_DATA_IN
It is for reading the corresponding data if the notified data includes the data generated from TTYUSB device.
[Example]
-(void) didReceiveTTYUSBData:(NSNotification *)notification { if([_msr isEqual:[[notification userInfo] objectForKey:_MPOS_NOTIFICATION_KEY_OBJECT]]) { NSData * data = [[notification userInfo] objectForKey:_MPOS_NOTIFICATION_KEY_TTYUSB_DATA_IN]; } // … } else { [self updateResultHistory:@"***** [Other Data Received] "]; } } |
3 Instance Methods
This method initializes communication if a device corresponding to this class is connected to the mPOS Thermal Printer.
[Syntax]
-(__MPOS_RESULTS_) openService;
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerTTYUSB* _ttyUSB = [MPosControllerTTYUSB new]; if(_MPOS_SUCCESS == [_ttyUSB openService]) { // Success if([_ttyUSB isOpen]) { // Notification setting [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveTTYUSBData:) name:_MPOS_NOTIFICATION_NAME_TTYUSB_DATA_IN object:nil]; } } else { // Fail } // ……. Continue to other processes [_ttyUSB release]; |
This method terminates the use of the corresponding device.
[Syntax]
-(__MPOS_RESULTS_) closeService;
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerTTYUSB* _ttyUSB = [MPosControllerTTYUSB new]; if(_MPOS_SUCCESS == [_ttyUSB closeService]) { // Success [[NSNotificationCenter defaultCenter] removeObserver:self name:_MPOS_NOTIFICATION_NAME_TTYUSB_DATA_IN object:nil]; } else { // Fail } [_ttyUSB release]; |
BGATE Lookup
Inherits from |
NSObject |
Framework |
MPosSDK.a |
Declared |
BGATELookup.h |
1 Overview
BGATELookup Class is an object that searches mPOS Thermal Printers available for connection.
This is for the registration of Notification about the data that can be obtained from the device corresponding to this class.
[Notification Name]
_MPOS_NOTIFICATION_NAME_LOOKUP_WIFIDEVICE_END
_MPOS_NOTIFICATION_NAME_LOOKUP_ETHERNETDEVICE_END
_MPOS_NOTIFICATION_NAME_LOOKUP_BTDEVICE
[Example]
// Registration [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didWifiDeviceList:) name:_MPOS_NOTIFICATION_NAME_LOOKUP_WIFIDEVICE_END object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didBluetoothDeviceList:) name:_MPOS_NOTIFICATION_NAME_LOOKUP_BTDEVICE object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didEthernetDeviceList:) name:_MPOS_NOTIFICATION_NAME_LOOKUP_ETHERNETDEVICE_END object:nil]; // Removal of registration [[NSNotificationCenter defaultCenter] removeObserver:self name_MPOS_NOTIFICATION_NAME_LOOKUP_WIFIDEVICE_END object:nil]; [[NSNotificationCenter defaultCenter] removeObserver:self name: _MPOS_NOTIFICATION_NAME_LOOKUP_BTDEVICE object:nil]; [[NSNotificationCenter defaultCenter] removeObserver:self name: _MPOS_NOTIFICATION_NAME_LOOKUP_ETHERNETDEVICE_END object:nil]; |
3 Instance Methods
1) initWithTimeout: timeout :retry
This method is to initialize the BGATELookup object.
[Syntax]
-(id) initWithTimeout:(float)timeout withRetryCount:(float)retry;
[Return Value]
BGATELookup object
[Example]
BGATELookup* _lookupDevice; _lookupDevice = [[BGATELookup alloc] initWithTimeout:2.0 withRetryCount:3]; if(lookupDevice != nil) { // success } else { // Fail } [_lookupDevice release]; |
This method searches mPOS Thermal Printers on the Wi-Fi network.
[Syntax]
-(__MPOS_RESULTS_) refreshWifiDevicesList;
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
BGATELookup* _lookupDevice; _lookupDevice = [[BGATELookup alloc] initWithTimeout:2.0 withRetryCount:3]; __MPOS_RESULTS_ result = [_lookupDevice refreshWifiDevicesList];
if(_MPOS_SUCCESS == result ) { // Success } else { // Fail } [_lookupDevice release]; |
3) refreshEthernetDevicesList;
This method searches mPOS Thermal Printers connected via Ethernet.
[Syntax]
-(__MPOS_RESULTS_) refreshEthernetDevicesList;
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
BGATELookup* _lookupDevice; _lookupDevice = [[BGATELookup alloc] initWithTimeout:2.0 withRetryCount:3]; __MPOS_RESULTS_ result = [_lookupDevice refreshEthernetDevicesList];
if(_MPOS_SUCCESS == result ) { // Success } else { // Fail } [_lookupDevice release]; |
4) refreshBluetoothDevicesList;
This method searches mPOS Thermal Printers paired to the iDevice.
[Syntax]
-(__MPOS_RESULTS_) refreshBluetoothDevicesList;
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
BGATELookup* _lookupDevice; _lookupDevice = [[BGATELookup alloc] initWithTimeout:2.0 withRetryCount:3]; __MPOS_RESULTS_ result = [_lookupDevice refreshBluetoothDevicesList];
if(_MPOS_SUCCESS == result ) { // Success } else { // Fail } [_lookupDevice release]; |
This method returns a list of mPOS Thermal Printers searched using refreshWifiDevicesList API.
[Syntax]
-(NSArray*) getWifiDeviceList;
[Return Value]
NSArray*:
The list of devices is stored as an NSArray.
[Example]
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didWifiDeviceList:) name:_MPOS_NOTIFICATION_NAME_LOOKUP_WIFIDEVICE_END object:nil]; - (void) didWifiDeviceList:(NSNotification*)notification { BGATELookup* _lookupDevice; _lookupDevice = [[BGATELookup alloc] initWithTimeout:2.0 withRetryCount:3]; NSArray* arr = [[NSArray alloc]initWithArray:[_lookupDevice getWifiDevicesList]]; If(arr != nil) // Success else // Fail [_lookupDevice release]; } |
This method returns a list of mPOS Thermal Printers searched using refresh Ethernet DevicesList API.
[Syntax]
-(NSArray*) getEthernetDeviceList;
[Return Value]
NSArray*:
The list of devices is stored as an NSArray.
[Example]
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didEthernetDeviceList:) name:_MPOS_NOTIFICATION_NAME_LOOKUP_ETHERNETDEVICE_END object:nil]; - (void) didEthernetDeviceList:(NSNotification*)notification { BGATELookup* _lookupDevice; _lookupDevice = [[BGATELookup alloc] initWithTimeout:2.0 withRetryCount:3]; NSArray* arr = [[NSArray alloc]initWithArray:[_lookupDevice getEthernetDevicesList]]; If(arr != nil) // Success else // Fail [_lookupDevice release]; } |
This method returns a list of mPOS Thermal Printers searched using refreshBluetoothDevicesLis API.
[Syntax]
-(NSArray*) getBluetoothDeviceList;
[Return Value]
NSArray*:
The list of devices is stored as an NSArray.
[Example]
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didBluetoothDeviceList:) name:_MPOS_NOTIFICATION_NAME_LOOKUP_BTDEVICE_END object:nil]; - (void) didBluetoothDeviceList:(NSNotification*)notification { BGATELookup* _lookupDevice; _lookupDevice = [[BGATELookup alloc] initWithTimeout:2.0 withRetryCount:3]; NSArray* arr = [[NSArray alloc]initWithArray:[_lookupDevice getBluetoothDevicesList]]; If(arr != nil) // Success else // Fail [_lookupDevice release]; } |
mPOS Controller Config
Inherits from |
MPosControllerConfig |
Framework |
MPosSDK.a |
Declared |
MPosControllerConfig.h |
1 Overview
MPosControllerConfig Class is an object that provides mPOS settings.
2 Notification
This is for the registration of Notification about the data that can be obtained from the device corresponding to this class.
[Notification Name]
_MPOS_NOTIFICATION_CUSTOMDEVICE_DATA_IN
[Example]
// Registration [ [NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveData:) name:_MPOS_NOTIFICATION_CUSTOMDEVICE_DATA_IN object:nil ]; // Removal of registration [[NSNotificationCenter defaultCenter] removeObserver:self name:_MPOS_NOTIFICATION_CUSTOMDEVICE_DATA_IN object:nil]; |
2) Notification Key -_MPOS_NOTIFICATION_KEY_CUSTOMDEVICE_DATA
It is for reading the corresponding data if there is CustomDevice Data in the notified data.
[Example]
-(void) didReceiveData:(NSNotification *)notification { if([_config isEqual:[[notification userInfo] objectForKey: _MPOS_NOTIFICATION_KEY_CUSTOMDEVICE_DATA]]) { } } |
3) Notification Key - MPOS_NOTIFICATION_KEY_CUSTOMDEVICE_USBID
To read the corresponding data if there is USBID Data in the notified data.
[Example]
-(void) didReceiveData:(NSNotification *)notification { if([_config isEqual:[[notification userInfo] objectForKey _MPOS_NOTIFICATION_KEY_CUSTOMDEVICE_USBID]]) { } } |
4) Notification Key - MPOS_NOTIFICATION_KEY_CUSTOMDEVICE_FIND
To read the corresponding data if there is Find Dev Data in the notified data.
[Example]
-(void) didReceiveData:(NSNotification *)notification { if([_config isEqual:[[notification userInfo] objectForKey _MPOS_NOTIFICATION_KEY_CUSTOMDEVICE_FIND]]) { } } |
5) Notification Key - _MPOS_NOTIFICATION_KEY_CUSTOMDEVICE_ADD_RESULT
To read the corresponding data if there is add Device info in the notified data.
[Example]
-(void) didReceiveData:(NSNotification *)notification { if([_config isEqual:[[notification userInfo] objectForKey_MPOS_NOTIFICATION_KEY_CUSTOMDEVICE_ADD_RESULT]]) { } } |
6) Notification Key - _MPOS_NOTIFICATION_KEY_CUSTOMDEVICE_DEL_RESULT
To read the corresponding data if there is delete Device info in the notified data.
[Example]
-(void) didReceiveData:(NSNotification *)notification { if([_config isEqual:[[notification userInfo] objectForKey_MPOS_NOTIFICATION_KEY_CUSTOMDEVICE_DEL_RESULT]]) { } } |
7) Notification Key - _MPOS_NOTIFICATION_KEY_CUSTOMDEVICE_REINIT_RESULT
To read the corresponding data if there is reinit info in the notified data.
[Example]
-(void) didReceiveData:(NSNotification *)notification { if([_config isEqual:[[notification userInfo] objectForKey_MPOS_NOTIFICATION_KEY_CUSTOMDEVICE_REINIT_RESULT]]) { } } |
3 Instance Methods
This method gets Custom Device List in NSArray data type.
[Syntax]
-(__MPOS_RESULTS_)getCustomDeviceList:(NSArray**)customDeviceArray
deviceType:(__MPOS_DEVICE_TYPE_)deviceType;
[Parameters]
customDeviceArray
Set the array to save Custom Device list.
deviceType
Set the Custom Device Type
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerConfig * _config; _config = [[MPosControllerConfig alloc] init ]; __MPOS_RESULTS_ result = [_config getCustomDeviceList:&arr deviceType:MPOS_DEVICE_NFC];
if(_MPOS_SUCCESS == result ) { // Success } else { // Fail } [_config release]; |
2) addCustomDevice
This method registers Custom Device.
[Syntax]
-(__MPOS_RESULTS_)addCustomDevice:(NSDictionary*)deviceInfo
deviceType:(__MPOS_DEVICE_TYPE_)deviceType;
[Parameters]
deviceInfo
Set the Device Info(pID1, pID2, vID1, vID2).
deviceType
Set the Custom Device Type.
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerConfig * _config; _config = [[MPosControllerConfig alloc] init ]; -(void) didReceiveData:(NSNotification *)notification { if([_config isEqual:[[notification userInfo] objectForKey:_MPOS_NOTIFICATION_KEY_CUSTOMDEVICE_DATA]]) { NSMutableArray* dicFindDevList; dicFindDevList = [[NSMutableArray alloc]init]; [dicFindDevList addObject:(NSDictionary*)[notification userInfo]]; __MPOS_RESULTS_ result = [_config addCustomDevice:[dicFindDevList objectAtIndex:0] deviceType:curDevType]; if(_MPOS_SUCCESS == result ){ // Success } else{ // Fail } [_config release]; } } |
This method deletes Custom Device.
[Syntax]
-(__MPOS_RESULTS_) deleteCustomDevice:(NSDictionary*)deviceInfo
deviceType:(__MPOS_DEVICE_TYPE_)deviceType;
[Parameters]
deviceInfo
Set the Device Info(pID1, pID2, vID1, vID2).
deviceType
Set the Custom Device Type.
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerConfig * _config; _config = [[MPosControllerConfig alloc] init ]; -(void) didReceiveData:(NSNotification *)notification { if([_config isEqual:[[notification userInfo] objectForKey: _MPOS_NOTIFICATION_KEY_CUSTOMDEVICE_DATA]]) { NSMutableArray* dicList; dicList = [[NSMutableArray alloc]init]; [dicList addObject:(NSDictionary*)[notification userInfo]]; __MPOS_RESULTS_ result = [_config deleteCustomDevice:[dicList objectAtIndex:0] deviceType:curDevType]; if(_MPOS_SUCCESS == result ){ // Success } else{ // Fail } [_config release]; } } |
This method reinitializes the Custom Device.
[Syntax]
-(__MPOS_RESULTS_)reInitCustomDeviceType:(NSInteger)deviceType;
[Parameters]
deviceType
Set the Custom Device Type.
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerConfig * _config; _config = [[MPosControllerConfig alloc] init ]; __MPOS_RESULTS_ result = [_config reInitCustomDeviceType:MPOS_DEVICE_NFC]; if(_MPOS_SUCCESS == result ) { // Success } else { // Fail } [_config release]; |
This method gets Usb ID List in NSArray data type.
[Syntax]
-(__MPOS_RESULTS_) listUsbID;
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerConfig * _config; _config = [[MPosControllerConfig alloc] init ]; __MPOS_RESULTS_ result = [_config listUsbID]; if(_MPOS_SUCCESS == result ) { // Success } else { // Fail } -(void) didReceiveData:(NSNotification *)notification { if([_config isEqual:[[notification userInfo] objectForKey:_MPOS_NOTIFICATION_KEY_CUSTOMDEVICE_USBID]]]) { NSMutableArray* dicUsbIDList; dicUsbIDList = [[NSMutableArray alloc]init]; [dicUsbIDList addObject:(NSDictionary*)[notification userInfo]]; } [_config release]; } |
This method gets findDevID in NSArray data type.
[Syntax]
-(__MPOS_RESULTS_)findDevID:(NSInteger)devID;
[Parameters]
devID
Set the Custom Device Type.
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerConfig * _config; _config = [[MPosControllerConfig alloc] init ]; __MPOS_RESULTS_ result = [_config findDevID:MPOS_DEVICE_NFC]; if(_MPOS_SUCCESS == result ){ // Success } else{ // Fail } -(void) didReceiveData:(NSNotification *)notification { if([_config isEqual:[[notification userInfo] objectForKey: _MPOS_NOTIFICATION_KEY_CUSTOMDEVICE_FIND]]]) { NSMutableArray* findDevList; findDevList = [[NSMutableArray alloc]init]; [findDevList addObject:(NSDictionary*)[notification userInfo]]; } [_config release]; } |
This method gets Serial Configuration.
[Syntax]
-(__MPOS_RESULTS_) getSerialConfiguration:(__MPOSSerialConfiguration*)serialConfiguration
targetDeviceID:(NSInteger)targetDeviceID
timeout:(NSTimeInterval)timeout;
[Parameters]
serialConfiguration
Set the object to save serialConfiguration.
targetDeviceID
Set the Device ID.
timeout
Set the timeout period. (Unit: second(s))
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerConfig * _config; _config = [[MPosControllerConfig alloc] init ]; MPOSSerialConfiguration serialConfiguration; __MPOS_RESULTS_ result = [_config getSerialConfiguration:&serialConfiguration targetDeviceID:121 timeout:10.0]; if(_MPOS_SUCCESS == result ){ // Success } else{ // Fail } [_config release]; |
This method sets Serial Configuration.
[Syntax]
-(__MPOS_RESULTS_) setSerialConfiguration:(__MPOSSerialConfiguration)serialConfiguration
targetDeviceID:(NSInteger)targetDeviceID
timeout:(NSTimeInterval)timeout;
[Parameters]
serialConfiguration
Set the object to save serialConfiguration.
targetDeviceID
Set the Device ID.
timeout
Set the timeout period. (Unit, second(s))
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
MPosControllerConfig * _config; _config = [[MPosControllerConfig alloc] init ]; MPOSSerialConfiguration setting; setting.baudrate = _MPOS_BAUDRATE_115200; setting.dataBit = _MPOS_DATABIT_8; setting.stopBit = _MPOS_STOPBIT_1; setting.parityBit = _MPOS_PARITY_NONE; [_config setSerialConfiguration:toSetting targetDeviceID:121 timeout:10.0]; if(_MPOS_SUCCESS == result ){ // Success } else{ // Fail } [_config release]; |
mPOS Controller Label Printer
Inherits from |
MPosControllerLabelPrinter |
Framework |
MPosSDK.a |
Declared |
MPosControllerLabelPrinter.h |
1 Overview
MPosControllerLabelPrinter Class is an object that provides the Label Printer.
2 Instance Methods
Select the current string encoding type.
[Syntax]
-(__MPOS_RESULTS_) setCurrentEncoding:(NSStringEncoding)encoding;
[Parameters]
encoding
Set the NSStringEncoding.
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
Check the printer status.
[Syntax]
-(__MPOS_RESULTS_) checkPrinterStatus:(blockType1)statusReceiver;
[Parameters]
statusReceiver
Check the printer status.
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
This method prints in the printer buffer.
[Syntax]
-(__MPOS_RESULTS_) printBuffer:(NSInteger)numberOfCopies;
[Parameters]
numberOfCopies
The number of copies
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Example]
long lResult = [_printer printBuffer:1]; // Any number bigger than 1 will repeat the same printing for the specified number of times. if(lResult ==_MPOS_SUCCESS) NSLog(@”doPrint Success”); |
Print RawData.
[Syntax]
-(__MPOS_RESULTS_) printRawData:(NSData*)rawData;
[Parameters]
rawData
rawData to pPrint.
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
This method draws strings on the image buffer using Device Font.
[Syntax]
-(__MPOS_RESULTS_) drawTextDeviceFont:(NSString*)text
xPosition:(NSInteger)xPostion
yPosition:(NSInteger)yPostion
fontSelection:(char)fontSelection
fontWidth:(NSInteger)fontWidth
fontHeight:(NSInteger)fontHeight
rightSideCharacterSpacing:(NSInteger)rightSideCharacterSpacing
fontRotation:(NSInteger)fontRotation
reverse:(BOOL)reverse
bold:(BOOL)bold
textAlignment:(NSInteger)textAlignment;
[Parameters]
text
Text string to print.
xPosition
X coordinate of the position to print
yPosition
Y coordinate of the position to print
fontSelection
Selection of fonts to print
(Reference: 6-4-3-11 Appendix - 1 Defines - 7) LabelPrinter - Device Fonts)
fontWidth
Horizontal magnification of the selected font (1~4).
fontHeight
Vertical magnification of the selected font (1~4).
rightSideCharacterSpacing
Right side margin of the characters (ex: 5, +3, -10…).
fontRotation
Rotation setting of the selected font
(Reference: 6-4-3-11 Appendix - 1 Defines - 8) LabelPrinter - Rotation Degrees)
reverse
Option to use the Reverse Font.
Reverse Font will be used for printing if this parameter is set to YES.
bold
Option to use the Bold Font.
Bold Font will be used for printing if this parameter is set to YES.
textAlignment
Alignment method
(Reference: 6-4-3-11 Appendix - 1 Defines - 2) Barcode/Image/Text Alignment)
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Discussion]
Nothing will be printed when this API is called.
Contents requested by this API will be printed when 6-4-3-10 MPosControllerLabelPrinter Reference - 2 Instance Methods - 3) printBuffer API is called.
[Example]
lResult = [_printer drawTextDeviceFont:@"device Font Test" xPosition:70 yPosition:220 fontSelection:__MPOS_LABEL_DEVICE_FONT_12PT fontWidth:1 fontHeight:1 rightSideCharacterSpacing:0 fontRotation:_MPOS_LABEL_ROTATION_DEGREES_0 reverse:NObold:NO textAlignment:__MPOS _ALIGNMENT_LEFT]; if(lResult == _MPOS_SUCCESS) NSLog(@”drawTextDeviceFont Success”); |
This method draws strings on the image buffer using Device Font.
[Syntax]
-(long) drawTextVectorFont:(NSString*)text
xPosition:(NSInteger)xPostion
yPosition:(NSInteger)yPostion
fontSelection:(char)fontSelection
fontWidth:(NSInteger)fontWidth
fontHeight:(NSInteger)fontHeight
rightSideCharacterSpacing:(NSInteger)rightSideCharacterSpacing
fontRotation:(NSInteger)fontRotation
reverse:(BOOL)reverse
bold:(BOOL)bold
italic:(BOOL)italic
textWriteDirectionRightToLeft:(BOOL)textWriteDirectionRightToLeft
textAlignment:(NSInteger)textAlignment;
[Parameters]
text
Text string to print
xPosition
X coordinate of the position to print
yPosition
Y coordinate of the position to print
fontSelection
Selection of fonts to print
(Reference: 6-4-3-11 Appendix - 1 Defines - 7) LabelPrinter - Device Fonts)
fontWidth
Horizontal magnification of the selected font (1~4).
fontHeight
Vertical magnification of the selected font (1~4).
rightSideCharacterSpacing
Right side margin of the characters (ex: 5, +3, -10…).
fontRotation
Rotation setting of the selected font
(Reference: 6-4-3-11 Appendix - 1 Defines - 8) LabelPrinter - Rotation Degrees)
reverse
Option to use the Reverse Font.
Reverse Font will be used for printing if this parameter is set to YES.
bold
Option to use the Bold Font.
Bold Font will be used for printing if this parameter is set to YES.
italic
Option to use the Italic Font.
Italic Font will be used for printing if this parameter is set to YES.
textWriteDirectionRightToLeft
Option to print the character string in the direction from right to left
textAlignment
Alignment method
(Reference: 6-4-3-11 Appendix - 1 Defines - 2) Barcode/Image/Text Alignment)
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Discussion]
Nothing will be printed when this API is called.
Contents requested by this API will be printed when 6-4-3-10 MPosControllerLabelPrinter Reference - 2 Instance Methods - 3) printBuffer API is called.
[Example]
lResult = [_printer drawTextVectorFont:@"draw Font Test - Vector" xPosition:50 yPosition:100 fontSelection: _MPOS_LABEL_VECTOR_FONT_ASCII fontWidth:10 fontHeight:10 rightSideCharacterSpacing:0 fontRotation: _MPOS_LABEL_ROTATION_DEGREES_0 reverse:NO bold:YES italic:YES textWriteDirectionRightToLeft:NO textAlignment: _MPOSALIGNMENT_LEFT]; if(lResult == _MPOS_SUCCESS) NSLog(@”drawTextVectorFont Success”); |
This method requests the printing of 1D barcode to the image buffer.
[Syntax]
-(long) drawBarcode1D:(NSString*)data
xPosition:(NSInteger)xPostion
yPosition:(NSInteger)yPostion
barcodeType:(NSInteger)barcodeType
widthNarrow:(NSInteger)widthNarrow
widthWide:(NSInteger)widthWide
height:(NSInteger)height
hri:(NSInteger)hri
quietZoneWidth:(NSInteger)quietZoneWidth
rotation:(NSInteger)rotation;
[Parameters]
text
Barcode data to print
xPosition
X coordinate of the position to print
yPosition
Y coordinate of the position to print
barcodeType
Barcode type.
(Reference: 6-4-3-11 Appendix - 1 Defines - 10) LabelPrinter - 1D Barcode Types)
widthNarrow
Width of narrow bar
widthWide
Width of wide bar
height
Height of barcode
hri
HRI (Human Readable Interpretation) display position of code data
(Reference: 6-4-3-11 Appendix - 1 Defines - 9) LabelPrinter - Barcode HRI)
rotation
Rotation setting of barcode
(Reference: 6-4-3-11 Appendix - 1 Defines - 8) LabelPrinter - Rotation Degrees)
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Discussion]
Nothing will be printed when this API is called.
Contents requested by this API will be printed when 6-4-3-10 MPosControllerLabelPrinter Reference - 2 Instance Methods - 3) printBuffer API is called.
[Example]
lResult = [_printer drawBarcode1D:@">A1234567890" xPosition:50 yPosition:100 barcodeType:_MPOS_LABEL_BARCODE_TYPE_CODE128 widthNarrow:2 widthWide:6 height:100 hri:_MPOS_LABEL_BARCODE_HRI_BELOW_FONTSIZE1 quietZoneWidth:0 rotation:_MPOS_LABEL_ROTATION_DEGREES_0]; if(lResult == _MPOS_SUCCESS) NSLog(@”drawBarcode1D Success”); |
This method requests the printing of MaxiCode barcode to the image buffer.
[Syntax]
-(long) drawBarcodeMexiCode:(NSString*)data
xPosition:(NSInteger)xPostion
yPosition:(NSInteger)yPostion
mode:(NSInteger)mode;
[Parameters]
text
Barcode data to print
xPosition
X coordinate of the position to print
yPosition
Y coordinate of the position to print
mode
Mode of MaxiCode
(Reference: 6-4-3-11 Appendix - 1 Defines - 11) LabelPrinter - MaxiCode Modes)
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Discussion]
Nothing will be printed when this API is called.
Contents requested by this API will be printed when 6-4-3-10 MPosControllerLabelPrinter Reference - 2 Instance Methods - 3) printBuffer API is called.
[Example]
lResult = [_printer drawBarcodeMexiCode:@"Maxi Code Test!!!" xPosition:50 yPosition:400 mode:_ MPOS_LABEL_MAXICODE_MODE_0]; if(lResult == _MPOS_LABEL_RESULT_SUCCESS) NSLog(@”drawBarcodeMexiCode Success”); |
This method requests the printing of PDF417 barcode to the image buffer.
[Syntax]
-(long) drawBarcodePDF417:(NSString*)data
xPosition:(NSInteger)xPostion
yPosition:(NSInteger)yPostion
maximumRowCount:(NSInteger)maximumRowCount // 3~90
maximumColumnCount:(NSInteger)maximumColumnCount // 1~30
errorCorrectionLevel:(NSInteger)errorCorrectionLevel
dataCompressionMethod:(NSInteger)dataCompressionMethod
printBarcodeText:(BOOL)printBarcodeText
barcodeOriginPoint:(NSInteger)barcodeOriginPoint
moduleWidth:(NSInteger)moduleWidth // 2~9
barHeight:(NSInteger)barHeight // 4~99
rotation:(NSInteger)rotation;
[Parameters]
text
Barcode data to print
xPosition
X coordinate of the position to print
yPosition
Y coordinate of the position to print
maximumRowCount
maximum Row Count (3~90).
errorCorrectionLevel
Error correction level
(Reference: 6-4-3-11 Appendix - 1 Defines - 22) LabelPrinter - Error Correction Level)
dataCompressionMethod
Data Compression Method
(Reference: 6-4-3-11 Appendix - 1 Defines - 23) LabelPrinter - Data Compression Method)
printBarcodeText
HRI printing option.
barcodeOriginPoint
Position to be used as the reference point of barcode
(Reference: 6-4-3-11 Appendix - 1 Defines - 12) LabelPrinter - Barcode Origin Point)
moduleWidth
Module Width (2~9)
BarHeight
Height of barcode (4~99)
rotation
Rotation setting of barcode
(Reference: 6-4-3-11 Appendix - 1 Defines - 8) LabelPrinter - Rotation Degrees)
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Discussion]
Nothing will be printed when this API is called.
Contents requested by this API will be printed when 6-4-3-10 MPosControllerLabelPrinter Reference - 2 Instance Methods - 3) printBuffer API is called.
[Example]
lResult =[_printer drawBarcodePDF417:@"PDF417 Test" xPosition:50 yPosition:300 maximumRowCount:30 maximumColumnCount:5 errorCorrectionLevel:_MPOS_LABEL_ERROR_CORRECTION_LEVEL0 dataCompressionMethod:_ MPOS_LABEL_DATA_COMPRESSION_METHOD_TEXT printBarcodeText:YES barcodeOriginPoint:_ MPOS_LABEL_BARCODE_ORIGIN_POINT_UpperLeft moduleWidth:3 barHeight:10 rotation:_ MPOS_LABEL_ROTATION_DEGREES_0]; if(lResult == _MPOS_SUCCESS) NSLog(@”drawBarcodePDF417 Success”); |
This method requests the printing of QRCode to the image buffer.
[Syntax]
-(long) drawBarcodeQRCode:(NSString*)data
xPosition:(NSInteger)xPostion
yPosition:(NSInteger)yPostion
barcodeSize:(NSInteger)barcodeSize // 1~4
model:(NSInteger)model
errorColectionLevel:(NSInteger)errorColectionLevel
rotation:(NSInteger)rotation;
[Parameters]
data
Barcode data to print
xPosition
X coordinate of the position to print
yPosition
Y coordinate of the position to print
barcodeSize
Size of barcode (1~4)
model
Model of QRCode
(Reference: : 6-4-3-11 Appendix - 1 Defines - 13) LabelPrinter - QRCode Model)
errorCorrectionLevel
Error Correction Level
(Reference: 6-4-3-11 Appendix - 1 Defines - 22) LabelPrinter - Error Correction Level)rotation
Rotation setting of barcode
(Reference: 6-4-3-11 Appendix - 1 Defines - 8) LabelPrinter - Rotation Degrees)
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Discussion]
Nothing will be printed when this API is called.
Contents requested by this API will be printed when 6-4-3-10 MPosControllerLabelPrinter Reference - 2 Instance Methods - 3) printBuffer API is called.
[Example]
lResult =[_printer drawBarcodeQRCode:@"QR Code Test" xPosition:450 yPosition:300 barcodeSize:3 model:_ MPOS_LABEL_QRCODE_MODEL_2 errorColectionLevel:_ MPOS_LABEL_ERROR_CORRECTION_LEVEL1 rotation:_ MPOS_LABEL_ROTATION_DEGREES_0]; if(lResult == _MPOS_LABEL_RESULT_SUCCESS) NSLog(@”drawBarcodeQRCode Success”); |
This method requests the printing of Data Matrix to the image buffer.
[Syntax]
-(long) drawBarcodeDataMatrix:(NSString*)data
xPosition:(NSInteger)xPostion
yPosition:(NSInteger)yPostion
barcodeSize:(NSInteger)barcodeSize // 1~4
reverse:(BOOL)reverse
rotation:(NSInteger)rotation;
[Parameters]
data
Barcode data to print
xPosition
X coordinate of the position to print
yPosition
Y coordinate of the position to print
barcodeSize
Size of barcode (1~4)
reverse
Reverse mode
rotation
Rotation setting of barcode
(Reference: 6-4-3-11 Appendix - 1 Defines - 8) LabelPrinter - Rotation Degrees)
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Discussion]
Nothing will be printed when this API is called.
Contents requested by this API will be printed when 6-4-3-10 MPosControllerLabelPrinter Reference - 2 Instance Methods - 3) printBuffer API is called.
[Example]
lResult =[_printer drawBarcodeDataMatrix:@"dataMatrix Test" xPosition:600 yPosition:300 barcodeSize:3 reverse:NO rotation:_MPOS_LABEL_ROTATION_DEGREES_0]; if(lResult == _MPOS_SUCCESS) NSLog(@” drawBarcodeDataMatrix Success”); |
This method requests the printing of Aztec to the image buffer.
[Syntax]
-(long) drawBarcodeAztec:(NSString*)data
xPosition:(NSInteger)xPostion
yPosition:(NSInteger)yPostion
barcodeSize:(NSInteger)barcodeSize // 1~10
extendedChannel:(BOOL)extendedChannel
errorCorrectionLevel:(NSInteger)errorCorrectionLevel
menuSymbol:(BOOL)menuSymbol
numberOfSymbols:(NSInteger)numberOfSymbols
optionalID:(NSString*)optionalID
rotation:(NSInteger)rotation;
[Parameters]
data
Barcode data to print
xPosition
X coordinate of the position to print
yPosition
Y coordinate of the position to print
barcodeSize
Size of barcode (1~10)
extendedChannel
Extended channel
errorCorrectionLevel
Error Correction Level
Value |
Error control and symbol size/type |
0 |
Default error correction level |
1 ~ 99 |
Error correction percentage |
menuSymbol
Option to use menu symbol
numberOfSymbols
Number of symbols for structured append: (1 ~ 26)
optionalID
Optional ID field for structured append: ID field string (Maximum 24 character)
rotation
Rotation setting of barcode
(Reference: 6-4-3-11 Appendix - 1 Defines - 8) LabelPrinter - Rotation Degrees)
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Discussion]
Nothing will be printed when this API is called.
Contents requested by this API will be printed when 6-4-3-10 MPosControllerLabelPrinter Reference - 2 Instance Methods - 3) printBuffer API is called.
[Example]
lResult = [_printer drawBarcodeAztec:@"Aztec Barcode Test" xPosition:450 yPosition:400 barcodeSize:3 extendedChannel:NO errorCorrectionLevel:0 menuSymbol:NO numberOfSymbols:1 optionalID:@"" rotation:_ MPOS_LABEL_ROTATION_DEGREES_0]; if(lResult == _MPOS_SUCCESS) NSLog(@”drawBarcodeAztec Success”); |
This method requests the printing of Code49 to the image buffer.
[Syntax]
-(long)drawBarcodeCode49:(NSString*)data
xPosition:(NSInteger)xPostion
yPosition:(NSInteger)yPostion
widthNarrow:(NSInteger)widthNarrow
widthWide:(NSInteger)widthWide
height:(NSInteger)height
hri:(NSInteger)hri
startingMode:(NSInteger)startingMode
rotation:(NSInteger)rotation;
[Parameters]
data
Barcode data to print
xPosition
X coordinate of the position to print
yPosition
Y coordinate of the position to print
widthNarrow
Width of narrow bar
widthWide
Width of wide bar
height
Height of barcode
hri
Print position of barcode data value (Human Readable Interpretation)
(Reference: 6-4-3-11 Appendix - 1 Defines - 19) LabelPrinter - Draw Block Options)
startingMode
Starting mode
(Reference: 6-4-3-11 Appendix - 1 Defines - 14) LabelPrinter - Code 49 Starting Mode)
rotation
Rotation setting of barcode
(Reference: 6-4-3-11 Appendix - 1 Defines - 8) LabelPrinter - Rotation Degrees)
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Discussion]
Nothing will be printed when this API is called.
Contents requested by this API will be printed when 6-4-3-10 MPosControllerLabelPrinter Reference - 2 Instance Methods - 3) printBuffer API is called.
[Example]
lResult = [_printer drawBarcodeCode49:@"Code 49 Test" xPosition:600 yPosition:400 widthNarrow:1 widthWide:3 height:100 hri:_ MPOS_LABEL_BARCODE_HRI_ABOVE_FONTSIZE1 startingMode:_ MPOS_LABEL_STARTINGMODE_AUTOMATIC rotation:_ _AUTOMATIC _ROTATION_DEGREES_0]; if(lResult == _MPOS_SUCCESS) NSLog(@” drawBarcodeCode49 Success”); |
This method requests the printing of CodaBlock to the image buffer.
[Syntax]
-(long) drawBarcodeCodaBlock:(NSString*)data
xPosition:(NSInteger)xPostion
yPosition:(NSInteger)yPostion
widthNarrow:(NSInteger)widthNarrow
widthWide:(NSInteger)widthWide
height:(NSInteger)height
securityLevel:(BOOL)securityLevel
numberOfCharactersPerrow:(NSInteger)numberOfCharactersPerrow
mode:(char)mode
numberOfRowToEncode:(NSInteger)numberOfRowToEncode;
[Parameters]
data
Barcode data to print
xPosition
X coordinate of the position to print
yPosition
Y coordinate of the position to print
widthNarrow
Width of narrow bar
widthWide
Width of wide bar
height
Height of barcode
securityLevel
securityLevel setting
numberOfCharactersPerrow
Number of characters per row (data columns): 2~62
mode
Barcode printing mode
(Reference: 6-4-3-11 Appendix - 1 Defines - 15) LabelPrinter - Codablock Mode)
numberOfRowToEncode
Number of rows to encode
Mode |
Value |
_MPOS_LABEL_CODABLACK_MODE_A |
1 ~ 18 |
_MPOS_LABEL_CODABLACK_MODE_E |
2 ~ 4 |
_MPOS_LABEL_CODABLACK_MODE_F |
2 ~ 4 |
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Discussion]
Nothing will be printed when this API is called.
Contents requested by this API will be printed when 6-4-3-10 MPosControllerLabelPrinter Reference - 2 Instance Methods - 3) printBuffer API is called.
[Example]
lResult = [_printer drawBarcodeIMB:@"01234567890123456789" xPosition:50 yPosition:1000 printBarcodeText:YES rotation:_ MPOS_LABEL _ROTATION_DEGREES_0]; if(lResult == _MPOS_SUCCESS) NSLog(@” drawBarcodeCodaBlock Success”); |
This method requests the printing of Micro PDF417 to the image buffer.
[Syntax]
-(long) drawBarcodeMicroPDF:(NSString*)data
xPosition:(NSInteger)xPostion
yPosition:(NSInteger)yPostion
moduleWidth:(NSInteger)moduleWidth // 2~8
barcodeHeight:(NSInteger)barcodeHeight // 1~99
mode:(NSInteger)mode // 0~33
rotation:(NSInteger)rotation;
[Parameters]
text
Barcode data to print
xPosition
X coordinate of the position to print
yPosition
Y coordinate of the position to print
moduleWidth
module Width (2~8)
barcodeHeight
Height of barcode (1~99)
rotation
Rotation setting of barcode
(Reference: 6-4-3-11 Appendix - 1 Defines - 8) LabelPrinter - Rotation Degrees)
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Discussion]
Nothing will be printed when this API is called.
Contents requested by this API will be printed when 6-4-3-10 MPosControllerLabelPrinter Reference - 2 Instance Methods - 3) printBuffer API is called.
[Example]
lResult = [_printer drawBarcodeMicroPDF:@"MICRO PDF 417 TEST" xPosition:50 yPosition:900 moduleWidth:4 barcodeHeight:4 mode:8 rotation:_MPOS_LABEL _ROTATION_DEGREES_0]; if(lResult == _MPOS_SUCCESS) NSLog(@”drawBarcodeMicroPDF Success”); |
This method requests the printing of BarcodeIMB to the image buffer.
[Syntax]
-(long) drawBarcodeIMB:(NSString*)data
xPosition:(NSInteger)xPostion
yPosition:(NSInteger)yPostion
printBarcodeText:(BOOL)printBarcodeText
rotation:(NSInteger)rotation;
[Parameters]
data
Barcode data to print
xPosition
X coordinate of the position to print
yPosition
Y coordinate of the position to print
printBarcodeText
HRI printing option
rotation
Rotation setting of barcode
(Reference: 6-4-3-11 Appendix - 1 Defines - 8) LabelPrinter - Rotation Degrees)
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Discussion]
Nothing will be printed when this API is called.
Contents requested by this API will be printed when 6-4-3-10 MPosControllerLabelPrinter Reference - 2 Instance Methods - 3) printBuffer API is called.
[Example]
lResult = [_printer drawBarcodeIMB:@"01234567890123456789" xPosition:50 yPosition:1000 printBarcodeText:YES rotation:_MPOS_LABEL _ROTATION_DEGREES_0]; if(lResult == _MPOS_SUCCESS) NSLog(@” drawBarcodeIMB Success”); |
This method requests the printing of BarcodeMSI to the image buffer.
[Syntax]
-(long) drawBarcodeMSI:(NSString*)data
xPosition:(NSInteger)xPostion
yPosition:(NSInteger)yPostion
widthNarrow:(NSInteger)widthNarrow
widthWide:(NSInteger)widthWide
height:(NSInteger)height
checkDigitSelection:(NSInteger)checkDigitSelection
printCheckDigitInHRI:(BOOL)printCheckDigitInHRI
hri:(NSInteger)hri
rotation:(NSInteger)rotation;
[Parameters]
data
Barcode data to print
xPosition
X coordinate of the position to print
yPosition
Y coordinate of the position to print
widthNarrow
Width of narrow bar
widthWide
Width of wide bar
height
Height of barcode.
checkDigitSelection
checkDigit option
(Reference: 6-4-3-11 Appendix - 1 Defines - 16) LabelPrinter - Check Digit Option)
printCheckDigitInHRI
Option to include check digit in HRI
hri
Print position of barcode data value (Human Readable Interpretation)
(Reference: 6-4-3-11 Appendix - 1 Defines - 9) LabelPrinter - Barcode HRI)
rotation
Rotation setting of barcode
(Reference: 6-4-3-11 Appendix - 1 Defines - 8) LabelPrinter - Rotation Degrees)
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Discussion]
Nothing will be printed when this API is called.
Contents requested by this API will be printed when 6-4-3-10 MPosControllerLabelPrinter Reference - 2 Instance Methods - 3) printBuffer API is called.
[Example]
lResult = [_printer drawBarcodeMSI:@"123456" xPosition:50 yPosition:1100 widthNarrow:2 widthWide:7 height:100 checkDigitSelection:_MPOS_LABEL_CHECKDIGIT_1MOD10 printCheckDigitInHRI:YES hri:_MPOS_LABEL _BARCODE_HRI_BELOW_FONTSIZE1 rotation:_MPOS_LABEL_ROTATION_DEGREES_0]; if(lResult == _MPOS_SUCCESS) NSLog(@” drawBarcodeMSI Success”); |
This method requests the printing of BarcodePlessey to the image buffer.
[Syntax]
-(long) drawBarcodePlessey:(NSString*)data
xPosition:(NSInteger)xPostion
yPosition:(NSInteger)yPostion
widthNarrow:(NSInteger)widthNarrow
widthWide:(NSInteger)widthWide
height:(NSInteger)height
printCheckDigit:(BOOL)printCheckDigit
hri:(NSInteger)hri
rotation:(NSInteger)rotation;
[Parameters]
data
Barcode data to print
xPosition
X coordinate of the position to print
yPosition
Y coordinate of the position to print
widthNarrow
Width of narrow bar
widthWide
Width of wide bar
height
Height of barcode.
printCheckDigitInHRI
Option to include check digit in HRI
hri
Print position of barcode data value (Human Readable Interpretation)
(Reference: 6-4-3-11 Appendix - 1 Defines - 9) LabelPrinter - Barcode HRI)
rotation
Rotation setting of barcode
(Reference: 6-4-3-11 Appendix - 1 Defines - 8) LabelPrinter - Rotation Degrees)
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Discussion]
Nothing will be printed when this API is called.
Contents requested by this API will be printed when 6-4-3-10 MPosControllerLabelPrinter Reference - 2 Instance Methods - 3) printBuffer API is called.
[Example]
lResult = [_printer drawBarcodePlessey:@"12345" xPosition:100 yPosition:100 widthNarrow:2 widthWide:7 height:100 printCheckDigit:YES hri:_ MPOS_LABEL _BARCODE_HRI_BELOW_FONTSIZE1 rotation:_ MPOS_LABEL _ROTATION_DEGREES_0]; if(lResult == _MPOS_SUCCESS) NSLog(@” drawBarcodePlessey Success”); |
This method requests the printing of BarcodeTLC39 to the image buffer.
[Syntax]
-(long) drawBarcodeTLC39:(NSString*)data
xPosition:(NSInteger)xPostion
yPosition:(NSInteger)yPostion
widthNarrow:(NSInteger)widthNarrow
widthWide:(NSInteger)widthWide
height:(NSInteger)height
rowHeightOfMicroPDF417:(NSInteger)rowHeightOfMicroPDF417
narrowWidthOfMicroPDF417:(NSInteger)narrowWidthOfMicroPDF417
rotation:(NSInteger)rotation;
[Parameters]
data
Barcode data to print
xPosition
X coordinate of the position to print
yPosition
Y coordinate of the position to print
widthNarrow
Width of narrow bar
widthWide
Width of wide bar
height
Height of barcode.
rowHeightOfMicroPDF417
Row height of microPDF417 barcode
narrowWidthOfMicroPDF417
narrowWideHeight of microPDF417 barcode
rotation
Rotation setting of barcode
(Reference: 6-4-3-11 Appendix - 1 Defines - 8) LabelPrinter - Rotation Degrees)
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Discussion]
Nothing will be printed when this API is called.
Contents requested by this API will be printed when 6-4-3-10 MPosControllerLabelPrinter Reference - 2 Instance Methods - 3) printBuffer API is called.
[Example]
lResult = [_printer drawBarcodeTLC39:@"123456,ABCD12345678901234" xPosition:100 yPosition:300 widthNarrow:2 widthWide:7 height:50 rowHeightOfMicroPDF417:3 narrowWidthOfMicroPDF417:2 rotation:_ MPOS_LABEL _ROTATION_DEGREES_0]; if(lResult == _MPOS_SUCCESS) NSLog(@” drawBarcodeTLC39 Success”); |
This method requests the printing of BarcodeRSS to the image buffer.
[Syntax]
-(long) drawBarcodeRSS:(NSString*)data
xPosition:(NSInteger)xPostion
yPosition:(NSInteger)yPostion
barcodeType:(NSInteger)barcodeType
magnification:(NSInteger)magnification // 1~10
separatorHeight:(NSInteger)separatorHeight // 1~2
barcodeHeight:(NSInteger)barcodeHeight
segmentWidth:(NSInteger)segmentWidth // 0~22
rotation:(NSInteger)rotation;
[Parameters]
data
Barcode data to print
xPosition
X coordinate of the position to print
yPosition
Y coordinate of the position to print
barcodeType
RSS barcode type
(Reference: 6-4-3-11 Appendix - 1 Defines - 17) LabelPrinter - RSS Barcode Type)magnification
magnification. (1~10)
separatorHeight
Height of separator (1~2)
barcodeHeight
Height of barcode.
segmentWidth
segment Width(0~22)
rotation
Rotation setting of barcode
(Reference: 6-4-3-11 Appendix - 1 Defines - 8) LabelPrinter - Rotation Degrees)
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Discussion]
Nothing will be printed when this API is called.
Contents requested by this API will be printed when 6-4-3-10 MPosControllerLabelPrinter Reference - 2 Instance Methods - 3) printBuffer API is called.
[Example]
lResult = [_printer drawBarcodeRSS:@"12345678901|this is composite info" xPosition:100 yPosition:600 barcodeType:_ MPOS_LABEL _RSS_BARCODE_TYPE_RSS14 magnification:2 separatorHeight:1 barcodeHeight:20 segmentWidth:10 rotation:_ MPOS_LABEL _ROTATION_DEGREES_0]; if(lResult == _MPOS_SUCCESS) NSLog(@” drawBarcodeRSS Success”); |
This method requests the printing of BarcodeGS1DataBar to the image buffer.
[Syntax]
-(long) drawBarcodeGS1DataBar:(NSString*)data
xPosition:(NSInteger)xPostion
yPosition:(NSInteger)yPostion
barcodeType:(NSInteger)barcodeType
magnification:(NSInteger)magnification // 1~10
separatorHeight:(NSInteger)separatorHeight // 1~2
barcodeHeight:(NSInteger)barcodeHeight
segmentWidth:(NSInteger)segmentWidth // 0~22
rotation:(NSInteger)rotation;
[Parameters]
data
Barcode data to print
xPosition
X coordinate of the position to print
yPosition
Y coordinate of the position to print
barcodeType
RSS barcode type
(Reference: 6-4-3-11 Appendix - 1 Defines - 17) LabelPrinter - RSS Barcode Type)
magnification
magnification. (1~10)
separatorHeight
Height of separator (1~2)
barcodeHeight
Height of barcode.
segmentWidth
segment Width(0~22)
rotation
Rotation setting of barcode
(Reference: 6-4-3-11 Appendix - 1 Defines - 8) LabelPrinter - Rotation Degrees)
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Discussion]
Nothing will be printed when this API is called.
Contents requested by this API will be printed when 6-4-3-10 MPosControllerLabelPrinter Reference - 2 Instance Methods - 3) printBuffer API is called.
22) drawBlock
This method requests the printing of Block to the image buffer.
[Syntax]
-(long) drawBlock: (NSInteger)startPosX
startPosY:(NSInteger)startPosY
endPosX:(NSInteger)endPosX
endPosY:(NSInteger)endPosY
option:(char)option
thickness:(NSInteger)thickness;
[Parameters]
startPosX
X coordinate of the starting position of the block for printing
startPosY
Y coordinate of the starting position of the block for printing
endPosX
X coordinate of the end position of the block for printing
endPosY
Y coordinate of the end position of the block for printing
option
Option value for printing
thickness
Thickness value for printing
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Discussion]
Nothing will be printed when this API is called.
Contents requested by this API will be printed when 6-4-3-10 MPosControllerLabelPrinter Reference - 2 Instance Methods - 3) printBuffer API is called.
[Example]
lResult = [_printer drawBlock:100 startPosY:100 endPosX:300 endPosY:300 option:_MPOS_LABEL_DRAW_BLOCK_OPTION_SLOPE thickness:1]; NSLog(@” drawBlock Success”); |
23) drawCircle
This method requests the printing of Circle to the image buffer.
[Syntax]
-(long) drawCircle: (NSInteger)startPosX
startPosY:(NSInteger)startPosY
sizeSelection:(NSInteger)sizeSelection
multiplier:(NSInteger)multiplier;
[Parameters]
startPosX
X coordinate of the starting position of the circle for printing
startPosY
Y coordinate of the starting position of the circle for printing
sizeSelection
Size value of the circle
multiplier
Multiplier value
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Discussion]
Nothing will be printed when this API is called.
Contents requested by this API will be printed when 6-4-3-10 MPosControllerLabelPrinter Reference - 2 Instance Methods - 3) printBuffer API is called.
[Example]
lResult = [_printer drawCircle:200 startPosY:200 sizeSelection:_MPOS_LABEL_DRAW_CIRCLE_SIZE_40X40 multiplier:1]; if(lResult == _MPOS_SUCCESS) NSLog(@”drawTextDeviceFont Success”); |
This method requests the printing of Image to the image buffer.
[Syntax]
-(long) drawImage: (UIImage*)image
stratPosX:(NSInteger)startPosX
startPosY:(NSInteger)startPosY
width:(NSInteger)width;
[Parameters]
Image
Image for printing
startPosX
X coordinate of the starting position of the circle for printing
startPosY
Y coordinate of the starting position of the circle for printing
width
Width value
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
[Discussion]
Nothing will be printed when this API is called.
Contents requested by this API will be printed when 6-4-3-10 MPosControllerLabelPrinter Reference - 2 Instance Methods - 3) printBuffer API is called.
Set the PrintingType.
[Syntax]
-(__MPOS_RESULTS_) setPrintingType:(char)printingType;
[Parameters]
printingType
Set the printingType.
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
Set the Margin.
[Syntax]
-(__MPOS_RESULTS_) setMargin:(NSInteger)horizontalMargin
verticalMargin:(NSInteger)verticalMargin;
[Parameters]
horizontalMargin
Set the horizontalMargin .
verticalMargin
Set the verticalMargin.
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
Set the BackFeed Option.
[Syntax]
-(__MPOS_RESULTS_) setBackFeedOption:(BOOL)bEnable
stepQuantity:(NSInteger)stepQuantity;
[Parameters]
bEnable
Set the BackFeed Enable.
stepQuantity
Set the Quantity.
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
Set the Length.
[Syntax]
-(__MPOS_RESULTS_) setLength:(NSInteger) labelLength
gepLength:(NSInteger) gapLength
mediaType:(char) mediaType
offsetLength:(NSInteger) offsetLength;
[Parameters]
labelLength
Set the labelLength.
gapLength
Set the gapLength .
mediaType
Set the mediaType.
offsetLength
Set the offsetLength.
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
Set the Width.
[Syntax]
-(__MPOS_RESULTS_) setWidth:(NSInteger) labelWidth;
[Parameters]
labelWidth
Set the labelWidth.
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
Set the BufferMode.
[Syntax]
-(__MPOS_RESULTS_) setBufferMode:(BOOL) isUseDoubleBuffering;
[Parameters]
isUseDoubleBuffering
Set the Buffer mode.
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
Set the speed.
[Syntax]
-(__MPOS_RESULTS_) setSpeed:(NSInteger) speedValue;
[Parameters]
speedValue
Set the speed.
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
Set the density.
[Syntax]
-(__MPOS_RESULTS_) setDensity:(NSInteger) densityValue;
[Parameters]
densityValue
Set the densityValue (1~20).
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
33) set Orientation
Set the oriention.
[Syntax]
-(__MPOS_RESULTS_) setOrientation:(char) orientationValue;
[Parameters]
orientationValue
Set the orientationValue.
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
Set the Offset.
[Syntax]
-(__MPOS_RESULTS_) setOffset:(NSInteger) offsetValue;
[Parameters]
offsetValue
Set the offsetValue (-100 ~ 100).
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
Set the Cutting Position.
[Syntax]
-(__MPOS_RESULTS_) setCuttingPosition:(NSInteger) cuttingPosition;
[Parameters]
cuttingPosition
Set the cutting Position.
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
Set the Auto Cutter.
[Syntax]
-(__MPOS_RESULTS_) setAutoCutter:(BOOL) enableAutoCutter
cuttingPeriod:(NSInteger)cuttingPeriod;
[Parameters]
enableAutoCutter
Set the AutoCutter Enable.
cuttingPeriod
Set the cuttingPeriod.
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
This method gets information and Model Name.
[Syntax]
-(__MPOS_RESULTS_) getModelName:(NSString**) modelNameBuffer;
[Parameters]
modelNameBuffer
model name information.
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
The method gets information and Firmware Version.
[Syntax]
-(__MPOS_RESULTS_) getFirmwareVersion:(NSString**) firmwareVersion;
[Parameters]
firmwareVersion
Firmware Version information.
[Return Value]
This method returns _MPOS_SUCCESS if the operation is successful,
Refer to [6-4-3-11 Appendix - 1 Defines - 1) __MPOS_RESULTS_] for other cases.
Appendix
1 Defines
1) __MPOS_RESULTS_
The following table contains the definitions of result codes returned by various methods.
Code |
Value |
Description |
_MPOS_SUCCESS |
0 |
Success. |
_MPOS_SUCCESS_ALREADY_OPEN |
1000 |
Device is already open. |
_MPOS_FAIL_INVALID_INTERFACE |
1001 |
Interface setting is incorrect. |
_MPOS_FAIL_NO_OPEN |
1002 |
Failed to open the device. |
_MPOS_FAIL_NOT_SUPPORT |
1003 |
Not supported. |
_MPOS_FAIL_INVALID_PARAMETER |
1004 |
Invalid parameters. |
_MPOS_FAIL_NO_RESPONSE |
1005 |
No response. |
_MPOS_FAIL_NO_DEVICE |
1006 |
Device cannot be found. |
_MPOS_FAIL_NO_FILE |
1007 |
File cannot be found. |
_MPOS_FAIL_BUSY |
1008 |
Device is busy in processing other tasks. |
_MPOS_FAIL |
1009 |
Operation failed. |
2) Barcode/Image/Text Alignment
This is an attribute to define alignment of barcode/image/text, and the default value is set to _MPOS_ALIGNMENT_LEFT
* The following options are available for this value.
Code |
Value |
Description |
_MPOS_ALIGNMENT_LEFT |
-1 |
Align to Left |
_MPOS_ALIGNMENT_CENTER |
-2 |
Align to Center |
_MPOS_ALIGNMENT_RIGHT |
-3 |
Align to Right |
It sets the position to print barcode data.
* The following options are available.
Code |
Value |
Description |
_MPOS_BARCODE_TEXT_NONE |
0 |
Barcode data is not printed. |
_MPOS_BARCODE_TEXT_ABOVE |
1 |
Barcode data is printed above the barcode. |
_MPOS_BARCODE_TEXT_BELOW |
2 |
Barcode data is printed below the barcode. |
This attribute defines the barcode type.
* The following options are available.
Code |
Value |
Description |
_MPOS_BARCODE_UPCA |
101 |
UPC-A |
_MPOS_BARCODE_UPCE |
102 |
UPC-E |
_MPOS_BARCODE_EAN8 |
103 |
EAN8 |
_MPOS_BARCODE_EAN13 |
104 |
EAN13 |
_MPOS_BARCODE_ITF |
106 |
ITF |
_MPOS_BARCODE_Codabar |
107 |
Codabar |
_MPOS_BARCODE_Code39 |
108 |
Code39 |
_MPOS_BARCODE_Code93 |
109 |
Code93 |
_MPOS_BARCODE_Code128 |
110 |
Code128 |
This is an attribute to set the size of text, and the height and width can be set simultaneously using bitwise OR combination.
* The following options are available.
<Width Attribute>
Code |
|