flownexus-lwm2m / flownexus

IoT server with LwM2M support
https://flownexus-lwm2m.github.io/flownexus
Apache License 2.0
3 stars 2 forks source link

Leshan: Add registration handler interface #34

Closed jonas-rem closed 4 months ago

jonas-rem commented 5 months ago

~Status: WIP~

Django has to be informed of the registration status of endpoints. In Leshan there are callbacks that contain all relevant information such as 'lastUpdated', 'registered'. This information will be send to the matching Django ReST API.

jonas-rem commented 5 months ago

This PR also adds an automatic ReST API documentation, based on redoc and OpenAPI v3 to the Sphinx documentation. The information is directly generated from the validation code in the Django Rest Framework Serializer. That way it makes sure that documentation and implementation are always in sync.

image

Kappuccino111 commented 4 months ago

@jonas-rem could you please explain the difference between simple and composite resources ?

Kappuccino111 commented 4 months ago

I like the idea of automatically generating API Documentation. That seems to be a very good addition and would help us keep track of the APIs and the changes in them as well.

jonas-rem commented 4 months ago

@jonas-rem what exactly do we mean by Django has to be informed of the registration status of endpoints.? Like is this only when a new client is added ? Because once we have a new client registered , then there will be only certain endpoints that we would need to monitor.

LwM2M maintains registrations of endpoints. As long as an endpoint updates its registration within the allowed time, the registration remains active. If the endpoint reports for an update too late, the endpoint will be deregistered from Leshan. It has to re-register as a consequence. The database should keep track of the past and current registration efforts and status. Therefore registrations, registration updates and deregistrations are send as a custom LwM2M Object.

jonas-rem commented 4 months ago

I will merge this PR and update the documentation in a new PR.