Network manager callback status codes #95253
Unanswered
MandusBorjesson asked this question in Q&A
Replies: 1 comment 6 replies
-
The status code values are not documented in the header file which is unfortunate. From wifi shell code in zephyr/subsys/net/l2/wifi/wifi_shell.c Line 300 in c7086c7 -errno value). This should be documented properly in the header file. @MandusBorjesson would you be able to send a PR fixing this and add proper documentation to it? |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all!
I am in the process of bumping the zephyr version of my project to 4.2.0, including a move using the Network Manager. I have some questions regarding network manager event callbacks, specifically the
infomember in thenet_mgmt_event_callbackstruct for WiFi connections.From what I have been able to figure out, the info member tends to point to whatever value the used driver passes as
statusto thewifi_mgmt_raise_disconnect_result_eventandwifi_mgmt_raise_connect_result_eventfunctions, which both take an int status code. The value is then casted to awifi_statusstruct and passed along to the application, ending up in the registered callbacksinfomember.I am using an espressif chip and would like a bit more info than a
0/-1status code out of my callbacks so I am modifying theesp_wifi_drvdriver to use thewifi_statusunion members and their respective enum values.What puzzles me are the different values that are passed to these functions by different drivers, as there doesn't seem to be any consensus in the driver implementations. For example, espressif's driver uses
0or-1, Simplelink uses0or-EIO(stating that they will map the code towifi_statuscodes once they are defined) and so on...Are there any guidelines as to how this status code should be used? I have read through the docs and might be missing something, but I can't seem to find any guidelines. My assumption based on the different status enum values would be the following:
wifi_mgmt_raise_connect_result_eventwifi_status.wifi_conn_statusvalueswifi_mgmt_raise_connect_result_eventwifi_status.wifi_disconn_reasonvaluesAs mentioned, I will likely modify the esp driver to better fit my needs, but I want to make sure I am not stepping too far out of the design philosophy behind the Network Manager. Are my assumptions reasonable? Is there a reason I don't see other drivers doing this? Any feedback is welcome.
Beta Was this translation helpful? Give feedback.
All reactions