|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sourceforge.jcapi.Jcapi
Jcapi
is a Java wrapper for the CAPI.
It uses the Java Native Interface to load a platform
dependent shared library which gives access to the Common ISDN API
(CAPI20) shared library delivered whith the ISDN adapter device.
© 2002 Holger Gräfe
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Contact to author: holger.graefe@gmx.de
Project website: http://jcapi.sourceforge.net
Constructor Summary | |
Jcapi()
|
Method Summary | |
void |
addListener(int appID,
CapiListener listener)
adds the given reference to a List of CapiListeners that will be notified of CapiEvents for the given application ID. |
CapiMessage |
createMessage(byte[] msg)
constructs a new CapiMessage object from a binary message. |
CapiMessage |
createMessage(int appID,
int type,
int number)
constructs a new CapiMessage object. |
java.lang.String |
getImplementationInfo()
returns an information about the used implementation of this interface. |
java.lang.String |
getManufacturer()
CAPI 2.0 equivalent: CAPI_MANUFACTURER. |
java.lang.String |
getManufacturer(int controller)
CAPI 2.0 equivalent: CAPI_MANUFACTURER. |
CapiMessage |
getMessage(int appID)
CAPI 2.0 equivalent: CAPI_GET_MESSAGE. |
int |
getNewMessageNumber()
|
int |
getNumberOfControllers()
CAPI 2.0 equivalent: CAPI_GET_PROFILE with parameter 0. |
byte[] |
getProfile(int controller)
CAPI 2.0 equivalent: CAPI_GET_PROFILE with parameter <>0. |
java.lang.String |
getSerialNumber()
CAPI 2.0 equivalent: CAPI_GET_SERIAL_NUMBER. |
java.lang.String |
getSerialNumber(int controller)
CAPI 2.0 equivalent: CAPI_GET_SERIAL_NUMBER. |
int[] |
getVersion()
CAPI 2.0 equivalent: CAPI_GET_VERSION. |
int[] |
getVersion(int controller)
CAPI 2.0 equivalent: CAPI_GET_VERSION. |
boolean |
installed()
CAPI 2.0 equivalent: CAPI_INSTALLED. |
static void |
main(java.lang.String[] argv)
|
void |
putMessage(CapiMessage message)
CAPI 2.0 equivalent: CAPI_PUT_MESSAGE. |
int |
register()
calls the register method with default parameters. |
int |
register(int maxcon,
int maxblocks,
int maxlen)
calls the register method with a default bufsize
parameter. |
int |
register(int bufsize,
int maxcon,
int maxblocks,
int maxlen)
CAPI 2.0 equivalent: CAPI_REGISTER. |
void |
release(int appID)
CAPI 2.0 equivalent: CAPI_RELEASE. |
void |
removeListener(int appID,
CapiListener listener)
removes a CapiListener previously added with addListener(). |
void |
test()
|
void |
test(java.io.PrintWriter out)
|
void |
waitForSignal(int appID)
CAPI 2.0 equivalent: CAPI_WAIT_FOR_SIGNAL. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Jcapi()
Method Detail |
public boolean installed() throws CapiException
Capi
This method always returns a true value or even throws an exception if CAPI 2.0 is not installed correctly.
installed
in interface Capi
org.capi.capi20.Capi
public java.lang.String getManufacturer() throws CapiException
Capi
getManufacturer
in interface Capi
org.capi.capi20.Capi
public java.lang.String getManufacturer(int controller) throws CapiException
Capi
getManufacturer
in interface Capi
org.capi.capi20.Capi
controller
- the number of the controller requestedpublic java.lang.String getImplementationInfo()
Capi
getImplementationInfo
in interface Capi
org.capi.capi20.Capi
public java.lang.String getSerialNumber() throws CapiException
Capi
getSerialNumber
in interface Capi
org.capi.capi20.Capi
public java.lang.String getSerialNumber(int controller) throws CapiException
Capi
getSerialNumber
in interface Capi
org.capi.capi20.Capi
controller
- the number of the controller requestedpublic int[] getVersion() throws CapiException
Capi
getVersion
in interface Capi
org.capi.capi20.Capi
public int[] getVersion(int controller) throws CapiException
Capi
getVersion
in interface Capi
org.capi.capi20.Capi
controller
- the number of the controller requestedpublic CapiMessage createMessage(int appID, int type, int number) throws CapiException
Capi
createMessage
in interface Capi
org.capi.capi20.Capi
appID
- the application identification number assigned by register()type
- the message type, which correspond with the CAPI message fields
"command" and "subcommand"number
- the identification number of this messagepublic CapiMessage createMessage(byte[] msg) throws CapiException
Capi
createMessage
in interface Capi
org.capi.capi20.Capi
msg
- the binary CAPI 2.0 messagepublic int register() throws CapiException
register
method with default parameters.public int register(int maxcon, int maxblocks, int maxlen) throws CapiException
register
method with a default bufsize
parameter.register
in interface Capi
public int register(int bufsize, int maxcon, int maxblocks, int maxlen) throws CapiException
Capi
register
in interface Capi
org.capi.capi20.Capi
bufsize
- the size of the buffer, typical
bufsize = 1024 + (1024 * maxcon)
maxcon
- the maximum number of logical connectionsmaxblocks
- the maximum number of received data blocksmaxlen
- the maximum size of data block to be transmitted and receivedpublic void release(int appID) throws CapiException
Capi
release
in interface Capi
org.capi.capi20.Capi
appID
- the application identification number assigned by register()public int getNumberOfControllers() throws CapiException
Capi
getNumberOfControllers
in interface Capi
org.capi.capi20.Capi
public byte[] getProfile(int controller) throws CapiException
Capi
getProfile
in interface Capi
org.capi.capi20.Capi
controller
- the number of the controller; a value of 0 may cause an exceptionpublic void putMessage(CapiMessage message) throws CapiException
Capi
putMessage
in interface Capi
org.capi.capi20.Capi
appID
- the application identification number assigned by register()msg
- the CapiMessage to be sent to the CAPIpublic CapiMessage getMessage(int appID) throws CapiException
Capi
getMessage
in interface Capi
org.capi.capi20.Capi
appID
- the application identification number assigned by register()public void addListener(int appID, CapiListener listener)
Capi
addListener
in interface Capi
org.capi.capi20.Capi
appID
- the application identification number assigned by register()public void removeListener(int appID, CapiListener listener)
Capi
removeListener
in interface Capi
org.capi.capi20.Capi
appID
- the application identification number assigned by register()public void waitForSignal(int appID) throws CapiException
Capi
waitForSignal
in interface Capi
org.capi.capi20.Capi
appID
- the application identification number assigned by register()public int getNewMessageNumber()
public void test(java.io.PrintWriter out)
public void test()
public static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |