open-coap / java-coap

CoAP Java library
Apache License 2.0
18 stars 5 forks source link

#29 Include NON_CONFIRMABLE in CoapRequest.transportContext #34

Closed szysas closed 1 year ago

szysas commented 1 year ago

While handling inbound coap requests, message type can be checked like:

...
Boolean isNonConfirmable = coapRequest.getTransContext().get(NON_CONFIRMABLE)
codecov[bot] commented 1 year ago

Codecov Report

Base: 92.37% // Head: 92.42% // Increases project coverage by +0.04% :tada:

Coverage data is based on head (a6a0b61) compared to base (c4cde6c). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #34 +/- ## ============================================ + Coverage 92.37% 92.42% +0.04% - Complexity 1857 1859 +2 ============================================ Files 124 124 Lines 4238 4239 +1 Branches 604 604 ============================================ + Hits 3915 3918 +3 + Misses 181 180 -1 + Partials 142 141 -1 ``` | [Impacted Files](https://codecov.io/gh/open-coap/java-coap/pull/34?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-coap) | Coverage Δ | | |---|---|---| | [...src/main/java/com/mbed/coap/packet/CoapPacket.java](https://codecov.io/gh/open-coap/java-coap/pull/34?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-coap#diff-Y29hcC1jb3JlL3NyYy9tYWluL2phdmEvY29tL21iZWQvY29hcC9wYWNrZXQvQ29hcFBhY2tldC5qYXZh) | `91.69% <100.00%> (+0.03%)` | :arrow_up: | | [...java/com/mbed/coap/transport/TransportContext.java](https://codecov.io/gh/open-coap/java-coap/pull/34?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-coap#diff-Y29hcC1jb3JlL3NyYy9tYWluL2phdmEvY29tL21iZWQvY29hcC90cmFuc3BvcnQvVHJhbnNwb3J0Q29udGV4dC5qYXZh) | `97.14% <0.00%> (+5.71%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-coap). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-coap)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

szysas commented 1 year ago

@sbernard31 Is that what you are looking?

sbernard31 commented 1 year ago

Yep something like this but I didn't have an exhaustive list of what Leshan needs about MessageType.

I mean I don't know if we need it only for request or for response too. And I don't know if isNonConfirmable is enough or if we need a more general feature which returns MessageType. If I'm not wrong : request can be a CON / NON and a response can be CON/NON/ACK.

So

szysas commented 1 year ago

OK, this only covers inbound requests. For response there might need to be a bigger refactor needed.