-
Notifications
You must be signed in to change notification settings - Fork 137
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
Enable clients requesting server time in CoAP responses #3503
Enable clients requesting server time in CoAP responses #3503
Conversation
…in CoAP responses.
Thanks for your interest in Hono and for creating this PR 👍 I have been reading through your question raised with Californium and I have to admit that I would actually also prefer to use a client provided CoAP Option or a request parameter in order to trigger the return of the system time. Turning this on for all requests at the adapter level feels a little too coarse grained to me. If there is no way the client could include such an Option/req param, then I could also live with defining the property at the tenant level (instead of the adapter level). The system time returned by the adapter should in any case be included in a CoAP option. |
Oh, and BTW, you will need to sign an Eclipse ECA as described in the contribution guide and make sure to a Signed-off-by footer to your commit messages. |
Thanks @sophokles73 I'll dig into this a bit deeper then (as well as the ECA stuff). |
Addresses [#3502] |
adapters/coap/src/main/java/org/eclipse/hono/adapter/coap/CoapContext.java
Outdated
Show resolved
Hide resolved
…ime the devices request the option be included by either providing the time option in their CoAP request or by providing the 'hono-response-timestamp' request parameter.
@sophokles73 : Take 2. Now the device initiates the timestamp response either by sending its own time option in the request or by specifying the Again, everything is very crude and will be cleaned up... I just want to bounce this around to see if this is something that would possibly be included eventually ;-) I'm still just copying the option number from the Californium demo server implementation by @boaks so we'll need to come up with a new option number (see his suggestion for segmentation). Also, I'm open for suggestions for the name of the request parameter. It's a bit too verbose IMO. |
Just to mention: |
I agree, let's try to cut this down. What about just hono-time? |
adapters/coap/src/main/java/org/eclipse/hono/adapter/coap/CoapContext.java
Outdated
Show resolved
Hide resolved
adapters/coap/src/main/java/org/eclipse/hono/adapter/coap/CoapContext.java
Outdated
Show resolved
Hide resolved
adapters/coap/src/main/java/org/eclipse/hono/adapter/coap/CoapContext.java
Outdated
Show resolved
Hide resolved
adapters/coap/src/main/java/org/eclipse/hono/adapter/coap/CoapContext.java
Outdated
Show resolved
Hide resolved
adapters/coap/src/test/java/org/eclipse/hono/adapter/coap/TelemetryResourceTest.java
Outdated
Show resolved
Hide resolved
@StFS an answer to a previous question:
No, not as part of this PR but I was planning to do the update anyway, so I will do this independently ... |
Alright @sophokles73, I'll try to remember to do a separate PR for using the option registry once that update has been made. But for now I'll do a bit more cleanup and try to wrap this one up. |
Closes #3502 |
…mestamp_in_responses
I have created #3506 |
… Clean up System.out.println. Add some negative tests for time option. Minor refactoring to tests. Add integration tests for the CoAP time option feature.
…tamp_in_responses' into add_coap_config_for_server_timestamp_in_responses
…mestamp_in_responses
adapters/coap/src/main/java/org/eclipse/hono/adapter/coap/option/TimeOption.java
Outdated
Show resolved
Hide resolved
adapters/coap/src/main/java/org/eclipse/hono/adapter/coap/option/TimeOption.java
Outdated
Show resolved
Hide resolved
adapters/coap/src/main/java/org/eclipse/hono/adapter/coap/option/TimeOption.java
Outdated
Show resolved
Hide resolved
adapters/coap/src/test/java/org/eclipse/hono/adapter/coap/CoapContextTest.java
Outdated
Show resolved
Hide resolved
adapters/coap/src/test/java/org/eclipse/hono/adapter/coap/CoapContextTest.java
Outdated
Show resolved
Hide resolved
adapters/coap/src/main/java/org/eclipse/hono/adapter/coap/option/TimeOption.java
Outdated
Show resolved
Hide resolved
adapters/coap/src/main/java/org/eclipse/hono/adapter/coap/option/TimeOption.java
Outdated
Show resolved
Hide resolved
adapters/coap/src/main/java/org/eclipse/hono/adapter/coap/option/TimeOption.java
Outdated
Show resolved
Hide resolved
adapters/coap/src/main/java/org/eclipse/hono/adapter/coap/option/TimeOption.java
Show resolved
Hide resolved
adapters/coap/src/test/java/org/eclipse/hono/adapter/coap/CoapContextTest.java
Show resolved
Hide resolved
adapters/coap/src/main/java/org/eclipse/hono/adapter/coap/option/TimeOption.java
Outdated
Show resolved
Hide resolved
tests/src/test/java/org/eclipse/hono/tests/coap/CoapTestBase.java
Outdated
Show resolved
Hide resolved
tests/src/test/java/org/eclipse/hono/tests/coap/CoapTestBase.java
Outdated
Show resolved
Hide resolved
tests/src/test/java/org/eclipse/hono/tests/coap/CoapTestBase.java
Outdated
Show resolved
Hide resolved
adapters/coap/src/main/java/org/eclipse/hono/adapter/coap/CoapContext.java
Outdated
Show resolved
Hide resolved
adapters/coap/src/main/java/org/eclipse/hono/adapter/coap/option/TimeOption.java
Show resolved
Hide resolved
Can you fix the Checkstyle violation that makes the CI build fail? |
Doing that as we type. Going insane trying to figure out the correct import order ;-) But I figured it out eventually.
Will do. |
you can use the |
Umm... yeah... well... I'm kinda using the "other" IDE ;) |
adapters/coap/src/main/java/org/eclipse/hono/adapter/coap/CoapContext.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Great work :-) Thanks for contributing 👍
Creating this PR to get feedback on whether I'm on the right track.