Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an EndpointProvider at Server side for CoAP based on java-coap(fork) #1382

Merged
merged 3 commits into from
Oct 19, 2023

Conversation

sbernard31
Copy link
Contributor

@sbernard31 sbernard31 commented Jan 24, 2023

This aims to experiment transport abstraction layer implementing another endpoint provider at Server side for CoAP based on java-coap(fork).

See more details at #1373.

leshan-tl-javacoap-server/pom.xml Outdated Show resolved Hide resolved

@Override
public void stop() {
// TODO in Leshan stop means "we can restart after a stop", so we should check what means stop for java-coap
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no restart after stop, need to create new instance to start again.
Out of curiosity, what's the use case for restart?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest I'm not so sure if this is really needed, I know that we use it in some tests (especially at LWM2M client side to simulate that device is sleeping).

Californium has a start / stop / destroy mechanism where stop means that's you can restart unlike destroy.
Stop is kind of "pause".

As Leshan was strongly tied to californium, we follow this API.
Then when I did first transport abstraction layer, I keep it...
Always easier to add feature than remove it, but maybe better to just keep start() and destroy(). 🤔

@sbernard31
Copy link
Contributor Author

@szysas thx a lot for reviewing this 😉

@sbernard31 sbernard31 force-pushed the java-coap branch 2 times, most recently from 6441d53 to 2d3717e Compare April 19, 2023 16:46
@sbernard31 sbernard31 changed the base branch from master to parameterize_integration_test April 19, 2023 16:47
@sbernard31 sbernard31 force-pushed the parameterize_integration_test branch from 97827bb to 51bc666 Compare April 20, 2023 15:29
@sbernard31
Copy link
Contributor Author

sbernard31 commented Apr 20, 2023

I finally succeed to pass all CoAP (only) integration tests with Californium used at LWM2M client side and java-coap at LWM2M server side.

(Probably not exhaustive) Missing feature :

@sbernard31
Copy link
Contributor Author

With java-coap v6.12.0, I was able to :

  • Remove some workaround using new API : ae98e56
  • Add support of Composite operation : b52be48

Thx @szysas 🙏

@sbernard31 sbernard31 force-pushed the parameterize_integration_test branch from 51bc666 to ab207af Compare May 4, 2023 09:33
@sbernard31 sbernard31 changed the base branch from parameterize_integration_test to master May 4, 2023 09:47
@sbernard31
Copy link
Contributor Author

sbernard31 commented Sep 26, 2023

I rebased this in master (several conflict especially because of Identity Refactoring)

There is also some observe code available at java_coap_server_observe which depends on "not yet released version" of java-coap

@sbernard31 sbernard31 marked this pull request as ready for review October 18, 2023 14:28
@sbernard31
Copy link
Contributor Author

✔️ Observe relation can now be shared / persisted, since we use java-coap v6.18.0.

All integration test are OK ✔️, there are still some TODO in the code but I think this is now in a testable state.
So, I plan to integrate in master soon and so it will be available in sandbox.

@sbernard31
Copy link
Contributor Author

This is now integrated in master.

java-coap endpoint is available in leshan-server-demo, see Server tab:

Capture d’écran du 2023-10-19 12-08-55

The port and host can be configured with options:

-jh, --java-coap-host=<jlocalAddress>
                  Set the local CoAP address of endpoint based on
                    java-coap library.
                  Default: any local address.
-jp, --java-coap-port=<jlocalPort>
                  Set the local CoAP port of endpoint based on java-coap
                    library.
                  Default: 5685

@sbernard31 sbernard31 deleted the java-coap branch October 19, 2023 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants