Esempio n. 1
0
 /**
  * Adds the given Modem Status receive listener to the list of listeners
  * that will be notified when a modem status packet is received.
  *
  * <p>If the listener has been already added, this method does nothing.</p>
  *
  * @param listener Listener to be notified when new modem status packets are
  *                 received.
  *
  * @see #removeModemStatusReceiveListener(IModemStatusReceiveListener)
  * @see com.digi.xbee.api.listeners.IModemStatusReceiveListener
  */
 public void AddModemStatusReceiveListener(IModemStatusReceiveListener listener)
 {
     lock (modemStatusListeners)
     {
         if (!modemStatusListeners.Contains(listener))
         {
             modemStatusListeners.Add(listener);
         }
     }
 }
Esempio n. 2
0
 /**
  * Removes the given Modem Status receive listener from the list of Modem
  * Status receive listeners.
  *
  * <p>If the listener is not included in the list, this method does nothing.
  * </p>
  *
  * @param listener Modem Status receive listener to remove from the list.
  *
  * @see #addModemStatusReceiveListener(IModemStatusReceiveListener)
  * @see com.digi.xbee.api.listeners.IModemStatusReceiveListener
  */
 public void RemoveModemStatusReceiveListener(IModemStatusReceiveListener listener)
 {
     lock (modemStatusListeners)
     {
         if (modemStatusListeners.Contains(listener))
         {
             modemStatusListeners.Remove(listener);
         }
     }
 }
 /*
  * (non-Javadoc)
  * @see com.digi.xbee.api.AbstractXBeeDevice#removeModemStatusListener(com.digi.xbee.api.listeners.IModemStatusReceiveListener)
  */
 //@Override
 public new void removeModemStatusListener(IModemStatusReceiveListener listener)
 {
     base.removeModemStatusListener(listener);
 }
 /**
  * Class constructor. Instantiates a new {@code XBeeDevice} object
  * physically connected to the given port name and configured at the
  * provided baud rate.
  *
  * @param port Serial port name where XBee device is attached to.
  * @param 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).
  *
  * @throws ArgumentException if {@code baudRate < 0}.
  * @throws ArgumentNullException if {@code port == null}.
  *
  * @see #XBeeDevice(IConnectionInterface)
  * @see #XBeeDevice(String, SerialPortParameters)
  * @see #XBeeDevice(String, int, int, int, int, int)
  */
 public XBeeDevice(String port, int baudRate)
     : base(port, baudRate)
 {
     resetStatusListener = new CustomModemStatusReceiveListener(this);
 }
 /**
  * Class constructor. Instantiates a new {@code XBeeDevice} object with the
  * given connection interface.
  *
  * @param connectionInterface The connection interface with the physical
  *                            XBee device.
  *
  * @throws ArgumentNullException if {@code connectionInterface == null}.
  *
  * @see #XBeeDevice(String, int)
  * @see #XBeeDevice(String, SerialPortParameters)
  * @see #XBeeDevice(String, int, int, int, int, int)
  * @see com.digi.xbee.api.connection.IConnectionInterface
  */
 public XBeeDevice(IConnectionInterface connectionInterface)
     : base(connectionInterface)
 {
     resetStatusListener = new CustomModemStatusReceiveListener(this);
 }
 /*
  * (non-Javadoc)
  * @see com.digi.xbee.api.AbstractXBeeDevice#addModemStatusListener(com.digi.xbee.api.listeners.IModemStatusReceiveListener)
  */
 //@Override
 public new void AddModemStatusListener(IModemStatusReceiveListener listener)
 {
     base.AddModemStatusListener(listener);
 }
 /**
  * Class constructor. Instantiates a new {@code XBeeDevice} object
  * physically connected to the given port name and configured to communicate
  * with the provided serial settings.
  *
  * @param port Serial port name where XBee device is attached to.
  * @param serialPortParameters Object containing the serial port parameters.
  *
  * @throws ArgumentNullException if {@code port == null} or
  *                              if {@code serialPortParameters == null}.
  *
  * @see #XBeeDevice(IConnectionInterface)
  * @see #XBeeDevice(String, int)
  * @see #XBeeDevice(String, int, int, int, int, int)
  * @see com.digi.xbee.api.connection.serial.SerialPortParameters
  */
 public XBeeDevice(String port, SerialPortParameters serialPortParameters)
     : base(port, serialPortParameters)
 {
     resetStatusListener = new CustomModemStatusReceiveListener(this);
 }
 /**
  * Class constructor. Instantiates a new {@code XBeeDevice} object
  * physically connected to the given port name and configured to communicate
  * with the provided serial settings.
  *
  * @param port Serial port name where XBee device is attached to.
  * @param baudRate Serial port baud rate to communicate with the device.
  * @param dataBits Serial port data bits.
  * @param stopBits Serial port data bits.
  * @param parity Serial port data bits.
  * @param flowControl Serial port data bits.
  *
  * @throws ArgumentException if {@code baudRate < 0} or
  *                                  if {@code dataBits < 0} or
  *                                  if {@code stopBits < 0} or
  *                                  if {@code parity < 0} or
  *                                  if {@code flowControl < 0}.
  * @throws ArgumentNullException if {@code port == null}.
  *
  * @see #XBeeDevice(IConnectionInterface)
  * @see #XBeeDevice(String, int)
  * @see #XBeeDevice(String, SerialPortParameters)
  */
 public XBeeDevice(String port, int baudRate, int dataBits, StopBits stopBits, Parity parity, Handshake flowControl)
     : base(port, baudRate, dataBits, stopBits, parity, flowControl)
 {
     resetStatusListener = new CustomModemStatusReceiveListener(this);
 }
		/**
		 * Removes the provided listener from the list of Modem Status listeners.
		 * 
		 * <p>If the listener was not in the list this method does nothing.</p>
		 * 
		 * @param listener Listener to be removed from the list of listeners.
		 * 
		 * @throws ArgumentNullException if {@code listener == null}
		 * 
		 * @see #addModemStatusListener(IModemStatusReceiveListener)
		 * @see com.digi.xbee.api.listeners.IModemStatusReceiveListener
		 */
		protected void removeModemStatusListener(IModemStatusReceiveListener listener)
		{
			if (listener == null)
				throw new ArgumentNullException("Listener cannot be null.");
			if (dataReader == null)
				return;
			dataReader.RemoveModemStatusReceiveListener(listener);
		}
