-
Notifications
You must be signed in to change notification settings - Fork 14
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
refactor!: rework CoapCode
and CoapMessageType
as enhanced enums
#114
Conversation
99f2618
to
94081ed
Compare
I incorporated the suggestions and squashed the commits :) |
@@ -128,24 +123,7 @@ class CoapReliabilityLayer extends CoapAbstractLayer { | |||
final CoapResponse? response, | |||
) { | |||
final mt = response!.type; | |||
if (mt == CoapMessageType.unknown) { |
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.
Haven't read all of the code and a little sleepy. When would this happen, if the server sent an invalid response and/or if the response was corrupted in flight? I take it with your change we won't acknowledge that message then, meaning that the server will resend the response? Sounds reasonable
LGTM! |
This PR refactors the
CoapCode
andCoapMessageType
classes as enhanced enums (also see #80), making the code more concise and readable. The changes also make it easier to add moreCoapCode
s in the future. The PR itself adds a few missingCoapCode
s from the IANA registry, including the new method codesFETCH
,PATCH
, andiPATCH
.CC @JosefWN