Coap Secure - IsConnected #7741
-
Hi OpenThread community! I'm using the OpenThread 'CoAP Secure' API to establish a secure DTLS session. I'm using the following API calls:
Problem: By adding one of those API calls before the otCoapSecureConnect() call I'm not able to successfully establish the DTLS session anymore! INFO: Cheers, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi, I found the problem by myself :) My aSockAddr which is used in otCoapSecureConnect was a local variable on stack! NOTE: I copied the code from the OT CLI code! openthread/src/cli/cli_coap_secure.cpp Line 390 in a4cba16 Looks like it's working in CLI context! Maybe my program has a different dynamic run-time behavior which makes the problem more visible! Cheers, |
Beta Was this translation helpful? Give feedback.
Hi,
I found the problem by myself :)
My aSockAddr which is used in otCoapSecureConnect was a local variable on stack!
Making it global fixed the problem!
NOTE: I copied the code from the OT CLI code!
openthread/src/cli/cli_coap_secure.cpp
Line 390 in a4cba16
Looks like it's working in CLI context! Maybe my program has a different dynamic run-time behavior which makes the problem more visible!
Cheers,
Fränz