2 Replies Latest reply on May 27, 2015 11:27 PM by liwanfei

    where is the semaphore setted in app wwd.canned_send from WICED 3.1.2 ?

    liwanfei

      The function host_rtos_get_semaphore from line 118~line 168 of the file(/Wiced-SDK/WICED/RTOS/NoOS/WWD/wwd_rtos.c) in app wwd.canned_send from WICED SDK3.1.2 as following:

       

       

      /**

      * Would normally get a semaphore    

       

      * Since there is only one thread, this function calls the @ref wwd_thread_poll_all to cause Wiced to

      * repeatedly poll and process the Transmit and receive queues, until the given semaphore is

      * set by a function within the transmit/receive processing. Once the set semaphore has been seen,

      * it is decremented back to zero and the function returns to simulate a resuming thread

      * Timeout is ignored in this function.

      *

      * Must not be called from interrupt context.

      *

      * @param semaphore : Pointer to variable which will receive handle of created semaphore

      * @param timeout_ms : unsupported - Maximum period to block for. Can be passed NEVER_TIMEOUT to request no timeout

      * @param will_set_in_isr : True if the semaphore will be set in an ISR. Currently only used for NoOS/NoNS

      *

      * @return wwd_result_t : WWD_SUCCESS if semaphore was successfully acquired

      *                     : WICED_TIMEOUT if semaphore was not acquired before timeout_ms period

      */

       

      wwd_result_t host_rtos_get_semaphore( host_semaphore_type_t* semaphore, uint32_t timeout_ms, wiced_bool_t will_set_in_isr )

      {

      ...

      }

       

      As mentioned above:

      Since there is only one thread, this function calls the @ref wwd_thread_poll_all to cause Wiced to

      * repeatedly poll and process the Transmit and receive queues, until the given semaphore is

      * set by a function within the transmit/receive processing.

       

      I want to know that the parameter semaphore of the funtion is set by which function within the transmit/receive processing? Which line is the semaphore setted at?  The semaphore can NOT get  which at line 640 in the function wwd_result_t wwd_wifi_join from file "/Wiced-SDK/WICED/WWD/internal/wwd_wifi.c" as following:


      result = host_rtos_get_semaphore( &join_sema, DEFAULT_JOIN_TIMEOUT, WICED_FALSE );


      thanks a lot.