SwapModem.Type| Constructor and Description |
|---|
SerialModem(String port,
int baud) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(MessageListener l)
add a message listener to receive messages
|
void |
close()
disconnect and close the modem
|
int |
getBaud()
Get the serial speed this modem connects at
|
String |
getPort()
Get the name of the serial port used by this modem.
|
ModemSetup |
getSetup()
get the network setup
|
SwapModem.Type |
getType()
determine the type of virtual modem
|
boolean |
isOpen()
Check if the modem is open (connected to it's implementation device)
|
void |
open()
connect to the modem.
|
void |
removeListener(MessageListener l)
remove a listener
|
void |
send(SwapMessage msg)
send a message out onto the network
|
void |
setSetup(ModemSetup setup)
set the network setup
|
public SerialModem(String port, int baud)
public void open()
throws SwapException
SwapModemopen in interface SwapModemSwapException - Thrown if there is a problem opening the modem.public void close()
throws SerialException
SwapModemclose in interface SwapModemSerialExceptionpublic boolean isOpen()
SwapModempublic void send(SwapMessage msg) throws SerialException
SwapModemsend in interface SwapModemmsg - Message to send.SerialExceptionpublic void addListener(MessageListener l)
SwapModemaddListener in interface SwapModeml - listener to add.public void removeListener(MessageListener l)
SwapModemremoveListener in interface SwapModeml - listener to removepublic ModemSetup getSetup() throws SerialException
SwapModemgetSetup in interface SwapModemSerialExceptionpublic void setSetup(ModemSetup setup) throws SerialException
SwapModemsetSetup in interface SwapModemsetup - The modem setup to applySerialExceptionpublic SwapModem.Type getType()
SwapModempublic String getPort()
public int getBaud()
Copyright © 2015. All rights reserved.