The BLE protocol stack, the profiles, and all applications are all built around the Operating System Abstraction Layer (OSAL). The OSAL is not an actual operating system (OS) in the traditional sense, but rather a control loop that allows software to setup the execution of events. For each layer of software that requires this type of control, a task identifier (ID) must be created, a task initialization routine must be defined and added to the OSAL initialization, and an event processing routine must be defined.
Optionally, a message processing routine may be defined as well. Several layers of the BLE stack, for example, are OSAL tasks, with the LL being the highest priority (since it has very strict timing requirements).
...