com.starmicronics.stario
Class StarBluetoothManager

java.lang.Object
  extended by com.starmicronics.stario.StarBluetoothManager

public class StarBluetoothManager
extends java.lang.Object


Nested Class Summary
static class StarBluetoothManager.StarBluetoothSecurity
           
static class StarBluetoothManager.StarBluetoothSettingCapability
           
static class StarBluetoothManager.StarDeviceType
           
 
Constructor Summary
StarBluetoothManager(java.lang.String portName, java.lang.String portSettings, int timeoutMillis, StarBluetoothManager.StarDeviceType starDeviceType)
          The constructer of StarBluetoothManager
 
Method Summary
 void apply()
          This method is used in order to apply the value specified by the following methods.
- setBluetoothDevice method
- setiOSPortName method
- setAutoConnect method
- setPinCode method
- setSecurityType method
 void close()
          This method is used to close communication with the printer.
 boolean getAutoConnect()
          Gets the auto connection setting.
 StarBluetoothManager.StarBluetoothSettingCapability getAutoConnectCapability()
           
 java.lang.String getBluetoothDeviceName()
          Gets the BluetoothDeviceName.
 StarBluetoothManager.StarBluetoothSettingCapability getBluetoothDeviceNameCapability()
           
 StarBluetoothManager.StarDeviceType getDeviceType()
          Gets the Bluetooth device type at constructer.(StarDeviceTypeDesktopPrinter or StarDeviceTypePortablePrinter).
 java.lang.String getiOSPortName()
          Gets iOSPortName The current setting is read when the loadSetting method or setiOSPortName method is called.
Set see com.StarMicronics.stario.StarBluetoothManager#setiOSPortName(String)
 StarBluetoothManager.StarBluetoothSettingCapability getiOSPortNameCapability()
           
 boolean getPairingPermission()
           
 StarBluetoothManager.StarBluetoothSettingCapability getPairingPermissionCapability()
           
 java.lang.String getPinCode()
          Gets the PIN code The current setting is read when the loadSetting method or setPinCode method is called.
Set see com.StarMicronics.stario.StarBluetoothManager#setPinCode(String)
 StarBluetoothManager.StarBluetoothSettingCapability getPinCodeCapability()
           
 java.lang.String getPortName()
          Gets the specified port name at constructer.
 java.lang.String getPortSettings()
          Gets the specified port settings at constructer.
 StarBluetoothManager.StarBluetoothSecurity getSecurityType()
          Gets the Bluetooth security setting(SSP or PIN code mode).
 StarBluetoothManager.StarBluetoothSettingCapability getSecurityTypeCapability()
           
 int getTimeoutMillis()
          Gets the specified timeout at constructer.
 boolean isOpened()
          Returns whether the port is opened.
 void loadSetting()
          This method is used to load the Bluetooth device setting.
 void open()
          This method is used to open connection to the Star Bluetooth printer.
 void setAutoConnect(boolean autoConnect)
          Sets the auto connection setting.
 void setBluetoothDeviceName(java.lang.String bluetoothDeviceName)
          Sets the bluetoothDeviceName.
To set it, run the apply method after you change the values in the set method.
Get see com.StarMicronics.stario.StarBluetoothManager#getBluetoothDeviceName()
 void setiOSPortName(java.lang.String iOSPortName)
          Sets the iOSPortName To set it, run the apply method after you change the values in the set method.
Get see com.StarMicronics.stario.StarBluetoothManager#getiOSPortName()
 void setPairingPermission(boolean pairingPermission)
           
 void setPinCode(java.lang.String pinCode)
          Sets the PIN code of the Bluetooth interface.
Set to null when the PIN code is not changed.
Get see com.StarMicronics.stario.StarBluetoothManager#getPinCode()
 void setSecurityType(StarBluetoothManager.StarBluetoothSecurity securityType)
          Sets the Bluetooth security setting(SSP or PIN code mode).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StarBluetoothManager

public StarBluetoothManager(java.lang.String portName,
                            java.lang.String portSettings,
                            int timeoutMillis,
                            StarBluetoothManager.StarDeviceType starDeviceType)
                     throws StarIOPortException
