public class BluetoothServer
extends java.lang.Thread
Constructor and Description |
---|
BluetoothServer(java.lang.String serviceName,
BtListener listener)
Same as BluetoothServer(String serviceName, BtListener listener, false)
(no verbose).
|
BluetoothServer(java.lang.String serviceName,
BtListener listener,
boolean isVerbose)
Creates a server instance with given serviceName.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancel the blocking acceptAndOpen().
|
void |
close()
Closes the opened input and output stream.
|
java.lang.String |
getLocalName()
Returns the Bluetooth friendly name of the local device.
|
void |
run()
For internal use only.
|
void |
setVerbose(boolean isVerbose)
Sets the verbose mode on/off.
|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public BluetoothServer(java.lang.String serviceName, BtListener listener, boolean isVerbose)
serviceName
- the name of the service to installlistener
- the BtListener to get connnect informationisVerbose
- if true, log information are sent to a VerboseWriterpublic BluetoothServer(java.lang.String serviceName, BtListener listener)
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void cancel()
public void close()
public void setVerbose(boolean isVerbose)
isVerbose
- if true, verbose mode is on, otherwise verbose mode is offpublic java.lang.String getLocalName()