Skip to content

gnrc_priority_pktqueue: simplify API#1

Merged
zhuoshuguo merged 1 commit into
zhuoshuguo:add_packet_queue_module_to_gnrc_macfrom
miri64:shugou/enh/simplify-priority-pktqueue
Oct 19, 2016
Merged

gnrc_priority_pktqueue: simplify API#1
zhuoshuguo merged 1 commit into
zhuoshuguo:add_packet_queue_module_to_gnrc_macfrom
miri64:shugou/enh/simplify-priority-pktqueue

Conversation

@miri64

@miri64 miri64 commented Oct 19, 2016

Copy link
Copy Markdown

There is a lot simplification possible, if you do not add the pool of nodes to the queue and let the "user" handle it externally. One would now go to allocate a node like this (sometimes a node allocated somewhere in a function allocated might already be enough for an application so a central array would be overkill). Also there are a lot of style issues that I did not fix with this PR that need fixing before we can merge RIOT-OS#5950!

With this change one would now push a packet pkt to the queue q as follows:

gnrc_priority_pktqueue_node_t *some_node = get_somewhere();
priority_pktqueue_node_init(some_node, priority, pkt);
priority_pktqueue_push(&q, some_node);

Style-note: the functions need gnrc_ prefixing of course ;-)

@zhuoshuguo

Copy link
Copy Markdown
Owner

Thanks a lot! Martine @miri64 , so the idea is to allocate the node externally by the API user itself.

@zhuoshuguo zhuoshuguo merged commit e2c939a into zhuoshuguo:add_packet_queue_module_to_gnrc_mac Oct 19, 2016
@miri64 miri64 deleted the shugou/enh/simplify-priority-pktqueue branch October 19, 2016 18:51
@miri64

miri64 commented Oct 19, 2016

Copy link
Copy Markdown
Author

Yapp, like in the rest of RIOT ;-)

zhuoshuguo pushed a commit that referenced this pull request Jan 22, 2019
* drivers/ccs811: fix types in debug messages

* drivers/driver_ccs811_full: fix unused variable build error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants