3.8. StarBluetoothManager

Class to set Bluetooth settings

Warning

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

  • Method

    Name

    Contents

    Open

    Opens a port for communicating with the printer.

    LoadSetting

    Gets the value specified from the printer.

    Close

    Closes a port for communicating with the printer.

    Apply

    Set the specified value to the printer

Supported Method / Parameter for each model.

Model/Emulation

mC-Print2 mC-Print3 mPOP FVP10 TSP100IIIW TSP100IIIBITSP100IIIU TSP100ECO TSP100U TSP100GTTSP100LAN 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 StarGraphic 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

Open

- - - - - - -

LoadSetting

- - - - - - -

Close

- - - - - - -

Apply

- - - - - - -

BluetoothDeviceNameCapability

- - - - - - -

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.8.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 bluetoothManager = StarBluetoothManagerFactory.GetManager("BT:COM1", "", 10000, Emulation.StarLine)

try
{
    // Port open
    bluetoothManager.Open();

    // Get Bluetooth Settings
    bluetoothManager.LoadSetting();

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

   // Apply Bluetooth settings
     bluetoothManager.Apply();
}
catch(PortException)
{
    // Error
}
finally
{
    // Port close
    bluetoothManager.Close():
}

Refer to BluetoothSettingSamplePage.xaml.cs.

3.8.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.8.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.8.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.8.5. BluetoothDeviceNameCapability

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

  • Declaration

    public StarBluetoothSettingCapability BluetoothDeviceNameCapability { get; }
    

3.8.6. BluetoothDeviceName

The Bluetooth device name.

To change setting, execute the Apply 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.8.7. iOSPortNameCapability

The setting enable / disable information of the iOSPort name.

  • Declaration

    public StarBluetoothSettingCapability iOSPortNameCapability { get; }
    

3.8.8. iOSPortName

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

To change setting, execute the Apply 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.8.9. PinCodeCapability

The setting enable / disable information of the PIN code.

  • Declaration

    public StarBluetoothSettingCapability PinCodeCapability { get; }
    

3.8.10. PinCode

The PIN code.

It is not possible to acquire the current setting value.

To change setting, execute the Apply 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.8.11. AutoConnectCapability

The setting enable / disable information of the AutoConnection.

  • Declaration

    public StarBluetoothSettingCapability AutoConnectCapability { get; }
    

3.8.12. AutoConnect

Acquires and specifies the setting of the auto connection function.

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

  • Declaration

    public bool AutoConnect { get; set; }
    

3.8.13. SecurityTypeCapability

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

  • Declaration

    public StarBluetoothSettingCapability SecurityTypeCapability { get; }
    

3.8.14. SecurityType

Acquires and specifies the Bluetooth security setting.

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

  • Declaration

    public StarBluetoothSecurity SecurityType { get; set; }
    

3.8.15. PortName

This method gets the port name specified by the constructor.

  • Declaration

    public string PortName { get; }
    

3.8.16. PortSettings

This method gets the port setting specified by the constructor.

  • Declaration

    public string PortSettings { get; }
    

3.8.17. Timeout

This method gets the TimeoutMillis specified by the constructor.

  • Declaration

    public int TimeoutMillis { get; }
    

3.8.18. DeviceType

The type of the printer to be connected.

  • Declaration

    public StarDeviceType DeviceType { get; }
    

3.8.19. isOpened

Shows whether the port is opened.

  • Declaration

    public bool IsOpened
    

3.8.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 GetPort method. string
    portSettings It is the same as the portSetting of the GetPort 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 StarIOExtension.dll can get the appropriate StarBluetoothManager object for the printer emulation.

3.8.21. Open

Opens a port for communicating with the printer.

Important

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

  • Declaration

    public void Open()
    
  • Parameter

    None

  • Return value

    None

  • Exception

    Contents Type
    when a communication failure occurs PortException

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

3.8.22. LoadSetting

Gets the value specified from the printer.

  • Declaration

    public void LoadSetting()
    
  • Parameter

    None

  • Return value

    None

  • Exception

    Contents Type
    when a communication failure occurs PortException

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

3.8.23. Close

Closes a port for communicating with the printer.

  • Declaration

    public void Close()
    
  • Parameter

    None

  • Return value

    None

  • Exception

    Contents Type
    when a communication failure occurs PortException

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

3.8.24. Apply

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

  • Declaration

    public void Apply()
    
  • Parameter

    None

  • Return value

    None

  • Exception

    Contents Type
    when a communication failure occurs PortException

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