The constructer of StarBluetoothManager

Parameters:
PortName - Identifies the printer to use
BlueTooth: Usage - BT: (finds and uses the first star BlueTooth printer paired with your device)
BT:DeviceName (eg, BT:StarMicronics)
BT:<MacAddress> (eg, BT:00:12:3F:1D:FB:7B)

PortSettings - The settings for the port
BlueToothSettings: "" - Using a POSprinter and DK-AirCash (No portSettings are required when using other Interface and "SSP" by Bluetooth Interface.)
";p" - Using a POSprinter and DK-AirCash(If use the "PIN Code" by Bluetooth Interface)
Examples: "", ";p"
timeoutMillis - The time out in milliseconds used when writing or reading from the port
starDeviceType - The type of the device to be connected
StarDeviceTypeDesktopPrinter
Throws:
StarIOPortException - - If starDeviceType sets StarDeviceTypePortablePrinter, if the portName do not sets "BT:".
Method Detail

open

public void open()
          throws StarIOPortException
This method is used to open connection to the Star Bluetooth printer.

Throws:
StarIOPortException - - If for some reason communication with the printer can't be established.

close

public void close()
           throws StarIOPortException
This method is used to close communication with the printer.

Throws:
StarIOPortException - - If for some reason communication with the printer can't be established.

apply

public void apply()
           throws StarIOPortException
This method is used in order to apply the value specified by the following methods.
- setBluetoothDevice method
- setiOSPortName method
- setAutoConnect method
- setPinCode method
- setSecurityType method

Throws:
StarIOPortException - - If for some reason communication with the printer can't be established, if the port is null, if when securityType set PINCODE, autoConnect set \"true\".

loadSetting

public void loadSetting()
                 throws StarIOPortException
This method is used to load the Bluetooth device setting.

Throws:
StarIOPortException - - If for some reason communication with the printer can't be established, if the port is null.

getBluetoothDeviceNameCapability

public StarBluetoothManager.StarBluetoothSettingCapability getBluetoothDeviceNameCapability()

getiOSPortNameCapability

public StarBluetoothManager.StarBluetoothSettingCapability getiOSPortNameCapability()

getPinCodeCapability

public StarBluetoothManager.StarBluetoothSettingCapability getPinCodeCapability()

getAutoConnectCapability

public StarBluetoothManager.StarBluetoothSettingCapability getAutoConnectCapability()

getSecurityTypeCapability

public StarBluetoothManager.StarBluetoothSettingCapability getSecurityTypeCapability()

getPairingPermissionCapability

public StarBluetoothManager.StarBluetoothSettingCapability getPairingPermissionCapability()

getBluetoothDeviceName

public java.lang.String getBluetoothDeviceName()
Gets the BluetoothDeviceName. The current setting is read when the loadSetting method cis called.
Set see setBluetoothDeviceName(String)

Returns:
A name of connected bluetooth device.

setBluetoothDeviceName

public void setBluetoothDeviceName(java.lang.String bluetoothDeviceName)
                            throws StarIOPortException
Sets the bluetoothDeviceName.
To set it, run the apply method after you change the values in the set method.
Get see com.StarMicronics.stario.StarBluetoothManager#getBluetoothDeviceName()

Parameters:
bluetoothDeviceName - to set device
Throws:
StarIOPortException - - If the parameter of bluetoothDeviceName is invalid character, if the length of bluetoothDeviceName is less than 1 and more than 16.
Valid characters
0-9 a-z A-Z ; : ! ? # $ % & , . @ _ - = Space / * + ~ ^ [ { ( ] } ) | \

getiOSPortName

public java.lang.String getiOSPortName()
Gets iOSPortName The current setting is read when the loadSetting method or setiOSPortName method is called.
Set see com.StarMicronics.stario.StarBluetoothManager#setiOSPortName(String)

Returns:
A name of port name to use iOS device

setiOSPortName

public void setiOSPortName(java.lang.String iOSPortName)
                    throws StarIOPortException
Sets the iOSPortName To set it, run the apply method after you change the values in the set method.
Get see com.StarMicronics.stario.StarBluetoothManager#getiOSPortName()

