This SDK manual describes the contents of the library required to develop Linux OS application programs. At BIXOLON, we are constantly making improvements to the functions and quality of our products. The specifications and contents of this manual are subject to change without prior notice for this reason.
POS/Mobile Printer 2. Property The constants used by the library are declared in bxlConst.c. The development environment is based on C. 2-1 CharacterSet (LONG R/W) This is the property for defining the printer's code page and set to BXL_CS_437 by default. The values can be set and read using SetCharSet() and GetCharSet().
POS/Mobile Printer 2-2 International CharacterSet (LONG R/W) This is the property for defining International character Set and set to ICS_USA by default. The values can be set or read using SetInternationalChar() and GetInternationalChar(). The following International character Set can be used: Constant Value Description...
POS/Mobile Printer 2-3 State (LONG R) This is the property that sets the printer status. It is read only and calls GetStatus() to read the printer status. The status value can be set in duplicate and each value can be checked using bitwise operation.
The operation is successful. PORT_OPEN_ERROR The communication port cannot be opened. NO_CONNECTED_PRINTER -100 The printer is not connected. NO_BIXOLON_PRINTER -101 It is not a BIXOLON printer. * Example int ret; // USB ret = ConnectToPrinter(“USB:”); // Serial ret = ConnectToPrinter(“serial:115200”); // Parallel ret = ConnectToPrinter(“parallel”);...
POS/Mobile Printer 3-3 InitializePrinter Cancel the existing settings and initialize. int InitializePrinter() [Parameters] None [Return Values] Constant Value Description SUCCESS The function is successful. WRITE_ERROR -105 Data transmission failed. * Example …… InitializePrinter(); …… Rev. 1.00 - 9 -...
POS/Mobile Printer 3-4 LineFeed Line feed to the amount of the integer value set as a factor. int LineFeed (const unsigned int lineNum) [Parameters] * const unsigned int lineNum [in] Send the number of line feeding lines in an integer value as a factor. [Return Values] Constant Value...
POS/Mobile Printer 3-5 SetLeftMargin Set the left margin. int SetLeftMargin (long margin) [Parameters] * long margin [in] Margin size (0 ~ 65535) [Return Values] Constant Value Description SUCCESS The function is successful. WRITE_ERROR -105 Data transmission failed. BAD_ARGUMENT -117 Incorrect values have been entered. * Example ConnectToPrinter(………..);...
POS/Mobile Printer 3-6 SetUpsideDown Set the upside-down function. int SetUpsizeDown (bool upsideDown) [Parameters] * bool upsideDown [in] Enable/disable the upside-down function. [Return Values] Constant Value Description SUCCESS The function is successful. WRITE_ERROR -105 Data transmission failed. * Example ConnectToPrinter(………..); …… SetUpsideDown(true);...
POS/Mobile Printer 3-7 PartialCut Enable the partial cut function. int PartialCut() [Parameters] None [Return Values] Constant Value Description SUCCESS The function is successful. WRITE_ERROR -105 Data transmission failed. NOT_SUPPORT -124 The function is not supported. * Example ConnectToPrinter(………..); …… PartialCut(); ……...
POS/Mobile Printer 3-8 OpenCashDrawer Open the cash drawer. int OpenCashDrawer (unsigned int milliSec) [Parameters] * unsigned int milliSec [in] Set the open signal length (0 ~ 255). [Return Values] Constant Value Description SUCCESS The function is successful. WRITE_ERROR -105 Data transmission failed. NOT_SUPPORT -124 The function is not supported.
POS/Mobile Printer 3-9 PrintText Print texts. int PrintText(const char* text, const int alignment, const unsigned int attribute, const unsigned int textSize) [Parameters] * const char* text [in] String with null as a terminator. Send the text data to print. * const int alignment [in] Set the text alignment.
Page 16
[Return Values] Constant Value Description SUCCESS The function is successful. STATUS_ERROR -103 Not ready to print. WRITE_ERROR -300 Data transmission failed. * Example ConnectToPrinter(………..); …… PrintText("Bixolon Linux SDK Text.\n", ALIGNMENT_LEFT, ATTR_FONTTYPE_A, TS_HEIGHT_0 | TS_WIDTH_0); …… Rev. 1.00 - 16 -...
POS/Mobile Printer 3-10 PrintTextW Print 2Bytes texts. int PrintTextW(const char* text, const int alignment, const unsigned int attribute, const unsigned int textSize, const unsigned int codePage) [Parameters] * const char* text [in] String with null as a terminator. Send the text data to print. * const int alignment [in] Set the text alignment.
Page 18
POS/Mobile Printer Constant Value Description TS_HEIGHT_0 0x00 Set the height scale to x1. TS_HEIGHT_1 0x01 Set the height scale to x2. TS_HEIGHT_2 0x02 Set the height scale to x3. TS_HEIGHT_3 0x03 Set the height scale to x4. TS_HEIGHT_4 0x04 Set the height scale to x5. TS_HEIGHT_5 0x05 Set the height scale to x6.
POS/Mobile Printer 3-11 PrintBarcode Print 1- and 2-dimensional barcodes. int PrintBarcode(const int barcodeType, const char* barcodeData, const barcodeInfo_s* barcodeInfo) [Parameters] * const int barcodeType [in] Set the barcode type. Defined in bxlConst.c. Barcode Value Description BARCODE_UPCA Print UPC-A barcode. BARCODE_UPCE Print UPC-E barcode.
Page 20
POS/Mobile Printer unsigned int mode [in] Send the model value when printing QR Code. Constant Value Description BARCODE_QR_MODEL1 Model 1 BARCODE_QR_MODEL2 Model 2 Send the mode value when printing Maxi Code. Constant Value Description BARCODE_MAXI_MODE2 Mode 2 BARCODE_MAXI_MODE3 Mode 3 BARCODE_MAXI_MODE4 Mode 4 Send the mode value when printing AZTEC.
Page 21
POS/Mobile Printer unsigned int alignment [in] Set the barcode alignment. Constant Value Description BXL_ALIGNMENT_LEFT Align to the left BXL_ALIGNMENT_CENTER Align to the center BXL_ALIGNMENT_RIGHT Align to the right unsigned int textPosition [in] Set the barcode data printing position. 2-dimensional barcode has only BXL_BC_TEXT_NONE .
POS/Mobile Printer 3-12 DirectIO Send and read the user-defined data. int DirectIO(char* writeData, int writeLen, char* readData, int* readLen, unsigned int mTimeout) [Parameters] * char* writeData, [in] Data to be sent to the printer * int writeLen [in] Size of data to be sent to the printer write does not function if 0 is entered to writeData for NULL, writeLen.
POS/Mobile Printer 3-14 DownloadNVImage Save images to the non-volatile memory area of the printer. int DownloadNVImage (const char *imagePath, const unsigned int keyCode) [Parameters] * const char *imagePath [in] String for the image file path. JPG, BMP and GIF are supported. * const unsigned int keyCode [in] Address of the memory area where image is stored (0 ~ 255).
POS/Mobile Printer 3-15 PrintNVImage Print the images stored in the non-volatile memory area of the printer. int PrintNVImage (const unsigned int keyCode) [Parameters] * const unsigned int keyCode [in] Address code of the image to be printed (0 ~ 255) [Return Values] Constant Value...
POS/Mobile Printer 3-16 RemoveAllNVImage Remove all the images stored in the non-volatile memory area of the printer. int RemoveAllNVImage () [Parameters] None [Return Values] Constant Value Description SUCCESS The function is successful. WRITE_ERROR -105 Data transmission failed. NOT_SUPPORT -124 The function is not supported. * Example ConnectToPrinter(………..);...
POS/Mobile Printer 3-17 RemoveNVImage Remove all the images with the specified address stored in the non-volatile memory area of the printer. int RemoveNVImage (const unsigned int keyCode) [Parameters] * const unsigned int keyCode [in] Address code of the image to be printed (0 ~ 255) [Return Values] Constant Value...
POS/Mobile Printer 3-18 GetNVImageKeyCode Read the address list of the images stored in the non-volatile memory area of the printer. int GetNVImageKeyCode (char *keyCodeList, unsigned int *listLen) [Parameters] * char *keyCodeList [in, out] Buffer to save the list of image address * unsinged int *listLen [in, out] Length of keyCodeList [Return Values]...
POS/Mobile Printer 3-19 SetAutoStatusCheck Enable/disable ASB mode to check the printer status (cover open, no paper). int SetAutoStatusCheck(bool enable) [Parameters] * bool enable [in] Enable/disable ASB mode. [Return Values] Constant Value Description SUCCESS The function is successful. WRITE_ERROR -105 Data transmission failed. * Example int status = 0x00;...
POS/Mobile Printer 3-20 GetStatus Read the printer status (cover open, no paper). int GetStatus() [Parameters] None [Return Values] Constant Value Description SUCCESS The function is successful. READ_TIMEOUT -127 No status data * Example int status = 0x00; ConnectToPrinter(………..); SetAutoStatusCheck(true); …... status = GetStatus();...
POS/Mobile Printer 3-21 SelectMode Select Label/Receipt Mode. Only mobile printers are supported. int SelectMode(bool labelMode) [Parameters] * bool labelMode [in] Send whether to use Label Mode. If the value is TRUE, the label mode is selected. [Return Values] Constant Value Description SUCCESS The function is successful.
POS/Mobile Printer 3-22 NextPrintPos Feed the paper to the starting point of the next label paper. The function is only enabled if the mobile printer is set to label mode. int NextPrintPos() [Parameters] None [Return Values] Constant Value Description SUCCESS The function is successful.
POS/Mobile Printer 3-23 AutoCalibration Perform Auto Calibration if set to Label Mode. The function is only enabled if the mobile printer is set to label mode. int AutoCalibration() [Parameters] None [Return Values] Constant Value Description SUCCESS The function is successful. WRITE_ERROR -105 Data transmission failed.
POS/Mobile Printer 3-24 SelectPageMode Enable/disable Page Mode. int SelectPageMode(bool pageMode) [Parameters] * bool pageMode [in] Set whether to use Page Mode. Page Mode is selected if set to TRUE. [Return Values] Constant Value Description SUCCESS The function is successful. WRITE_ERROR -105 Data transmission failed.
POS/Mobile Printer 3-25 PrintDataInPM Prints all the data in the printer buffer if set to Page Mode and the printer is switched to Standard Mode after printing. int PrintDataInPM() [Parameters] None [Return Values] Constant Value Description SUCCESS The function is successful. WRITE_ERROR -105 Data transmission failed.
POS/Mobile Printer 3-26 SetPrintAreaInPM Sets the size and position of the printing area when set to Page Mode. int SetPrintAreaInPM (long x, Iong y, Iong width, Iong height) [Parameters] * Iong x [in] x-coordinates of the printing area * Iong y [in] y-coordinates of the printing area * Iong width [in] width of the printing area...
POS/Mobile Printer 3-27 SetPrintDirectionInPM Set the printing direction in the Page Mode. int SetPrintDirectionInPM (int printDirection) [Parameters] * int printDirection printDirection Value Direction Starting Position Rotation PAGEMODE_ROTATE_0 Left -> Right Top left 0 degree PAGEMODE_ROTATE_90 Top -> Bottom Top right 90 degrees PAGEMODE_ROTATE_180 Right ->...
POS/Mobile Printer 3-30 ReadStartMSR Switch the printer status to MSR Ready. If it returns SUCCESS, it is identified as normal. Only mobile printers are supported. long ReadStartMSR() [Parameters] None [Return Values] Constant Value Description SUCCESS The function is successful. NOT_SUPPORT -124 MSR function is not supported.
POS/Mobile Printer 3-31 ReadCancelMSR Disable the MSR Ready status. Only mobile printers are supported. long ReadCancelMSR() [Parameters] None [Return Values] Constant Value Description SUCCESS The function is successful. WRITE_ERROR -105 Data transmission failed. NOT_SUPPORT -124 MSR function is not supported. * Example ConnectToPrinter(………..);...
POS/Mobile Printer 3-32 ReadMSRData Read the MSR data. When the data is read, it returns the data value otherwise the read mode can be canceled using ReadCancelMSR. Only mobile printers are supported. long ReadMSRData(char *pMSRData1, char *pMSRData2, char *pMSRData3, const unsigned int bufLen) [Parameters] * char *pMSRData1 [out] Read MSR Data Track 1 to the buffer defined by the caller.
POS/Mobile Printer 3-33 ScrPowerUp Turn on the SCR. This function is only available on SPP-R210 SCR. long ScrPowerUp(char *pATR, unsigned int *ATRLen, char *pResponse) [Parameters] * char *pATR [in, out] ATR(Answer To Reset) data * unsigned int *ATRLen [in, out] ATR data length * char *pResponse [in, out] Response to power up [Return Values]...
POS/Mobile Printer 3-34 ScrPowerDown Turn off the SCR. This function is only available on SPP-R210 SCR. long ScrPowerDown(char *pResponse); [Parameters] * char *pResponse [in, out] Response to power up [Return Values] Constant Value Description SUCCESS The function is successful. WRITE_ERROR -105 Data transmission failed.
POS/Mobile Printer 3-35 ScrOperationMode Set the operation mode. This function is only available on SPP-R210 SCR. long ScrOperationMode(uint mode, char *pResponse); [Parameters] * UINT mode [in] Operating mode. Constant Value Description SCR_MODE_APDU APDU mode SCR_MODE_TPDU TPDU mode * char *pResponse [in, out] Response to power up [Return Values] Constant...
POS/Mobile Printer 3-36 ScrExchangeAPDU Enable APDU/TPDU data communication. This function is only available on SPP-R210 SCR. long ScrExchangeAPDU (const char *APDUCmd, unsigned int APDULen, char *APDURsp, unsigned int *APDURspLen, char *pResponse); [Parameters] * const char *APDUCmd [in] APDU data command * unsigned int APDULen [in] APDU command length * char *APDURsp...
POS/Mobile Printer 3-37 ScrCheckStatus Check the smart card status. This function is only available on SPP-R210 SCR. long ScrCheckStatus (char *status, char *pResponse); [Parameters] * char *status [in, out] Smart card status data * char *pResponse [in, out] Response to the command [Return Values] Constant Value...
POS/Mobile Printer 3-38 ScrSelectCard Select Smart card, SAM1 and SAM2 for communication. This function is only available on SPP-R210 SCR. long ScrSelectCard (uint card, char *pResponse); [Parameters] * UINT card [in] Smart card for communication Constant Value Description SCR_SMARTCARD Set Smart card for communication. SCR_SAM1 Set SAM1 for communication.
Need help?
Do you have a question about the SRP-270 and is the answer not in the manual?
Questions and answers