-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WiFi event monitor: Upgrade to SDK event monitor #870
Comments
Firstly use Next the convention is that constants are uppercase. and I think that the 'mode' is superfluous, so why not We also need to document T. Sorry but I am a bit snowed under at the moment so I can't do a decent code review, but if we do spin off a temporary Third, I feel that |
Over all I'm in favour here! Terry already made some excellent suggestions, so I'll just add another couple here:
And finally a question: Will this replace the earlier eventMon{Reg,Start,Stop} functions? |
+1 Looks good. |
Thank you for your input!
Also, I couldn't figure out how to make files compile when I put them in the new folder
Also, anybody think the name |
Merry Christmas!! I'll reply tomorrow 😄 |
Thank you, Merry Christmas to you as well. |
A quick comment on using the |
I figured out how to split the event monitor off into a separate file, not sure if it is the right way, but it works! Now to figure out how to get the files to compile in a subdirectory of modules... |
This is standard stuff -- recursion magic in make. I can do this for you. |
I forgot to close this. |
I'm looking to get some input on the API (and corresponding code) I have written to expose the event monitor added with esp_iot_sdk_v1.0.1_15_04_24 before I submit a pull request.
Here's a link to the branch: dev_new_event_monitor
Currently,
wifi.eventmon.start()
needs to be executed once by the user to register the C callback with the SDK. I would like to have it so it automatically registers the CB on boot but I'm not exactly sure how to do that.@TerryE pertaining to issue #846, I'm still learning about the lua internals(and programming in general), am I correct in the assumption that you are suggesting that
gL=L
should be replaced withgL=lua_getstate()
?wifi.eventmon sub-module
CONSTANTS
wifi.eventmon.STA_CONNECTED, wifi.eventmon.STA_DISCONNECTED, wifi.eventmon.STA_AUTHMODE_CHANGE, wifi.eventmon.STA_GOT_IP, wifi.eventmon.STA_DHCP_TIMEOUT, wifi.eventmon.AP_STACONNECTED, wifi.eventmon.AP_STADISCONNECTED, wifi.eventmon.AP_PROBEREQRECVED
DISCONNECT REASON CONSTANTS
wifi.eventmon.reason.UNSPECIFIED, wifi.eventmon.reason.AUTH_EXPIRE, wifi.eventmon.reason.AUTH_LEAVE, wifi.eventmon.reason.ASSOC_EXPIRE, wifi.eventmon.reason.ASSOC_TOOMANY, wifi.eventmon.reason.NOT_AUTHED, wifi.eventmon.reason.NOT_ASSOCED, wifi.eventmon.reason.ASSOC_LEAVE, wifi.eventmon.reason.ASSOC_NOT_AUTHED, wifi.eventmon.reason.DISASSOC_PWRCAP_BAD, wifi.eventmon.reason.DISASSOC_SUPCHAN_BAD, wifi.eventmon.reason.IE_INVALID, wifi.eventmon.reason.MIC_FAILURE, wifi.eventmon.reason.4WAY_HANDSHAKE_TIMEOUT, wifi.eventmon.reason.GROUP_KEY_UPDATE_TIMEOUT, wifi.eventmon.reason.IE_IN_4WAY_DIFFERS, wifi.eventmon.reason.GROUP_CIPHER_INVALID, wifi.eventmon.reason.PAIRWISE_CIPHER_INVALID, wifi.eventmon.reason.AKMP_INVALID, wifi.eventmon.reason.UNSUPP_RSN_IE_VERSION, wifi.eventmon.reason.INVALID_RSN_IE_CAP, wifi.eventmon.reason.802_1X_AUTH_FAILED, wifi.eventmon.reason.CIPHER_SUITE_REJECTED, wifi.eventmon.reason.BEACON_TIMEOUT, wifi.eventmon.reason.NO_AP_FOUND, wifi.eventmon.reason.AUTH_FAIL, wifi.eventmon.reason.ASSOC_FAIL, wifi.eventmon.reason.HANDSHAKE_TIMEOUT
wifi.eventmon.register()
Description
Register/unregister callbacks for WiFi event monitor
Syntax
wifi.eventmon.register(Event, function(T))
wifi.eventmon.register(Event, nil)
Parameters
Event: WiFi event you would like to set a callback for
Returns
T: Table returned by event.
Example
The text was updated successfully, but these errors were encountered: