Blackberry JAVA DEVELOPMENT ENVIRONMENT - - CRYPTOGRAPHIC SMART CARD DRIVER - DEVELOPMENT GUIDE Guida alla Risoluzione dei Problemi Pagina 132

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 286
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 131
132
BlackBerry Java Development Environment Development Guide
}
}
_bluetoothConnection = null;
_din = null;
_dout = null;
}
// Open the serial port.
private void openPort() {
if (_bluetoothConnection != null) {
closePort();
}
new InputThread().start();
}
private class InputThread extends Thread {
public void run() {
try {
BluetoothSerialPortInfo[] info = BluetoothSerialPort.getSerialPortInfo();
if( info == null || info.length == 0 ) {
invokeAndWait( new Runnable() {
public void run() {
Dialog.alert( “No bluetooth serial ports available for connection.” );
closePort();
System.exit(1);
}
});
}
_bluetoothConnection = (StreamConnection)Connector.open( info[0].toString(),
Connector.READ_WRITE );
_din = _bluetoothConnection.openDataInputStream();
_dout = _bluetoothConnection.openDataOutputStream();
} catch(IOException e) {
invokeAndWait( new Runnable() {
public void run() {
Dialog.alert(“Unable to open serial port”);
closePort();
System.exit(1);
}
});
} catch( UnsupportedOperationException e ) {
invokeAndWait( new Runnable() {
public void run() {
Dialog.alert(“This handheld or simulator does not support bluetooth.”);
closePort();
System.exit(1);
}
});
}
Vedere la pagina 131
1 2 ... 127 128 129 130 131 132 133 134 135 136 137 ... 285 286

Commenti su questo manuale

Nessun commento