Closed ascillato closed 6 years ago
Made the PR #54 and #55 for adding this functions.
Deleting callback (and config and feedback) registrations that way this tricky, as it shifts the ids of callbacks that were registered after the to-be-deleted callback was registered. An application would then need to shift (some) of their saved ids so that it matches again. Example:
callback_id_t id1 = callback_register(...); // id1 = 0
callback_id_t id2 = callback_register(...); // id2 = 1
callback_id_t id3 = callback_register(...); // id3 = 2
callback_id_t id4 = callback_register(...); // id4 = 3
...
callback_delete_register(id2); // Moves the last two callbacks one slot up
// Now the callback that was id3 took the spot of id2 and id4 is now invalid
For assignments this is fine, as the application does not receive an id on assignment. So we can shift sstuff around. But having the callback_delete_assignment
would take an argument, that the application does not even have as callback_assign
returns void
and not callback_assignment_t
.
In the end, the structures could be modified to allow this, e.g., mark deleted spots as deleted and don't shift others. But then we would also need to reclaim them, skip deleted spots during iteration, etc.
I will add this.
Like your approach! :+1:
Tested and works really good !
Thanks !!!!! :+1:
Hi @envy ,
When using and configuring the ESP-KNX-IP Library but only by code and not using the ESP-KNX-IP webpage, are needed new functions:
Can be added to the library?
Thanks a lot for your time! Great Library.