====== OSA : OS_Bsem_Check ======
**[[en:osa:ref:description:data_types#OST_WORD|OST_WORD]] OS_Bsem_Check (bsem)**\\
**[[en:osa:ref:description:data_types#OST_WORD|OST_WORD]] bool OS_Bsem_Check_I (bsem)**\\
=== ===
Check if binary semaphore is set. Returns value of type [[en:osa:ref:description:data_types#OST_WORD|OST_WORD]].
=== Call allowed: ===
Everywhere
=== Parameters: ===
{| class = "fpl"
|-
|//''bsem''//
|Binary semaphore's ID. Number of binary semaphores is set by ##[[en:osa:ref:appendix:configuration#Data contents|OS_BSEMS]]## constant in ##[[en:osa:ref:appendix:configuration|OSAcfg.h]]##
|}
=== Returns: ===
{| class = "fpl"
|-
|//''==0''//
| Semaphore is not set
|-
|//''!=0''//
| Semaphore is set
|}
=== Example: ===
#define BS_DATA_RECEIVED 3
void Task (void)
{
for (;;) {
/*...*/
// Is semaphore set by other task?
if (OS_Bsem_Check(BS_DATA_RECEIVED)) {
// Work with received data
/*...*/
}
/*...*/
}
}
=== Old style name ===
**OS_CheckBSem**\\
=== See also ===
* [[en:osa:ref:allservices:OS_Bsem_Set|OS_Bsem_Set]]
* [[en:osa:ref:allservices:OS_Bsem_Reset|OS_Bsem_Reset]]
* [[en:osa:ref:allservices:OS_Bsem_Switch|OS_Bsem_Switch]]
* [[en:osa:ref:allservices:OS_Bsem_Wait|OS_Bsem_Wait]]
* [[en:osa:ref:allservices:OS_Bsem_Wait_TO|OS_Bsem_Wait_TO]]
----
* [[en:osa:ref:services:alphabetical|Alphabetical]]
* [[en:osa:ref:services:brieflist|All services]]
~~UP~~