net.java.sip.communicator.plugin.scphone
Class WinSCPhone

java.lang.Object
  extended by net.java.sip.communicator.plugin.scphone.SCPhone
      extended by net.java.sip.communicator.plugin.scphone.WinSCPhone

final class WinSCPhone
extends SCPhone

Add usb phone support for sc on the windows platform.


Field Summary
private  java.lang.Thread th
          Thread that runs native code which handle communication with the device
private static WinSCPhone thePhone
          Singleton instance of this class
 
Fields inherited from class net.java.sip.communicator.plugin.scphone.SCPhone
STATUS_OFF, STATUS_ON
 
Constructor Summary
private WinSCPhone()
          Not allowed to instantiate.
 
Method Summary
static SCPhone getPhone()
          Get singleton instance of the phone.
private  void initialize()
          Initialize the SCPhone by loading the native lib and running the message receiver and sender as a daemon.
private  void jni_init()
          Native init method.
 void jni_onAttach(int status)
          Set the SCPhone status.
 void jni_onPhoneMessage(java.lang.String message)
          This method gets called when the native lib has a message received.
private  void jni_sendMessage(java.lang.String message)
          Native send message method.
private  void jni_windowProc()
          Native event loop method.
protected  void sendCommand(java.lang.String command)
          Send a command to the phone.
 
Methods inherited from class net.java.sip.communicator.plugin.scphone.SCPhone
addSCPhoneListener, firePhoneCommandReceived, firePhoneCommandSent, fireStatusChanged, getStatus, removeSCPhoneListener, setStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

thePhone

private static WinSCPhone thePhone
Singleton instance of this class


th

private java.lang.Thread th
Thread that runs native code which handle communication with the device

Constructor Detail

WinSCPhone

private WinSCPhone()
Not allowed to instantiate. Use SCPhone.getPhone() method instead.

Method Detail

getPhone

public static SCPhone getPhone()
Get singleton instance of the phone.

Returns:
instance.

initialize

private void initialize()
Initialize the SCPhone by loading the native lib and running the message receiver and sender as a daemon.


jni_onAttach

public void jni_onAttach(int status)
Set the SCPhone status. This method will be called by the native lib, when the phone gets ready.

Parameters:
status - The new status.

jni_onPhoneMessage

public void jni_onPhoneMessage(java.lang.String message)
This method gets called when the native lib has a message received.

Parameters:
message - The received message.

sendCommand

protected void sendCommand(java.lang.String command)
Send a command to the phone.

Specified by:
sendCommand in class SCPhone
Parameters:
command - The command to send.

jni_init

private void jni_init()
Native init method.


jni_windowProc

private void jni_windowProc()
Native event loop method.


jni_sendMessage

private void jni_sendMessage(java.lang.String message)
Native send message method.

Parameters:
message - The message to send.