3.9. StarBluetoothManager

Class to set Bluetooth settings

Warning

It can not be used with Port Class at the sime time.

Supported Method / Parameter for each model.

Model/Emulation

mC-Print2 mC-Print3 mPOP FVP10 TSP100IIIW TSP100IIIBITSP100LAN TSP650II TSP650IISK TSP700II TSP800IISM-S210i SM-S220i SM-S230i SM-T300i/T300 SM-T400i BSC10 SM-L200 SM-L300 SP700
StarPRNT StarPRNT StarPRNT StarLine StarGraphic StarGraphic StarGraphic StarLine StarLine StarLine StarLine StarPRNT EscPosMobile[1] StarPRNT EscPosMobile[1] StarPRNT EscPosMobile[1] StarPRNT EscPosMobile[1] StarPRNT EscPosMobile[1] EscPos StarPRNT StarPRNT StarDotImpact

ConnectAsync

- - -

LoadSettingAsync

- - -

DisconnectAsync

- - -

ApplyAsync

- - -

DeviceNameCapability

- - -

BluetoothDeviceName

- - -

iOSPortNameCapability

- - -

iOSPortName

- - - - -

PinCodeCapability

- - -

PinCode

- - - - - - -

AutoConnectCapability

- - -

AutoConnect

- - - - -

SecurityTypeCapability

- - -

SecurityType

- - - [2] - - - [2] [2] [2] [2] [3] [3] [3] [3] [3] [3] [3] [3] [3] [3] - [3] [3] [2]

PortName

- - -

PortSettings

- - -

Timeout

- - -

DeviceType

- - -

isOpened

- - -
[1]

F/W Version 3.0 or later is required.

[2]

The SecurityType that can be set and acquired is PIN code or SSP.

[3]

The SecurityType that can be set and retrieved is PIN code or Disable.

3.9.1. Bluetooth setting change flow using StarBluetoothManager

Using the StarBluetoothManager class, follow the steps below to change the printer’s Bluetooth settings.

../_images/bluetooth_flow.png
StarBluetoothManager starBluetoothManager = null;

try {
    // Get the StarBluetoothManager
    starBluetoothManager = StarBluetoothManagerFactory.GetManager(portName, portSettings, 30000, emulation);

    // Port open
    await starBluetoothManager.ConnectAsync();

    // Get Bluetooth Settings
    await starBluetoothManager.LoadSettingAsync();

    // Set of Bluetooth settings
    // Example) When setting the device name to "Star Micronics"
    starBluetoothManager.BluetoothDeviceName = "Star Micronics";

    // Apply Bluetooth settings
    await starBluetoothManager.ApplyAsync();
}
catch (Exception ex) {
    // Error
}
finally {
    if (starBluetoothManager.IsOpened) {
        try {
        // Port close
        await starBluetoothManager.DisconnectAsync();
        }
        catch (Exception ex) {}
    }
}

Refer to BluetoothSettingsSample.xaml.cs.

3.9.2. StarDeviceType

Constants of Printer Type.

  • Declaration

    public enum StarDeviceType {
        StarDeviceTypeDesktopPrinter,
        StarDeviceTypePortablePrinter
    }
    
  • Constants

    Name Contents
    StarDeviceTypeDesktopPrinter Desktop Printer
    StarDeviceTypePortablePrinter Portable Printer

Constant for each model.

Model

Emulation

Constants

mC-Print2 StarPRNT

StarDeviceTypePortablePrinter

mC-Print3 StarPRNT

StarDeviceTypePortablePrinter

mPOP StarPRNT

StarDeviceTypePortablePrinter

FVP10 StarLine

StarDeviceTypeDesktopPrinter

TSP100IIIBI StarGraphic

StarDeviceTypeDesktopPrinter

TSP650II StarLine

StarDeviceTypeDesktopPrinter

TSP650IISK StarLine

StarDeviceTypeDesktopPrinter

TSP700II StarLine

StarDeviceTypeDesktopPrinter

TSP800II StarLine

StarDeviceTypeDesktopPrinter

SM-S210i StarPRNT

StarDeviceTypePortablePrinter

EscPosMobile
SM-S220i StarPRNT

StarDeviceTypePortablePrinter

EscPosMobile
SM-S230i StarPRNT

StarDeviceTypePortablePrinter

EscPosMobile
SM-T300i/T300 StarPRNT

StarDeviceTypePortablePrinter

EscPosMobile
SM-T400i StarPRNT

StarDeviceTypePortablePrinter

EscPosMobile
SM-L200 StarPRNT

StarDeviceTypePortablePrinter

SM-L300 StarPRNT

StarDeviceTypePortablePrinter

SP700 StarDotImpact

StarDeviceTypeDesktopPrinter

3.9.3. StarBluetoothSecurity

Constants of Bluetooth security type.

  • Declaration

    public enum StarBluetoothSecurity {
        PINCODE,
        SSP,
        DISABLE
    }
    
  • Constants

    Name Contents
    PINCODE Security by entering PIN code
    SSP Security by pressing the interface card button
    DISABLE No security

3.9.4. StarBluetoothSettingCapability

Constants of enable / disable information of the Bluetooth setting.

  • Declaration

    public enum StarBluetoothSettingCapability {
        SUPPORT,
        NOSUPPORT
    }
    
  • Constants

    Name Contents
    SUPPORT Indicates the items and functions can be set for the printer that is currently connected.
    NOSUPPORT Indicates the items and functions can not be set for the printer that is currently connected.

3.9.5. DeviceNameCapability

The setting enable / disable information of the Bluetooth device name.

  • Declaration

    public StarBluetoothSettingCapability DeviceNameCapability { get; }
    

3.9.6. BluetoothDeviceName

The Bluetooth device name.

To change setting, execute the ApplyAsync method after this property changed.

  1. Valid characters

    0-9 a-z A-Z ; : ! ? # $ % & , . @ _ - = Space / * + ~ ^ [ { ( ] } ) | \

  2. Valid number of characters

    between 1 to 16 characters

  • Declaration

    public string BluetoothDeviceName { get; set; }
    

3.9.7. iOSPortNameCapability

The setting enable / disable information of the iOSPort name.

  • Declaration

    public StarBluetoothSettingCapability iOSPortNameCapability { get; }
    

3.9.8. iOSPortName

Acquires and specifies the iOS port name to be used with the StarIO for Bluetooth communication.

To change setting, execute the ApplyAsync method after this property changed.

  1. Valid characters

    0-9 a-z A-Z ; : ! ? # $ % & , . @ _ - = Space / * + ~ ^ [ { ( ] } ) | \

  2. Valid number of characters

    between 1 to 16 characters

  • Declaration

    public string iOSPortName { get; set; }
    

3.9.9. PinCodeCapability

The setting enable / disable information of the PIN code.

  • Declaration

    public StarBluetoothSettingCapability PinCodeCapability { get; }
    

3.9.10. PinCode

The PIN code.

It is not possible to acquire the current setting value.

To change setting, execute the ApplyAsync method after this property changed.

  1. Valid characters

    • 0-9 (SM-L200, SM-L300)
    • 0-9 a-z A-Z (other models)
  2. Valid number of characters

    • 4 characters (SM-L200, SM-L300)
    • between 4 to 16 characters (other models)
  • Declaration

    public string PinCode { get; set; }
    

3.9.11. AutoConnectCapability

The setting enable / disable information of the AutoConnection.

  • Declaration

    public StarBluetoothSettingCapability AutoConnectCapability { get; }
    

3.9.12. AutoConnect

Acquires and specifies the setting of the auto connection function.

To change setting, execute the ApplyAsync method after this property changed.

  • Declaration

    public bool AutoConnect { get; set; }
    

3.9.13. SecurityTypeCapability

The setting enable / disable information of the Bluetooth security type.

  • Declaration

    public StarBluetoothSettingCapability SecurityTypeCapability { get; }
    

3.9.14. SecurityType

Acquires and specifies the Bluetooth security setting.

To change setting, execute the ApplyAsync method after this property changed.

  • Declaration

    public StarBluetoothSecurity SecurityType { get; set; }
    

3.9.15. PortName

This method gets the port name specified by the constructor.

  • Declaration

    public string PortName { get; }
    

3.9.16. PortSettings

This method gets the port setting specified by the constructor.

  • Declaration

    public string PortSettings { get; }
    

3.9.17. Timeout

This method gets the TimeoutMillis specified by the constructor.

  • Declaration

    public Int32 Timeout { get; }
    

3.9.18. DeviceType

The type of the printer to be connected.

  • Declaration

    public StarDeviceType DeviceType { get; }
    

3.9.19. isOpened

Shows whether the port is opened.

  • Declaration

    public bool IsOpened
    

3.9.20. StarBluetoothManager

Creates the instance.

  • Declaration

    public StarBluetoothManager(string portName, string portSettings, int timeoutMillis, StarDeviceType starDeviceType)
    
  • Parameter

    Parameter Contents Type
    portName It is the same as the portName of the ConnectAsync method. string
    portSettings It is the same as the portSetting of the ConnectAsync method. string
    ioTimeoutMillis Timeout value for internal control and API. int
    starDeviceType Constants of Printer Type StarDeviceType

    Refer to StarDeviceType constant.

  • Return value

    Contents Type
    StarBluetoothManager object StarBluetoothManager

Refer to Bluetooth setting change flow using StarBluetoothManager about the procedure of change the Bluetooth Setting.

Note

StarBluetoothManagerFactory included in StarIO_Extension.winmd can get the appropriate StarBluetoothManager object for the printer emulation.

3.9.21. ConnectAsync

Opens a port for communicating with the printer.

Important

Get the current settings by LoadSettingAsync method after conducting open method.

  • Declaration

    public IAsyncOperation<bool> ConnectAsync()
    
  • Parameter

    None

  • Return value

    Contents Type
    succeeded or failure bool

Refer to Bluetooth setting change flow using StarBluetoothManager about the procedure of change the Bluetooth Setting.

3.9.22. LoadSettingAsync

Gets the value specified from the printer.

  • Declaration

    public IAsyncOperation<bool> LoadSettingAsync()
    
  • Parameter

    None

  • Return value

    Contents Type
    succeeded or failure bool

Refer to Bluetooth setting change flow using StarBluetoothManager about the procedure of change the Bluetooth Setting.

3.9.23. DisconnectAsync

Closes a port for communicating with the printer.

  • Declaration

    public IAsyncOperation<bool> DisconnectAsync()
    
  • Parameter

    None

  • Return value

    Contents Type
    succeeded or failure bool

Refer to Bluetooth setting change flow using StarBluetoothManager about the procedure of change the Bluetooth Setting.

3.9.24. ApplyAsync

Set the value specified by the following methods to the printer.

  • Declaration

    public IAsyncOperation<bool> ApplyAsync()
    
  • Parameter

    None

  • Return value

    Contents Type
    succeeded or failure bool

Refer to Bluetooth setting change flow using StarBluetoothManager about the procedure of change the Bluetooth Setting.