Esempio n. 10
0
 /**
  * Removes the given Modem Status receive listener from the list of Modem
  * Status receive listeners.
  *
  * <p>If the listener is not included in the list, this method does nothing.
  * </p>
  *
  * @param listener Modem Status receive listener to remove from the list.
  *
  * @see #addModemStatusReceiveListener(IModemStatusReceiveListener)
  * @see com.digi.xbee.api.listeners.IModemStatusReceiveListener
  */
 public void RemoveModemStatusReceiveListener(IModemStatusReceiveListener listener)
 {
     lock (modemStatusListeners)
     {
         if (modemStatusListeners.Contains(listener))
             modemStatusListeners.Remove(listener);
     }
 }
Esempio n. 11
0
 /**
  * Adds the given Modem Status receive listener to the list of listeners
  * that will be notified when a modem status packet is received.
  *
  * <p>If the listener has been already added, this method does nothing.</p>
  *
  * @param listener Listener to be notified when new modem status packets are
  *                 received.
  *
  * @see #removeModemStatusReceiveListener(IModemStatusReceiveListener)
  * @see com.digi.xbee.api.listeners.IModemStatusReceiveListener
  */
 public void AddModemStatusReceiveListener(IModemStatusReceiveListener listener)
 {
     lock (modemStatusListeners)
     {
         if (!modemStatusListeners.Contains(listener))
             modemStatusListeners.Add(listener);
     }
 }