public class CellularDevice extends IPDevice
DigiPointDevice
,
DigiMeshDevice
,
Raw802Device
,
ThreadDevice
,
WiFiDevice
,
XBeeDevice
,
ZigBeeDevice
BROADCAST_IP
Constructor and Description |
---|
CellularDevice(IConnectionInterface connectionInterface)
Class constructor.
|
CellularDevice(String port,
int baudRate)
Class constructor.
|
CellularDevice(String port,
int baudRate,
int dataBits,
int stopBits,
int parity,
int flowControl)
Class constructor.
|
CellularDevice(String port,
SerialPortParameters serialPortParameters)
Class constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addSMSListener(ISMSReceiveListener listener)
Adds the provided listener to the list of listeners to be notified
when new SMS is received.
|
CellularAssociationIndicationStatus |
getCellularAssociationIndicationStatus()
Returns the current association status of this Cellular device.
|
XBeeIMEIAddress |
getIMEIAddress()
Returns the IMEI address of this Cellular device.
|
XBeeProtocol |
getXBeeProtocol()
Returns the XBee Protocol of this XBee device.
|
boolean |
isConnected()
Returns whether the device is connected to the Internet or not.
|
void |
open()
Opens the connection interface associated with this XBee device.
|
void |
readDeviceInfo()
Reads some parameters from this device and obtains its protocol.
|
void |
removeSMSListener(ISMSReceiveListener listener)
Removes the provided listener from the list of SMS listeners.
|
void |
sendSMS(String phoneNumber,
String data)
Sends the provided SMS message to the given phone number.
|
void |
sendSMSAsync(String phoneNumber,
String data)
Sends asynchronously the provided SMS to the given phone number.
|
addIPDataListener, getDestinationIPAddress, getIPAddress, readIPData, readIPData, readIPDataFrom, readIPDataFrom, removeIPDataListener, sendBroadcastIPData, sendIPData, sendIPData, sendIPDataAsync, sendIPDataAsync, setDestinationIPAddress, startListening, stopListening
addBluetoothDataListener, addDataListener, addIOSampleListener, addMicroPythonDataListener, addModemStatusListener, addPacketListener, addUserDataRelayListener, close, getNetwork, getNextFrameID, getOperatingMode, getReceiveTimeout, isOpen, isRemote, readData, readData, readDataFrom, readDataFrom, readPacket, readPacket, readPacketFrom, readPacketFrom, removeBluetoothDataListener, removeDataListener, removeIOSampleListener, removeMicroPythonDataListener, removeModemStatusListener, removePacketListener, removeUserDataRelayListener, reset, sendBluetoothData, sendBroadcastData, sendData, sendDataAsync, sendMicroPythonData, sendPacket, sendPacket, sendPacketAsync, sendUserDataRelay, setReceiveTimeout, toString
applyChanges, disableBluetooth, enableApplyConfigurationChanges, enableBluetooth, executeParameter, get16BitAddress, get64BitAddress, getADCValue, getBluetoothMacAddress, getConnectionInterface, getDestinationAddress, getDIOChangeDetection, getDIOValue, getFirmwareVersion, getHardwareVersion, getIOConfiguration, getIOSamplingRate, getIPv6Address, getIPv6DestinationAddress, getNodeID, getPANID, getParameter, getPowerLevel, getPWMDutyCycle, isApplyConfigurationChangesEnabled, readIOSample, setDestinationAddress, setDIOChangeDetection, setDIOValue, setIOConfiguration, setIOSamplingRate, setIPv6DestinationAddress, setNodeID, setPANID, setParameter, setPowerLevel, setPWMDutyCycle, updateBluetoothPassword, updateDeviceDataFrom, writeChanges
public CellularDevice(IConnectionInterface connectionInterface)
CellularDevice
object with
the given connection interface.connectionInterface
- The connection interface with the physical
Cellular device.NullPointerException
- if connectionInterface == null
CellularDevice(String, int)
,
CellularDevice(String, SerialPortParameters)
,
CellularDevice(String, int, int, int, int, int)
,
IConnectionInterface
public CellularDevice(String port, int baudRate)
CellularDevice
object in
the given port name and baud rate.port
- Serial port name where Cellular device is attached to.baudRate
- Serial port baud rate to communicate with the device.
Other connection parameters will be set as default (8
data bits, 1 stop bit, no parity, no flow control).IllegalArgumentException
- if baudRate < 0
.NullPointerException
- if port == null
.CellularDevice(IConnectionInterface)
,
CellularDevice(String, SerialPortParameters)
,
CellularDevice(String, int, int, int, int, int)
public CellularDevice(String port, int baudRate, int dataBits, int stopBits, int parity, int flowControl)
CellularDevice
object in
the given serial port name and settings.port
- Serial port name where Cellular device is attached to.baudRate
- Serial port baud rate to communicate with the device.dataBits
- Serial port data bits.stopBits
- Serial port data bits.parity
- Serial port data bits.flowControl
- Serial port data bits.IllegalArgumentException
- if baudRate < 0
or
if dataBits < 0
or
if stopBits < 0
or
if parity < 0
or
if flowControl < 0
.NullPointerException
- if port == null
.CellularDevice(IConnectionInterface)
,
CellularDevice(String, int)
,
CellularDevice(String, SerialPortParameters)
public CellularDevice(String port, SerialPortParameters serialPortParameters)
CellularDevice
object in
the given serial port name and parameters.port
- Serial port name where Cellular device is attached to.serialPortParameters
- Object containing the serial port parameters.NullPointerException
- if port == null
or
if serialPortParameters == null
.CellularDevice(IConnectionInterface)
,
CellularDevice(String, int)
,
CellularDevice(String, int, int, int, int, int)
,
SerialPortParameters
public void addSMSListener(ISMSReceiveListener listener)
AbstractXBeeDevice
If the listener has been already included this method does nothing.
listener
- Listener to be notified when new SMS is received.AbstractXBeeDevice.removeSMSListener(ISMSReceiveListener)
,
ISMSReceiveListener
public CellularAssociationIndicationStatus getCellularAssociationIndicationStatus() throws TimeoutException, XBeeException
It indicates occurrences of errors during the modem initialization and connection.
InterfaceNotOpenException
- if this device connection is not open.TimeoutException
- if there is a timeout getting the association
indication status.XBeeException
- if there is any other XBee related exception.CellularAssociationIndicationStatus
public XBeeIMEIAddress getIMEIAddress()
To refresh this value use the readDeviceInfo()
method.
XBeeIMEIAddress
public XBeeProtocol getXBeeProtocol()
AbstractXBeeDevice
To refresh this value use the AbstractXBeeDevice.readDeviceInfo()
method.
getXBeeProtocol
in class AbstractXBeeDevice
XBeeProtocol
public boolean isConnected() throws TimeoutException, XBeeException
true
if the device is connected to the Internet,
false
otherwise.InterfaceNotOpenException
- if this device connection is not open.TimeoutException
- if there is a timeout getting the association
indication status.XBeeException
- if there is any other XBee related exception.getCellularAssociationIndicationStatus()
,
CellularAssociationIndicationStatus
public void open() throws XBeeException
AbstractXBeeDevice
When opening the device an information reading process is automatically performed. This includes:
open
in class XBeeDevice
BluetoothAuthenticationException
- if there is any problem in the
Bluetooth authentication.XBeeException
- if there is any problem opening this device
connection.AbstractXBeeDevice.close()
,
AbstractXBeeDevice.isOpen()
public void readDeviceInfo() throws TimeoutException, XBeeException
AbstractXBeeDevice
This method refresh the values of:
readDeviceInfo
in class IPDevice
TimeoutException
- if there is a timeout reading the parameters.XBeeException
- if there is any error trying to read the device information or
if there is any other XBee related exception.AbstractXBeeDevice.get16BitAddress()
,
AbstractXBeeDevice.get64BitAddress()
,
AbstractXBeeDevice.getHardwareVersion()
,
AbstractXBeeDevice.getNodeID()
,
AbstractXBeeDevice.getFirmwareVersion()
,
AbstractXBeeDevice.getXBeeProtocol()
,
AbstractXBeeDevice.setNodeID(String)
public void removeSMSListener(ISMSReceiveListener listener)
AbstractXBeeDevice
If the listener was not in the list this method does nothing.
listener
- Listener to be removed from the list of listeners.AbstractXBeeDevice.addSMSListener(ISMSReceiveListener)
,
ISMSReceiveListener
public void sendSMS(String phoneNumber, String data) throws TimeoutException, XBeeException
This method blocks till a success or error response arrives or the configured receive timeout expires.
The receive timeout is configured using the setReceiveTimeout
method and can be consulted with getReceiveTimeout
method.
For non-blocking operations use the method
sendSMSAsync(String, String)
.
phoneNumber
- The phone number to send the SMS to.data
- String containing the text of the SMS.IllegalArgumentException
- if phoneNumber.length() > 20
or
if phoneNumber
is invalid.InterfaceNotOpenException
- if this device connection is not open.NullPointerException
- if phoneNumber == null
or
if data == null
.TimeoutException
- if there is a timeout sending the SMS.XBeeException
- if there is any other XBee related exception.XBeeDevice.getReceiveTimeout()
,
XBeeDevice.setReceiveTimeout(int)
,
sendSMSAsync(String, String)
public void sendSMSAsync(String phoneNumber, String data) throws TimeoutException, XBeeException
Asynchronous transmissions do not wait for answer or for transmit status packet.
phoneNumber
- The phone number to send the SMS to.data
- String containing the text of the SMS.IllegalArgumentException
- if phoneNumber.length() > 20
or
if phoneNumber
is invalid.InterfaceNotOpenException
- if this device connection is not open.NullPointerException
- if phoneNumber == null
or
if data == null
.TimeoutException
- if there is a timeout sending the SMS.XBeeException
- if there is any other XBee related exception.sendSMS(String, String)
© Copyright 2014 - 2024 Digi International Inc. All rights reserved.