Make it possible to post closures to BTA message queue
Currently, every task executed on bta thread needs a separate event id, structure holding its parameters, API method, and method that will be executed in bta thread, which must accept generic tBTA_DM_MSG. Because of that we end up with lots of boilerplate code, and possibility to misinterpret bytes in tBTA_DM_MSG struct. After this patch, we can post closures onto bta thread. Thanks to it we don't need a struct to hold parameters, and the executed method can have a meaningful parameters. First experiments showed over 50% reduction in code size when rewriting advertising code to new style, not to mention much better readability. Bug: 30622771 Change-Id: I400839b920c04c67c893899969d07a02d9c1b2e6
Loading
Please register or sign in to comment