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
tinydtlscode was migrated toztimer, but for some reason,sock_dtlswas looked over, and not caught by the CI, it's now resurfaced with #17670, so this PR cleans this up.Since
socktimeous are inusthis PR us using `ztimer_usec, only 32bits are required here.I also uncrustified in a separate commit.
Testing procedure
I ran
examples/dtls-sockbetween two native nodes, also change the timeouts fromSOCK_NO_TIMEOUTto5 * US_PER_SECand saw it timeout after 5 second when only one native node was up:Issues/PRs references
Cleanup from #17564
Needed for #17670