bluekitchen / btstack

Dual-mode Bluetooth stack, with small memory footprint.
http://bluekitchen-gmbh.com
Other
1.74k stars 618 forks source link

What‘s W2 or W4 prefix mean? #588

Closed lgnativs closed 7 months ago

lgnativs commented 7 months ago

There are many macro defines prefixes starting with W2 or W4 in the project. I am curious what they mean?

mringwal commented 7 months ago

Hi there. As everything is asynchronous in the stack, many state machines are waiting for something to happen and we use 'W4' = 'wait for' to indicate that. When the event happens, it becomes ready but might not be able to react/send something. Here, we often use 'W2' = 'wait to'.

Feel free to ask on the mailing list.