Parameters:
port - name to use iOS device
Throws:
StarIOPortException - - If the parameter of iOSPortName is invalid character, if the length of iOSPortName is less than 1 and more than 16.
Valid characters
0-9 a-z A-Z ; : ! ? # $ % & , . @ _ - = Space / * + ~ ^ [ { ( ] } ) | \

getPinCode

public java.lang.String getPinCode()
Gets the PIN code The current setting is read when the loadSetting method or setPinCode method is called.
Set see com.StarMicronics.stario.StarBluetoothManager#setPinCode(String)

Returns:
PIN code to use a pairing

setPinCode

public void setPinCode(java.lang.String pinCode)
                throws StarIOPortException
Sets the PIN code of the Bluetooth interface.
Set to null when the PIN code is not changed.
Get see com.StarMicronics.stario.StarBluetoothManager#getPinCode()

Parameters:
pinCode - to use pairing
Throws:
StarIOPortException - - If the parameter of pinCode is invalid character, if the length of pinCode is less than 4 and more than 16.
Valid characters
0-9 a-z A-Z

getAutoConnect

public boolean getAutoConnect()
Gets the auto connection setting. The current setting is read when the loadSetting method or setAutoConnect method is called.
Set see com.StarMicronics.stario.StarBluetoothManager#setAutoConnect(boolean)

Returns:
True if autoConnect function is on.

setAutoConnect

public void setAutoConnect(boolean autoConnect)
Sets the auto connection setting. The current setting is read when the loadSetting method is called.
Get see com.StarMicronics.stario.StarBluetoothManager#getAutoConnect()

Parameters:
autoConnet -

getSecurityType

public StarBluetoothManager.StarBluetoothSecurity getSecurityType()
Gets the Bluetooth security setting(SSP or PIN code mode). The current setting is read when the loadSetting method or setSecurityType method is called.
Set see com.StarMicronics.stario.StarBluetoothManager#setSecurityType(StarBluetoothSecurity)

Returns:
StarBluetoothManager.StarBluetoothSecurity.

setSecurityType

public void setSecurityType(StarBluetoothManager.StarBluetoothSecurity securityType)
Sets the Bluetooth security setting(SSP or PIN code mode). The current setting is read when the loadSetting method is called.
Get see com.StarMicronics.stario.StarBluetoothManager#getSecurityType()

Parameters:
StarBluetoothManager.StarBluetoothSecurity. -

getPortName

public java.lang.String getPortName()
Gets the specified port name at constructer. Get see com.StarMicronics.stario.StarBluetoothManager#StarBluetoothManager(String portName, String portSettings, int timeoutMillis, StarDeviceType starDeviceType)

Returns:
A port name to connect with device.

getPortSettings

public java.lang.String getPortSettings()
Gets the specified port settings at constructer. Get see com.StarMicronics.stario.StarBluetoothManager#StarBluetoothManager(String portName, String portSettings, int timeoutMillis, StarDeviceType starDeviceType)

Returns:
A port settings to connect with device.

getTimeoutMillis

public int getTimeoutMillis()
Gets the specified timeout at constructer. Get see com.StarMicronics.stario.StarBluetoothManager#StarBluetoothManager(String portName, String portSettings, int timeoutMillis, StarDeviceType starDeviceType)

Returns:
A timeout of connection with device.

getDeviceType

public StarBluetoothManager.StarDeviceType getDeviceType()
Gets the Bluetooth device type at constructer.(StarDeviceTypeDesktopPrinter or StarDeviceTypePortablePrinter). The current connection of device type.
Get see com.StarMicronics.stario.StarBluetoothManager#StarBluetoothManager(String portName, String portSettings, int timeoutMillis, StarDeviceType starDeviceType)

Returns:
A current StarBluetoothManager.StarDeviceType.

isOpened

public boolean isOpened()
Returns whether the port is opened. The current setting is read when the loadSetting method is called.
Get see com.StarMicronics.stario.StarBluetoothManager#open()

Returns:
True if the port is opened.

setPairingPermission

public void setPairingPermission(boolean pairingPermission)

getPairingPermission

public boolean getPairingPermission()