API User Guide
The StarXpand SDK provides you with useful APIs to control the printer and POS peripheral devices.
Embed the StarIO10 library to your application and call it in combination with a necessary API according to the description page of each function.
API Reference List by Function
For how to embed the StarIO10 library to an application, refer to the following URL.
https://github.com/star-micronics/react-native-star-io10/blob/master/README.md#installation
Search for Printer
Use StarDeviceDiscoveryManager to asynchronously search for the printer.
For the description using the sample code, see here.
Create printing data in Step 1 and send it to the printer in Step 2.
Select the necessary function in each step and refer to the description using the sample code on the link destination.
Step 1 Generate Printing Data
Standard function
Combine basic functions
to generate printing data.
Page mode function
Specify the page orientation and use borders
to generate printing data.
Template Printing Function
Generate print data by separating the template that defines the layout and the field data that defines the printed content.
* Please refer to the many print data samples in the SDK.
Step 2 Send Printing Data
Use Cash Drawer
Open and close the cash drawer connected to the printer.
For the description using the sample code, see here.
Acquire Printer Status
Acquire the printer status (example: paper present / not present).
To acquire the status, use the getStatus method of the StarPrinter class.
Refer to the sample contained in the SDK as well.
You can also use an event-based API.
When the printer status changes, the PrinterDelegate class methods are called.
Refer to the sample contained in the SDK as well.
Use Barcode Reader
Use an event-based API to get the data read by the barcode reader.
When the barcode is read, the onDataReceived method of the InputDeviceDelegate class is called, and the barcode data can be obtained.
Refer to the sample contained in the SDK as well.
Use Customer Display
Generate the control data of the customer display, and then send it to the printer.
To generate the control data, use the DisplayBuilder class.
For how to send the control data, refer to Print Step 2.
Use Buzzer
Generate the control data of the buzzer, and then send it to the printer.
To generate the control data, use the BuzzerBuilder class.
For how to send the control data, refer to Print Step 2.
Use Melody Speaker
Generate the control data of the melody speaker, and then send it to the printer.
To generate the control data, use the MelodySpeakerBuilder class.
For how to send the control data, refer to Print Step 2.
Acquire Connection Status of Peripherals
Use an event-based API to acquire the connection status of peripherals.
When the connection status of an input device (barcode reader) changes, the InputDeviceDelegate class methods are called. When the connection status of the customer display changes, the DisplayDelegate class methods are called.
Refer to the sample contained in the SDK as well.
Obtain Logs
Obtain the logs of StarIO10 library API call information and transmission data.
To obtain the logs, use the StarIO10Logger class.
API Reference by Function
Communication API
- StarPrinter
- The class that controls the printer
- StarConnectionSettings
- The class that defines the settings for connecting to a device
- StarPrinterInformation
- The class that defines the printer information
- StarPrinterInformationDetail
- The class that defines the printer detailed information
- StarPrinterInformationLan
- The class that defines the printer communication information for LAN
- StarPrinterInformationBluetooth
- The class that defines the printer communication information for Bluetooth
- StarPrinterInformationBluetoothLE
- The class that defines the printer communication information for BluetoothLE
- StarPrinterInformationUsb
- The class that defines the printer communication information for USB
- StarPrinterStatus
- The class that defines the printer status
- StarPrinterStatusDetail
- The class that defines the detailed printer status
- StarSpoolJobSettings
- The class that defines the print job settings
- StarSpoolJobStatus
- The class that defines the print job status
- InterfaceType
- Interface type
- StarPrinterEmulation
- Printer emulation
- StarPrinterModel
- Printer model
- SpoolJobState
- State of print job
- SpoolJobReceivedInterface
- Interface on which the printer has accepted this print job
- DrawerOpenedMethod
- Method for opening cash drawer
Search API
- StarDeviceDiscoveryManager
- The class for discovering devices
- StarDeviceDiscoveryManagerFactory
- The class that creates a StarDeviceDiscoveryManager object
Event API
- PrinterDelegate
- The class that defines the printer status event
- DrawerDelegate
- The class that defines the status event for the cash drawer
- InputDeviceDelegate
- The class that defines the status event of an input device (such as Barcode Reader)
- DisplayDelegate
- The class that defines the status event for the customer display
Log API
- StarIO10Logger
- The class that controls the log
Error API
- StarIO10Error
- The error class that is thrown by the API for this library
- StarIO10ArgumentError
- The error class that is thrown when an invalid argument is specified
- StarIO10BadResponseError
- The error class that is thrown when the response from a device is invalid
- StarIO10CommunicationError
- The error class that is thrown when a communication error occurs
- StarIO10IllegalDeviceStateError
- The error class that is thrown when the status of a host device is invalid
- StarIO10InUseError
- The error class that is thrown when the target device is in use
- StarIO10InvalidOperationError
- The error class that is thrown when an invalid operation is executed
- StarIO10NotFoundError
- The error class that is thrown when the target device is not found
- StarIO10UnknownError
- The error class that is thrown when an unknown error occurs
- StarIO10UnprintableError
- The error class that is thrown when a printer is unprintable
- StarIO10UnsupportedModelError
- The error class that is thrown when the target device is not supported
- StarIO10AuthenticationError
- The error class that is thrown when the authentication is failed
- StarIO10ErrorCode
- StarIO10Error error code
- StarIO10ErrorDetail
- The class that defines the error detailed information
Printing Data/Control Data Generation APIs
- StarXpandCommandBuilder
- The class that creates StarXpandCommand
- DocumentBuilder
- The class that creates StarXpandCommand for a document
- PreSettingBuilder
- The class that creates StarXpandCommand for a pre-setting
- MagnificationParameter
- Magnification setting parameters
- TemplateExtensionParameter
- Template print extension setting parameters on the template side
- StarXpandCommand
- It provides a human readable command generation function to control printers and their peripherals.
Printer
- PrinterBuilder
- The class that creates StarXpandCommand for a printer
- PageModeBuilder
- The class that creates StarXpandCommand for page mode
- Printer
- List of printer control parameters used in PrinterBuilder
- Alignment
- Alignment
- AmbiguousCharacterWidthType
- 1-byte/2-byte setting for Unicode fuzzy characters
- BarcodeBarRatioLevel
- Ratio level of the barcode bar
- BarcodeSymbology
- Barcode symbol
- BlackMarkPosition
- Black mark position
- CharacterEncodingType
- Character encoding
- CjkCharacterType
- Character encoding
- CutType
- Paper cut type
- FontType
- Font Type
- InternationalCharacterType
- International characters
- Pdf417Level
- PDF417 ECC (security level)
- QRCodeLevel
- Error correction level for QR code
- QRCodeModel
- QR code model
- TextAlignment
- A value indicating alignment for the function specifying the number of characters
- TextEllipsizeType
- Omission method for the function specifying the number of characters
- TextPrintType
- Print method for the function specifying the number of characters
- TextWidthType
- 1-byte/2-byte setting for the function specifying the number of characters
- BarcodeParameter
- Barcode setting parameters
- BlackMarkParameter
- Black mark setting parameters
- HoldPrintParameter
- Hold print setting parameters
- ImageParameter
- Image setting parameters
- LabelParameter
- Label setting parameters
- LogoParameter
- Logo setting parameters
- Pdf417Parameter
- PDF417 setting parameters
- QRCodeParameter
- QR code setting parameters
- RuledLineParameter
- Horizontal line setting parameters
- LineStyle
- Line style
- PageModeAreaParameter
- Printing area setting parameters in page mode
- PageModeImageParameter
- Image setting parameters in page mode
- PageModePrintDirection
- Print direction in page mode
- PageModeRectangleParameter
- Rectangle setting parameters in page mode
- PageModeRuledLineParameter
- Ruled line setting parameters in page mode
- PrinterParameter
- Setting parameters for the entire PrinterBuilder
- PageModeParameter
- Setting parameters for the entire PageModeBuilder
- TextParameter
- Text setting parameters
- TextWidthParameter
- Setting parameters for the function specifying the number of characters
Cash drawer
- DrawerBuilder
- The class that creates StarXpandCommand for a cash drawer
- Drawer
- List of drawer control parameters used in DrawerBuilder
- Channel
- Cash drawer channel
- OpenParameter
- Cash drawer open setting parameters
Buzzer
- BuzzerBuilder
- The class that creates StarXpandCommand for a buzzer
- Buzzer
- List of buzzer control parameters used in BuzzerBuilder
- Channel
- Buzzer channel
- DriveParameter
- Buzzer drive setting parameters
Melody speaker
- MelodySpeakerBuilder
- The class that creates StarXpandCommand for a melody speaker (mC-Sound)
- MelodySpeaker
- List of melody speaker control parameters used in MelodySpeakerBuilder
- SoundStorageArea
- Sound storage area
- DriveRegisteredSoundParameter
- Registered sound playback setting parameters
- DriveOneTimeSoundParameter
- Received data playback setting parameters
Display
- DisplayBuilder
- The class that creates StarXpandCommand for a customer display
- Display
- List of display control parameters used in DisplayBuilder
- CharacterEncodingType
- Character encoding
- Contrast
- Contrast value
- CursorState
- Cursor state
- InternationalCharacterType
- International characters
- ImageParameter
- Image setting parameters
- PositionParameter
- Position parameters
Presenter
- PresenterSettingBuilder
- The class that creates StarXpandCommand for a presenter setting
- Presenter
- List of presenter control parameters used in PresenterSettingBuilder
- LedType
- LED operating condition
- LedAutomaticBlinkParameter
- LED auto-blink setting parameters
- ModeParameter
- Presenter operation setting parameters
Bezel
- BezelSettingBuilder
- The class that creates StarXpandCommand for a bezel setting
- Bezel
- List of bezel control parameters used in BezelSettingBuilder
- LedType
- LED operating condition
- LedAutomaticBlinkParameter
- LED auto-blink setting parameters