Skip to content

Commit 8907d05

Browse files
committed
cellular: remove deprecated tag from some methods whose functionality
has been implemented in latest firmware versions Signed-off-by: Ruben Moral <Ruben.Moral@digi.com>
1 parent 04c473b commit 8907d05

File tree

6 files changed

+32
-250
lines changed

6 files changed

+32
-250
lines changed

examples/io/LocalADCSample/ReadMe.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
Compatible protocols
3131
--------------------
3232
* 802.15.4
33+
* Cellular
3334
* DigiMesh
3435
* Point-to-Multipoint
3536
* Wi-Fi

examples/io/LocalDIOSample/ReadMe.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
Compatible protocols
3535
--------------------
3636
* 802.15.4
37+
* Cellular
3738
* DigiMesh
3839
* Point-to-Multipoint
3940
* Wi-Fi

library/src/main/java/com/digi/xbee/api/CellularDevice.java

Lines changed: 22 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@
2828
import com.digi.xbee.api.exceptions.XBeeDeviceException;
2929
import com.digi.xbee.api.exceptions.XBeeException;
3030
import com.digi.xbee.api.io.IOLine;
31-
import com.digi.xbee.api.io.IOMode;
32-
import com.digi.xbee.api.io.IOSample;
33-
import com.digi.xbee.api.io.IOValue;
31+
import com.digi.xbee.api.listeners.IIOSampleReceiveListener;
3432
import com.digi.xbee.api.listeners.ISMSReceiveListener;
33+
import com.digi.xbee.api.models.AssociationIndicationStatus;
3534
import com.digi.xbee.api.models.CellularAssociationIndicationStatus;
3635
import com.digi.xbee.api.models.PowerLevel;
3736
import com.digi.xbee.api.models.XBee64BitAddress;
@@ -348,55 +347,44 @@ public CellularAssociationIndicationStatus getCellularAssociationIndicationStatu
348347
}
349348

