Troubleshooting guide

131
7: Creating connections
public void close()
{
closePort();
super.close();
}
}
public static void main(String[] args)
{
new BluetoothSerialPortDemo().enterEventDispatcher();
}
//constructor --------------------------------------------------------------
public BluetoothSerialPortDemo()
{
MainScreen mainScreen = new BluetoothDemoScreen();
mainScreen.setTitle(new LabelField(_resources.getString(TITLE),
LabelField.USE_ALL_WIDTH));
_infoField = new EditField(Field.READONLY);
mainScreen.add(_infoField);
pushScreen(mainScreen);
invokeLater(new Runnable() {
public void run() {
openPort();
}
});
}
// Close the serial port.
private void closePort() {
if (_bluetoothConnection != null) {
try {
_bluetoothConnection.close();
} catch(IOException ioe) {
}
}
if (_din != null) {
try {
_din.close();
} catch(IOException ioe) {
}
}
if (_dout != null) {
try {
_dout.close();
} catch(IOException ioe) {