NetworkInterface attach and add_event_listener

16 Apr 2019

According to the Mbed API documentation, NetworkInterface::attach and NetworkInterface::add_event_listener:

Quote:

Application may only use attach() or add_event_listener() interface.

This constraint works if applications are the only callers of these methods. If a service or class derived from NetworkInterface or EMACInterface also registers (must be add_event_listener), then calls to attach should either fail or be forwarded to add_event_listener.

One possible thought here would be to provide a protected version of attach (i.e. _attach) and allow derived classes to override attach as necessary.