-
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
Expose SDK event monitor #1018
Expose SDK event monitor #1018
Conversation
5cb0028
to
758221b
Compare
Does the SDK event monitor callback execute at interrupt level or at base level? I would hope at base level..... |
758221b
to
d1e25b1
Compare
@pjsg Honestly, I have no idea how to find that out and the SDK documentation doesn't provide that much information, just the function wifi_set_event_handler_cb(), a very short description and some example code. I thought rewording the commit would replace the original, oh well... |
If that's your intention then you need to squash/amend your commits and then force push them ( |
cbebd05
to
2ef289a
Compare
I also discovered the undocumented function I have written an implementation for the function, should I add it to this pull request? Here's the documentation on the function if anybody is interested. |
@@ -131,6 +132,8 @@ int ets_printf(const char *format, ...) __attribute__ ((format (printf, 1, 2))) | |||
|
|||
int ets_sprintf(char *str, const char *format, ...) __attribute__ ((format (printf, 2, 3))); | |||
|
|||
int ets_vsprintf (char *d, const char *s, va_list ap); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not part of the boot ROM. It's provided by the SDK libs. This definition (and the old ets_sprintf()
one above) should go into sdk-overrides/include/ets_sys.h
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for clarifying that, I wasn't sure where to put it.
With the new |
2ef289a
to
3195b43
Compare
The functions The The function I was thinking maybe I should change "wifi.eventmon" to something like "wifi.eventhandler" to prevent confusion with the "wifi.sta.eventMon__" functions, any thoughts? |
fc67664
to
7b14053
Compare
8aa7286
to
c487225
Compare
Event monitor now copies event data into a queue and posts a task(using new tasking interface) to process the queue. I also added a fix for issue #1065. |
20a568e
to
391e4cc
Compare
^^^I'm guessing this failure is related to #1070^^^ |
be0b217
to
160c5bc
Compare
@dnc40085 I'll do a top to tail review of this this weekend and if OK then I'll merge it. Sorry for the delay. |
No worries, I'm in no rush. I was wondering... locally, I was reworking Also, is |
As far as the application programmer is concerned this is just a config option within |
160c5bc
to
9630e8f
Compare
570beca
to
8af8fb7
Compare
@dnc40085 We don't have an agreement as for #1146 but this PR is not (yet?) on that list, it may not make the cut. So, I feel it'd be helpful if you could create a dedicated PR for the |
Perhaps we should apply a 90:10 test "Is this a material step forward over the current code in master/dev?". I am always worried that we contributors are all time limited and if we apply a 100% rule then we'll just end up never moving forward. On this basis I would merge this now, but not without at least one other contributor +1. |
So what should I do? split it off? |
If you look gist then you will see that this is offset by 0xCC which is in Nope IMO leave it as it is now now. 90:10 rules. |
This PR has been lingering for some time now even after all the updates. What are the arguments against merging this? Is it the "half-module" that Marcel brought up? If that's the only thing I'm in favour of merging now and improving later. |
If anybody has any questions about the PR please feel free to ask. |
You're probably right, my understanding of assembler is limited. |
@dnc40085 are you happy for us to merge this? |
I have no more changes to make to this PR, Aside from not being sure if I should remove the pseudo future proofing section (If Espressif adds any new events, this section allows the user to assign a default callback to execute if an event specific callback is not defined). Should I squash the commits before the merge? |
Yes please., might as well keep it neat and tidy! |
Implement SDK event monitor Move wifi status event monitor code into seperate file (app/modules/wifi_eventmon.c) Modify wifi lua callback registration code. Add Functions wifi.ap.deauth and wifi.sta.getrssi Rework wifi event monitor to use tasking interface fix for Lua coroutine compatibility issue Made changes Suggested by TerryE Also, moved code that sets the default host name out of luaopen_wifi_init and into a separate function and added a post_task_low entry in it's place. Replaced some if test then return error lines with luaL_argcheck Add check for malloc null return in wifi.eventmon to catch out of memory errors
8af8fb7
to
5e9ab01
Compare
The commits have been squashed. |
Thanks! Sorry about the delay to get this merged. |
No problem. Thanks for merging this. |
This PR exposes the SDK event monitor discussed in issue #870
wifi.sta.eventMonxxx
code was moved towifi_eventmon.c
changed
wifi.sta.eventMonReg()
: callbacks can now be unregistered by leaving function field blank.changed
wifi.sta.eventMonStop()
: all callbacks can now be unregistered by using1
instead of"unreg all"
All backwards compatibility was preserved. The event monitor documentation can be found here.
Also included is the addition of the functions
wifi.ap.deauth()
(click here for documentation) andwifi.sta.getrssi()
(click here for documentation)