This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to get Semaphore_Handle ?

Other Parts Discussed in Thread: SYSBIOS

I use semaphore_params and call Semaphore_construct() create semaphore

Semaphore_Params semParams;
Semaphore_Params_init(&semParams);
semParams.mode = Semaphore_Mode_BINARY;
Semaphore_construct(&semScTaskAlert, 0, &semParams);

I also need a queue to use. So I construct queue by using

  uartMsgQueue = Util_constructQueue(&uartMsg);

Now I want to enqueue, by calling:

Util_enqueueMsg(uartMsgQueue, semScTaskAlert  , (uint8*)pMsg);

But semScTaskAlert is Semaphore_Struct type not Semaphore_Handle type, how can I get correct Semaphore_Handle for this case?

  • Barbara,

    You get the handle by using the function Semaphore_handle(&semScTaskAlert) which casts the pointer to the semaphore to a handle.
    The API is well documented and in your case (using the BLE 2.0 stack) found at the following location:
    C:/ti/tirtos_simplelink_2_11_01_09/products/bios_6_41_02_41/docs/cdoc/index.html

    Click through the API to ti.sysbios.knl->Semaphore to see all available functions.

    Regards,
    Svend