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 TooManyRequests constant to support RFC-8516 #341

Merged
merged 2 commits into from
Jun 20, 2022

Conversation

tim-golioth
Copy link
Collaborator

We recently needed to add this constant locally to our CoAP server, but figured it be good to contribute it upstream as well. I wasn't sure about which uint to assign to it, hence the randomly chosen 145. Happy to change it to something more appropriate.

@beriberikix
Copy link
Collaborator

I'm not certain but I think the codes are derived from a decimal conversion. From RFC7252, Section 5.2:

   As a human-readable notation for specifications and protocol
   diagnostics, CoAP code numbers including the Response Code are
   documented in the format "c.dd", where "c" is the class in decimal,
   and "dd" is the detail as a two-digit decimal.  For example,
   "Forbidden" is written as 4.03 -- indicating an 8-bit code value of
   hexadecimal 0x83 (4*0x20+3) or decimal 131 (4*32+3).

So would that make 4.29 be 4*32+29 = 157?

@tim-golioth
Copy link
Collaborator Author

Thanks for pointing that out, @beriberikix! Totally missed that in the RFC. 🤦

@beriberikix
Copy link
Collaborator

NP! Should we also update the README to include this in the list of RFCs supported?

@tim-golioth
Copy link
Collaborator Author

NP! Should we also update the README to include this in the list of RFCs supported?

Good idea! I'll create a separate PR to update the README.

@jkralik
Copy link
Member

jkralik commented Jun 20, 2022

Thx for contributing 👍

@jkralik jkralik merged commit 75675c0 into plgd-dev:master Jun 20, 2022
@tim-golioth tim-golioth mentioned this pull request Aug 1, 2022
12 tasks
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.

None yet

3 participants