Commit d4b6469
committed
openthread: platform: trel: Handle enable/disable from CLI
OpenThread interface is initialized beform Wi-Fi interface.
`otPlatTrelEnable` is called by OpenThread stack when it's interface is
being initialized. Given this scenario, socket operation, like `bind`,
will fail. There is also no mean to get a valid pointer to backbone
interface. This is why, `trel_plat_init` was declared and called when
backbone interface reported connectivity.
This commit handles the `ot trel disable/ot trel enable` scenario that
can be initialized from CLI. `otPlatTrelEnable` will be called, but
`trel_plat_init` will not be called anymore, leaving trel socket without
any options set, and `net_socket_service_register` is not called
anymore, to handle incoming traffic.
Now, when `otPlatTrelEnable` is called, it will verify if Wi-Fi
interface is connected and will call `trel_plat_init` if needed.
Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>1 parent e2d6af1 commit d4b6469
2 files changed
+17
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| |||
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
| 40 | + | |
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
| |||
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
50 | 64 | | |
51 | 65 | | |
52 | 66 | | |
| |||
141 | 155 | | |
142 | 156 | | |
143 | 157 | | |
144 | | - | |
| 158 | + | |
145 | 159 | | |
146 | 160 | | |
147 | 161 | | |
148 | 162 | | |
149 | 163 | | |
150 | 164 | | |
| 165 | + | |
151 | 166 | | |
152 | 167 | | |
153 | 168 | | |
| |||
0 commit comments