350349
/**
351-
* @deprecated Cellular protocol does not have an associated 64-bit address.
350+
* @deprecated Operation not supported in Cellular protocol. Use
351+
* {@link #getCellularAssociationIndicationStatus()} instead.
352+
* This method will raise an
353+
* {@link UnsupportedOperationException}.
352354
*/
353355
@Override
354-
public XBee64BitAddress get64BitAddress() {
355-
// Cellular protocol does not have 64-bit address.
356-
return null;
357-
}
358-
359-
/**
360-
* @deprecated Operation not supported in Cellular protocol. This method
361-
* will raise an {@link UnsupportedOperationException}.
362-
*/
363-
@Override
364-
public int getADCValue(IOLine ioLine) throws TimeoutException,
365-
XBeeException {
356+
protected AssociationIndicationStatus getAssociationIndicationStatus()
357+
throws TimeoutException, XBeeException {
366358
// Not supported in Cellular.
367359
throw new UnsupportedOperationException(OPERATION_EXCEPTION);
368360
}
369361

370362
/**
371-
* @deprecated Operation not supported in Cellular protocol. This method
372-
* will raise an {@link UnsupportedOperationException}.
363+
* @deprecated Cellular protocol does not have an associated 64-bit address.
373364
*/
374365
@Override
375-
public Set<IOLine> getDIOChangeDetection() throws TimeoutException,
376-
XBeeException {
377-
// Not supported in Cellular.
378-
throw new UnsupportedOperationException(OPERATION_EXCEPTION);
366+
public XBee64BitAddress get64BitAddress() {
367+
// Cellular protocol does not have 64-bit address.
368+
return null;
379369
}
380370

381371
/**
382-
* @deprecated Operation not supported in Cellular protocol. This method
383-
* will raise an {@link UnsupportedOperationException}.
372+
* @deprecated Operation not supported in this protocol. This method will
373+
* raise an {@link UnsupportedOperationException}.
384374
*/
385375
@Override
386-
public void setDIOChangeDetection(Set<IOLine> lines)
387-
throws TimeoutException, XBeeException {
388-
// Not supported in Cellular.
376+
public void addIOSampleListener(IIOSampleReceiveListener listener) {
377+
// Not supported in IP modules.
389378
throw new UnsupportedOperationException(OPERATION_EXCEPTION);
390379
}
391380

392381
/**
393-
* @deprecated Operation not supported in Cellular protocol. This method
394-
* will raise an {@link UnsupportedOperationException}.
382+
* @deprecated Operation not supported in this protocol. This method will
383+
* raise an {@link UnsupportedOperationException}.
395384
*/
396385
@Override
397-
public IOValue getDIOValue(IOLine ioLine) throws TimeoutException,
398-
XBeeException {
399-
// Not supported in Cellular.
386+
public void removeIOSampleListener(IIOSampleReceiveListener listener) {
387+
// Not supported in IP modules.
400388
throw new UnsupportedOperationException(OPERATION_EXCEPTION);
401389
}
402390

@@ -405,18 +393,7 @@ public IOValue getDIOValue(IOLine ioLine) throws TimeoutException,
405393
* will raise an {@link UnsupportedOperationException}.
406394
*/
407395
@Override
408-
public void setDIOValue(IOLine ioLine, IOValue ioValue)
409-
throws TimeoutException, XBeeException {
410-
// Not supported in Cellular.
411-
throw new UnsupportedOperationException(OPERATION_EXCEPTION);
412-
}
413-
414-
/**
415-
* @deprecated Operation not supported in Cellular protocol. This method
416-
* will raise an {@link UnsupportedOperationException}.
417-
*/
418-
@Override
419-
public IOMode getIOConfiguration(IOLine ioLine) throws TimeoutException,
396+
public Set<IOLine> getDIOChangeDetection() throws TimeoutException,
420397
XBeeException {
421398
// Not supported in Cellular.
422399
throw new UnsupportedOperationException(OPERATION_EXCEPTION);
@@ -427,7 +404,7 @@ public IOMode getIOConfiguration(IOLine ioLine) throws TimeoutException,
427404
* will raise an {@link UnsupportedOperationException}.
428405
*/
429406
@Override
430-
public void setIOConfiguration(IOLine ioLine, IOMode ioMode)
407+
public void setDIOChangeDetection(Set<IOLine> lines)
431408
throws TimeoutException, XBeeException {
432409
// Not supported in Cellular.
433410
throw new UnsupportedOperationException(OPERATION_EXCEPTION);
@@ -494,38 +471,6 @@ public void setPowerLevel(PowerLevel powerLevel) throws TimeoutException,
494471
throw new UnsupportedOperationException(OPERATION_EXCEPTION);
495472
}
496473

497-
/**
498-
* @deprecated Operation not supported in Cellular protocol. This method
499-
* will raise an {@link UnsupportedOperationException}.
500-
*/
501-
@Override
502-
public double getPWMDutyCycle(IOLine ioLine) throws TimeoutException,
503-
XBeeException {
504-
// Not supported in Cellular.
505-
throw new UnsupportedOperationException(OPERATION_EXCEPTION);
506-
}
507-
508-
/**
509-
* @deprecated Operation not supported in Cellular protocol. This method
510-
* will raise an {@link UnsupportedOperationException}.
511-
*/
512-
@Override
513-
public void setPWMDutyCycle(IOLine ioLine, double dutyCycle)
514-
throws TimeoutException, XBeeException {
515-
// Not supported in Cellular.
516-
throw new UnsupportedOperationException(OPERATION_EXCEPTION);
517-
}
518-
519-
/**
520-
* @deprecated Operation not supported in Cellular protocol. This method
521-
* will raise an {@link UnsupportedOperationException}.
522-
*/
523-
@Override
524-
public IOSample readIOSample() throws TimeoutException, XBeeException {
525-
// Not supported in Cellular.
526-
throw new UnsupportedOperationException(OPERATION_EXCEPTION);
527-
}
528-
529474
/*
530475
* (non-Javadoc)
531476
* @see com.digi.xbee.api.AbstractXBeeDevice#addSMSListener(com.digi.xbee.api.listeners.ISMSReceiveListener)

library/src/main/java/com/digi/xbee/api/IPDevice.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import com.digi.xbee.api.exceptions.TimeoutException;
2929
import com.digi.xbee.api.exceptions.XBeeException;
3030
import com.digi.xbee.api.listeners.IDataReceiveListener;
31-
import com.digi.xbee.api.listeners.IIOSampleReceiveListener;
3231
import com.digi.xbee.api.listeners.IIPDataReceiveListener;
3332
import com.digi.xbee.api.models.IPMessage;
3433
import com.digi.xbee.api.models.IPProtocol;
@@ -434,26 +433,6 @@ public void removeDataListener(IDataReceiveListener listener) {
434433
throw new UnsupportedOperationException(OPERATION_EXCEPTION);
435434
}
436435

437-
/**
438-
* @deprecated Operation not supported in this protocol. This method will
439-
* raise an {@link UnsupportedOperationException}.
440-
*/
441-
@Override
442-
public void addIOSampleListener(IIOSampleReceiveListener listener) {
443-
// Not supported in IP modules.
444-
throw new UnsupportedOperationException(OPERATION_EXCEPTION);
445-
}
446-
447-
/**
448-
* @deprecated Operation not supported in this protocol. This method will
449-
* raise an {@link UnsupportedOperationException}.
450-
*/
451-
@Override
452-
public void removeIOSampleListener(IIOSampleReceiveListener listener) {
453-
// Not supported in IP modules.
454-
throw new UnsupportedOperationException(OPERATION_EXCEPTION);
455-
}
456-
457436
/**
458437
* @deprecated Operation not supported in this protocol. This method will
459438
* raise an {@link UnsupportedOperationException}.

library/src/test/java/com/digi/xbee/api/CellularDeviceTest.java

Lines changed: 8 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -101,24 +101,6 @@ public void testReadDeviceInfoCellular() throws Exception {
101101
assertEquals(imeiAddress, cellularDevice.getIMEIAddress());
102102
}
103103

104-
/**
105-
* Test method for {@link com.digi.xbee.api.CellularDevice#getADCValue(com.digi.xbee.api.io.IOLine)}.
106-
*
107-
* <p>Verify that the not supported methods of the Cellular protocol throw an
108-
* {@code UnsupportedOperationException}.</p>
109-
*
110-
* @throws Exception
111-
*/
112-
@SuppressWarnings("deprecation")
113-
@Test
114-
public void testNotSupportedOperationGetADCValue() throws Exception {
115-
exception.expect(UnsupportedOperationException.class);
116-
exception.expectMessage(is(equalTo("Operation not supported in Cellular protocol.")));
117-
118-
// Call the method that should throw the exception.
119-
cellularDevice.getADCValue(null);
120-
}
121-
122104
/**
123105
* Test method for {@link com.digi.xbee.api.CellularDevice#getDIOChangeDetection()}.
124106
*
@@ -155,78 +137,6 @@ public void testNotSupportedOperationSetDIOChangeDetection() throws Exception {
155137
cellularDevice.setDIOChangeDetection(null);
156138
}
157139

158-
/**
159-
* Test method for {@link com.digi.xbee.api.CellularDevice#getDIOValue(com.digi.xbee.api.io.IOLine)}.
160-
*
161-
* <p>Verify that the not supported methods of the Cellular protocol throw an
162-
* {@code UnsupportedOperationException}.</p>
163-
*
164-
* @throws Exception
165-
*/
166-
@SuppressWarnings("deprecation")
167-
@Test
168-
public void testNotSupportedOperationGetDIOValue() throws Exception {
169-
exception.expect(UnsupportedOperationException.class);
170-
exception.expectMessage(is(equalTo("Operation not supported in Cellular protocol.")));
171-
172-
// Call the method that should throw the exception.
173-
cellularDevice.getDIOValue(null);
174-
}
175-
176-
/**
177-
* Test method for {@link com.digi.xbee.api.CellularDevice#setDIOValue(com.digi.xbee.api.io.IOLine, com.digi.xbee.api.io.IOValue)}.
178-
*
179-
* <p>Verify that the not supported methods of the Cellular protocol throw an
180-
* {@code UnsupportedOperationException}.</p>
181-
*
182-
* @throws Exception
183-
*/
184-
@SuppressWarnings("deprecation")
185-
@Test
186-
public void testNotSupportedOperationSetDIOValue() throws Exception {
187-
exception.expect(UnsupportedOperationException.class);
188-
exception.expectMessage(is(equalTo("Operation not supported in Cellular protocol.")));
189-
190-
// Call the method that should throw the exception.
191-
cellularDevice.setDIOValue(null, null);
192-
}
193-
194-
/**
195-
* Test method for {@link com.digi.xbee.api.CellularDevice#getIOConfiguration(com.digi.xbee.api.io.IOLine)}.
196-
*
197-
* <p>Verify that the not supported methods of the Cellular protocol throw an
198-
* {@code UnsupportedOperationException}.</p>
199-
*
200-
* @throws Exception
201-
*/
202-
@SuppressWarnings("deprecation")
203-
@Test
204-
public void testNotSupportedOperationGetIOConfiguration() throws Exception {
205-
exception.expect(UnsupportedOperationException.class);
206-
exception.expectMessage(is(equalTo("Operation not supported in Cellular protocol.")));
207-
208-
// Call the method that should throw the exception.
209-
cellularDevice.getIOConfiguration(null);
210-
}
211-
212-
/**
213-
* Test method for {@link com.digi.xbee.api.CellularDevice#setIOConfiguration(com.digi.xbee.api.io.IOLine, com.digi.xbee.api.io.IOMode)}.
214-
*
215-
* <p>Verify that the not supported methods of the Cellular protocol throw an
216-
* {@code UnsupportedOperationException}.</p>
217-
*
218-
* @throws Exception
219-
*/
220-
@SuppressWarnings("deprecation")
221-
@Test
222-
public void testNotSupportedOperationSetIOConfiguration() throws Exception {
223-
exception.expect(UnsupportedOperationException.class);
224-
exception.expectMessage(is(equalTo("Operation not supported in Cellular protocol.")));
225-
226-
// Call the method that should throw the exception.
227-
cellularDevice.setIOConfiguration(null, null);
228-
}
229-
230140
/**
231141
* Test method for {@link com.digi.xbee.api.CellularDevice#getIOSamplingRate()}.
232142
*
@@ -318,57 +228,39 @@ public void testNotSupportedOperationSetPowerLevel() throws Exception {
318228
}
319229

320230
/**
321-
* Test method for {@link com.digi.xbee.api.CellularDevice#getPWMDutyCycle(com.digi.xbee.api.io.IOLine)}.
231+
* Test method for {@link com.digi.xbee.api.CellularDevice#addIOSampleListener(com.digi.xbee.api.listeners.IIOSampleReceiveListener)}.
322232
*
323233
* <p>Verify that the not supported methods of the Cellular protocol throw an
324-
* {@code UnsupportedOperationException}.</p>
234+
* {@code UnsupportedOperationException}</p>.
325235
*
326236
* @throws Exception
327237
*/
328238
@SuppressWarnings("deprecation")
329239
@Test
330-
public void testNotSupportedOperationGetPWMDutyCycle() throws Exception {
240+
public void testNotSupportedOperationsAddIOSampleListener() throws Exception {
331241
exception.expect(UnsupportedOperationException.class);
332242
exception.expectMessage(is(equalTo("Operation not supported in Cellular protocol.")));
333243

334244
// Call the method that should throw the exception.
335-
cellularDevice.getPWMDutyCycle(null);
245+
cellularDevice.addIOSampleListener(null);
336246
}
337247

338248
/**
339-
* Test method for {@link com.digi.xbee.api.CellularDevice#setPWMDutyCycle(com.digi.xbee.api.io.IOLine, double)}.
249+
* Test method for {@link com.digi.xbee.api.CellularDevice#removeIOSampleListener(com.digi.xbee.api.listeners.IIOSampleReceiveListener)}.
340250
*
341251
* <p>Verify that the not supported methods of the Cellular protocol throw an
342-
* {@code UnsupportedOperationException}.</p>
343-
*
344-
* @throws Exception
345-
*/
346-
@SuppressWarnings("deprecation")
347-
@Test
348-
public void testNotSupportedOperationSetPWMDutyCycle() throws Exception {
349-
exception.expect(UnsupportedOperationException.class);
350-
exception.expectMessage(is(equalTo("Operation not supported in Cellular protocol.")));
351-
352-
// Call the method that should throw the exception.
353-
cellularDevice.setPWMDutyCycle(null, -1);
354-
}
355-
356-
/**
357-
* Test method for {@link com.digi.xbee.api.CellularDevice#readIOSample()}.
358-
*
359-
* <p>Verify that the not supported methods of the Cellular protocol throw an
360-
* {@code UnsupportedOperationException}.</p>
252+
* {@code UnsupportedOperationException}</p>.
361253
*
362254
* @throws Exception
363255
*/
364256
@SuppressWarnings("deprecation")
365257
@Test
366-
public void testNotSupportedOperationReadIOSample() throws Exception {
258+
public void testNotSupportedOperationRemoveIOSampleListener() throws Exception {
367259
exception.expect(UnsupportedOperationException.class);
368260
exception.expectMessage(is(equalTo("Operation not supported in Cellular protocol.")));
369261

370262
// Call the method that should throw the exception.
371-
cellularDevice.readIOSample();
263+
cellularDevice.removeIOSampleListener(null);
372264
}
373265

374266
/**

0 commit comments

Comments
 (0)