-
Notifications
You must be signed in to change notification settings - Fork 2k
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
pkg/tinydtls/sock_dtls: use ztimer_usec #17677
pkg/tinydtls/sock_dtls: use ztimer_usec #17677
Conversation
just checked is USEC is necessary for the timeout - sadly yes to keep the sock interface "happy"the parameter needs it since our current sock interface uses usec timeout everywhere (connect, accept, recv, send ...) checked if usec is needed in the sock interface - unlikelyunlikely: even though linux uses struct timeval and there for provides such a high resolution
may be this could go with a similar solution to IBM for now, accept high granularity (usecs) but use an internal resolution of ms -> this PR could go for ZTIMER_MSEC and divide the values from the interface by a 1000 |
I feel this would be out of scope of this PR, this is would an API change for sock... |
But otherwise I would agree on this, similar to what your are proposing in #16598 |
All green! |
Thanks! |
Contribution description
In #17564
tinydtls
code was migrated toztimer
, but for some reason,sock_dtls
was looked over, and not caught by the CI, it's now resurfaced with #17670, so this PR cleans this up.Since
sock
timeous are inus
this PR us using `ztimer_usec, only 32bits are required here.I also uncrustified in a separate commit.
Testing procedure
I ran
examples/dtls-sock
between two native nodes, also change the timeouts fromSOCK_NO_TIMEOUT
to5 * US_PER_SEC
and saw it timeout after 5 second when only one native node was up:Issues/PRs references
Cleanup from #17564
Needed for #17670