eclipse-leshan / leshan

Java Library for LWM2M
https://www.eclipse.org/leshan/
BSD 3-Clause "New" or "Revised" License
652 stars 407 forks source link

Can Leshan Server support a Client running in UQ Binding #580

Closed iot-cloud closed 6 years ago

iot-cloud commented 6 years ago

Hi,

I am trying to use Leshan Server to test out the Client functionality.

My Client can support UQ Binding.

Questions:

  1. I have noted that the bootstrap.json contains LifeTIme and Binding. The default LifeTime is 2 s and the default Binding is U. Can Leshan Server support UQ Binding?

  2. I have also noted that the Leshan Server also contains some logic to maintain AWAKE and SLEEPING. If I changed the bootstrap.json to support UQ. I tracked down the State Management of each Client. May you help to explain the logic behind the putting the Client to SLEEEPING and AWAKE the client to receive CoAP messages in the Q.

  3. My Client is waking up with the different IP address. I noted that the Leshan Server is still using the old IP address happened during the Registration Update. Should there be any reconcile Client Details in the Leshan Server for future communication.

May the GateKeeper provide some guidance?

Thank in advanced and Regards, Henry

sbernard31 commented 6 years ago
  1. Can Leshan Server support UQ Binding?

Yes. It can. You can use the PresenceService

/**
 * Tracks the status of each LWM2M client registered with Queue mode binding. Also ensures that the
 * {@link PresenceListener} are notified on state changes only for those LWM2M clients registered using Queue mode
 * binding.
 *
 * @see Presence
 */
public interface PresenceService {

Or handle Queue mode on your own by deactivating PresenceService. (see LeshanServerBuilder)

    /**
     * deactivate PresenceService which tracks presence of devices using LWM2M Queue Mode. When Queue Mode is
     * deactivated request is always sent immediately and {@link ClientSleepingException} will never be raised.
     * Deactivate QueueMode can make sense if you want to handle it on your own or if you don't plan to support devices
     * with queue mode.
     */
    public LeshanServerBuilder disableQueueModeSupport() {
        this.noQueueMode = true;
        return this;
    }

The queuemode is explained in LWM2M specification and you could find information about our implementation here : https://github.com/eclipse/leshan/issues/427

  1. My Client is waking up with the different IP address. I noted that the Leshan Server is still using the old IP address happened during the Registration Update.

The spec is not so clear but the way I understand it is "if device IP address changes, device must do a registration update". I tried to get more information about that at OMA : https://github.com/OpenMobileAlliance/OMA_LwM2M_for_Developers/issues/391 but without succeed...

Here more information about that : https://github.com/eclipse/leshan/issues/544#issuecomment-407400523

sbernard31 commented 6 years ago

Could we close this issue ?