4.8. StarIoExtManager

Always connect to the printer. Provides a real-time status acquisition function.

Important

Please use SM-S and SM-T series in Auto Power Down function “NO USE” setting (Default setting).

Warning

  • Only one instance should be used for a single printer.

  • When using an instance of this class from multiple threads, please use exclusive control.

4.8.1. StarIoExtManagerType

Manager type constants.

  • Declaration

    public enum StarIoExtManagerType : Int {
        case standard
        case withBarcodeReader
        case onlyBarcodeReader
    }
    
  • Constants

    Name

    Contents

    standard

    Management of the printer and the cash drawer.

    withBarcodeReader

    Management of the printer, cash drawer and the barcode reader.

    onlyBarcodeReader

    Management of the barcode reader.

4.8.2. StarIoExtManagerPrinterStatus

Printer status constants.

  • Declaration

    public enum StarIoExtManagerPrinterStatus : Int {
        case invalid
        case impossible
        case online
        case offline
    }
    
  • Constants

    Name

    Contents

    invalid

    Invalid.

    impossible

    Impossible to use printer.

    online

    Detect Printer online.

    offline

    Detect Printer offline.

4.8.3. StarIoExtManagerPrinterPaperStatus

Printer paper status constants.

  • Declaration

    public enum StarIoExtManagerPrinterPaperStatus : Int {
        case invalid
        case impossible
        case ready
        case nearEmpty
        case empty
    }
    
  • Constants

    Name

    Contents

    invalid

    Invalid.

    impossible

    Impossible to use printer.

    ready

    Detect Printer paper ready.

    nearEmpty

    Detect Printer paper near end.

    empty

    Detect Printer paper empty.

4.8.4. StarIoExtManagerPrinterCoverStatus

Printer cover status constants.

  • Declaration

    public enum StarIoExtManagerPrinterCoverStatus : Int {
        case invalid
        case impossible
        case open
        case close
    }
    
  • Constants

    Name

    Contents

    invalid

    Invalid.

    impossible

    Impossible to use printer.

    open

    Detect Printer cover open.

    close

    Detect Printer cover close.

4.8.5. StarIoExtManagerCashDrawerStatus

Cash drawer status constants.

  • Declaration

    public enum StarIoExtManagerCashDrawerStatus : Int {
        case invalid
        case impossible
        case open
        case close
    }
    
  • Constants

    Name

    Contents

    invalid

    Invalid.

    impossible

    Impossible to use Cash drawer.

    open

    Detect Cash drawer open.

    close

    Detect Cash drawer close.

4.8.6. StarIoExtManagerBarcodeReaderStatus

Barcode reader status constants.

  • Declaration

    public enum StarIoExtManagerBarcodeReaderStatus : Int {
        case invalid
        case impossible
        case connect
        case disconnect
    }
    
  • Constants

    Name

    Contents

    invalid

    Invalid.

    impossible

    Impossible to use Barcode reader.

    connect

    Detect Barcode reader connection.

    disconnect

    Detect Barcode reader disconnection.

4.8.7. port

SMPort object.

  • Declaration

    open var port: UnsafeMutablePointer<Int32>! { get }
    

4.8.8. lock

Exclusive access control object of communication by port property.

By using the lock property, an application can acquire a right to use the port property of StarIoExtManager class.

StarIoExtManager class starts monitoring printer status automatically after connect method is successfully complete.The printer status monitoring process uses the port property of StarIoExtManager class to communicate with a printer.If an application executes method of the port property during monitoring, the port property is used by two at the same time and method of the port property cannot work properly.

When an application executes lock() method of the lock property, StarIoExtManager class stops monitoring printer status, and the application regains a right to use the port property from StarIoExtManager class. As a result, the application can execute method of the port property properly.

After an application finishes using method of the port property, execute unlock() method of the lock property.StarIoExtManager class regains a right to use the port property from the application and resumes monitoring printer status.

  • Declaration

    open var lock: NSRecursiveLock! { get }
    

4.8.9. delegate

Delegate of the StarIoExtManager .

  • Declaration

    weak open var delegate: StarIoExtManagerDelegate!
    

4.8.10. printerStatus

Printer Online status.

  • Declaration

    open var printerStatus: StarIoExtManagerPrinterStatus { get }
    

4.8.11. printerPaperStatus

Printer paper status.

  • Declaration

    open var printerPaperStatus: StarIoExtManagerPrinterPaperStatus { get }
    

4.8.12. printerCoverStatus

Printer cover status.

  • Declaration

    open var printerCoverStatus: StarIoExtManagerPrinterCoverStatus { get }
    

4.8.13. cashDrawerStatus

Gets the cash drawer status.

  • Declaration

    open var cashDrawerStatus: StarIoExtManagerCashDrawerStatus { get }
    

4.8.14. barcodeReaderStatus

Barcode reader status.

  • Declaration

    open var barcodeReaderStatus: StarIoExtManagerBarcodeReaderStatus { get }
    

4.8.15. cashDrawerOpenActiveHigh

Mode of cash drawer open sensor active.

true … Active high. false … Active low.

  • Declaration

    open var cashDrawerOpenActiveHigh: Bool
    

4.8.16. initWithType

Initializes the StarIoExtManager .

  • Declaration

    public init!(type: StarIoExtManagerType, portName: String!, portSettings: String!, ioTimeoutMillis: UInt)
    
  • Parameter

    Name

    Contents

    Type

    type

    Manager type

    StarIoExtManagerType

    portName

    It is the same as the portName of the getPort method.

    String

    portSettings

    It is the same as the portSetting of the getPort method.

    String

    ioTimeoutMillis

    Acquires and specifies the timeout time for internal control and API (unit: millisecond)

    UInt

  • Return value

    Contents

    Type

    StarIoExtManager object

    StarIoExtManager

4.8.17. connectAsync

added in version 1.11.0

Management start.

This method is executed asynchronously, and the connection result is sent to the object that was set in the delegate property. If the connection with the printer was successful, the didConnectPort method is called. If the connection failed, the didFailToConnectPort method is called.

  • Declaration

    open func connectAsync()
    
  • Parameter

    None

  • Return value

    None

4.8.18. connect

Management start.

This method is executed synchronously.

  • Declaration

    open func connect() -> Bool
    
  • Parameter

    None

  • Return value

    Contents

    Type

    Result
    true … Success
    false … Failure

    Bool

4.8.19. disconnect

Management stop.

  • Declaration

    open func disconnect() -> Bool
    
  • Parameter

    None

  • Return value

    Contents

    Type

    Result
    true … Success
    false … Failure

    Bool