|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IBluetoothSerialPortProfile
ESF bluetooth serial port profile agent interface. This interface is used to control the SPP agent.
Use the IBluetoothSppFactory.getSerialPortProfileAgent method to obtain a reference to a new SPP agent interface.
Method Summary | |
---|---|
boolean |
isConnected()
Reports whether the ESF serial port profile agent is currently connected to a bluetooth device. |
void |
setCacheUrl(boolean cacheUrl)
Instructs the serial port profile agent whether to re-scan for bluetooth devices when a connection is needed. |
void |
setConnectionRetrySeconds(int seconds)
Sets the pause interval after a connection attempt fails. |
void |
setDeviceIdentifier(java.lang.String deviceIdentifier)
Sets the identification string to be used for device scan matching. |
void |
setListener(IBluetoothSppListener listener)
Sets the callback event handler for receiving notifications from the ESF serial port profile agent. |
void |
setPinCode(java.lang.String pinCode)
Sets the Bluetooth pin code required by a bluetooth device. |
boolean |
startAgent()
Instructs the ESF serial port profile agent to start the worker thread. |
void |
stopAgent()
Instructs the ESF serial port profile agent to stop the worker thread. |
void |
writeBytes(byte[] data)
If the serial port profile agent is connected to a bluetooth device, then this method will write an array of bytes to the Stream to the device. |
Method Detail |
---|
void setDeviceIdentifier(java.lang.String deviceIdentifier)
Note: This setter should be called prior to starting the agent (startAgent).
deviceIdentifier
- device identifier string.void setConnectionRetrySeconds(int seconds)
Note: This setter should be called prior to starting the agent (startAgent).
seconds
- Number of seconds to delay between connection attempts.void setCacheUrl(boolean cacheUrl)
If this parameter is true, then the agent will perform device discovery until a matching device is located. For subsequent connections, the agent will reuse the last known device URL.
If this parameter is false, then the agent will never cache a last known bluetooth device URL. If a connection is lost, then the agent will perform a new device scan.
An application would use false in case various physical devices may come within range. In that case, the agent will connect to any device within range. The application would use false for the case where only a single device will ever be within connection range. In that case, the URL should never change, and reconnection may be faster since a rescan is not performed.
Note: This setter should be called prior to starting the agent (startAgent).
cacheUrl
- true to use the last known good device URL for subsequent
connections.void setPinCode(java.lang.String pinCode)
Note: This setter should be called prior to starting the agent (startAgent).
pinCode
- device pin code.void setListener(IBluetoothSppListener listener)
Note: This setter should be called prior to starting the agent (startAgent).
listener
- reference to class instance that implements the
IBluetoothSppListener interface.boolean startAgent()
void stopAgent()
boolean isConnected()
void writeBytes(byte[] data)
data
- data buffer to write to the bluetooth device.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |