Recommended way to know if a Thread device is connected #8324
-
What is the recommended way to know if a Thread device is connected to a thread network? In this discussion, there is this code:
Or is there an OT API for that? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
It really depends on how you define "connected". For example, it could be:
For (1), simply checking the neighbor table is at least one entry should be sufficient. Beyond that, others define "connected" as being able to establish a session with some other endpoint, and that endpoint may be on the same Thread network, same local IP network, or on the public Internet. |
Beta Was this translation helpful? Give feedback.
-
Ok thank you Jonathan. You're right that it was important to clarify the meaning of "connected". In my case I wanted to know if the device is connected to a Thread Border Router so this is the case 2. For my demos, it is not important if we have internet connectivity or not. |
Beta Was this translation helpful? Give feedback.
It really depends on how you define "connected". For example, it could be:
For (1), simply checking the neighbor table is at least one entry should be sufficient.
For (2), checking the Thread Network Data for an on-mesh prefix and an external route should be sufficient.
For (3), checking the Thread Network Data for an on-mesh prefix and a default route should be sufficient.
Beyond that, others define "connected" as being able to establish a session w…