added weak fnc add_custom_offer_options by bwjohns4 · Pull Request #8451 · esp8266/Arduino (original) (raw)
Where in Arduino is the DCHP server instantiated and where in user/library code would this happen?
It is globally instantiated. Nonosdk firmware initially calls dhcps_start()
which is defined in the same file.
[...] How does this align with your suggestion of the linked list callable from send_offer()
send_offer()
is called much later than when dhcp server is initialized, and that, on user request after explicitly installing AP mode.
So user sketch has time to set something up to be taken into account.
I was mentioning a linked list. A simple mechanism may be sufficient:
In the dhcp server class, a std::function<bool(uint8_t* option, size_t remain)>
member, and a setter.
This API can be overloaded if one need to separately add more options, which I doubt.