4 Replies Latest reply on Jan 31, 2020 8:44 PM by KEKA_4568351

    wiced_wps_enrollee関数実行後の待ち状態から、強制的に終了させたい

    KEKA_4568351

      wiced_wps_enrollee関数実行後のhost_rtos_join_thread関数で、WPS接続待ちとなりますが、

      待ち状態から、強制的に終了する方法はありますか。

       

      【wiced_wps_enrollee API】

      wiced_result_t wiced_wps_enrollee(wiced_wps_mode_t mode, const wiced_wps_device_detail_t* details, const char* password, wiced_wps_credential_t* credentials, uint16_t credential_count)

      {

          wiced_result_t result    = WICED_SUCCESS;

          wps_agent_t*   workspace = (wps_agent_t*) calloc_named("wps", 1, sizeof(wps_agent_t));

       

       

          if ( workspace == NULL )

          {

              return WICED_OUT_OF_HEAP_SPACE;

          }

       

       

          besl_wps_init ( workspace, (besl_wps_device_detail_t*) details, WPS_ENROLLEE_AGENT, WWD_STA_INTERFACE );

          result = (wiced_result_t) besl_wps_start( workspace, (besl_wps_mode_t) mode, password, (besl_wps_credential_t*) credentials, credential_count );

          host_rtos_delay_milliseconds( 10 ); /* Delay required to allow WPS thread to run and initialize */

          if ( result == WICED_SUCCESS )

          {

              besl_wps_wait_till_complete( workspace );                   ★->besl_wps_wait_till_complete call

              result = (wiced_result_t) besl_wps_get_result( workspace );

          }

       

       

          besl_wps_deinit( workspace );

          free( workspace );

          workspace = NULL;

       

       

          return result;

      }

       

       

      besl_result_t besl_wps_wait_till_complete( wps_agent_t* workspace )

      {

          if ( workspace->wps_result != WPS_NOT_STARTED )

          {

              besl_host_workspace_t* host_workspace = &((wps_host_workspace_t*) workspace->wps_host_workspace)->host_workspace;

              host_rtos_join_thread( &host_workspace->thread );           ★Wait for stop!!

          }

          return BESL_SUCCESS;

      }

        • 1. Re: wiced_wps_enrollee関数実行後の待ち状態から、強制的に終了させたい
          KEKA_4568351

          以下の3点で、情報がある方がいたら、お願い致します。

           

          ・wiced_wps_enrollee関数の実行中に、強制的に終了する方法

          ・wiced_wps_enrollee関数の実行に対して、キャンセルする方法

          ・wiced_wps_enrollee関数は、約2分で、タイムアウトとなり、wiced_result_tとしては、ERRORでリターンされるが、

           タイムアウト時間(120sec)を変更する方法

          • 2. Re: wiced_wps_enrollee関数実行後の待ち状態から、強制的に終了させたい
            KEKA_4568351

            <Japanese>

            wiced_wps_enrollee関数実行後のhost_rtos_join_thread関数で、WPS接続待ちとなりますが、待ち状態から、強制的に終了する方法はありますか。

             

            以下の3点で、情報がある方がいたら、お願い致します。

            ・wiced_wps_enrollee関数の実行中に、強制的に終了する方法

            ・wiced_wps_enrollee関数の実行に対して、キャンセルする方法

            ・wiced_wps_enrollee関数は、約2分で、タイムアウトとなり、「wiced_result_t」としては、ERRORでリターンされるが、タイムアウト時間(120sec)を変更する方法

             

            <English>

            After executing the wiced_wps_enrollee function, the host_rtos_join_thread function waits for a WPS connection. Is there any way to forcibly exit from the wait state?

             

            If you have information on the following three points, please give me the information.

            -Method to forcibly terminate while executing the wiced_wps_enrollee function

            -Canceling the execution of the wiced_wps_enrollee function

            -The wiced_wps_enrollee function times out in about 2 minutes, and is returned as ERROR as "wiced_result_t", but the method of changing the timeout time (120 sec)

            • 3. Re: wiced_wps_enrollee関数実行後の待ち状態から、強制的に終了させたい
              GauravS_31

              You can consider reducing the WPS timeout from 2 minutes as shown below:

               

              Go to wiced_wps_thread_main( wwd_thread_arg_t arg ) in wiced_wps.c. Change the 2*MINUTES value in the code statements shown below:

               

              if (( current_time - workspace->start_time ) >= 2 * MINUTES )

               

              time_to_wait = ( 2 * MINUTES ) - ( current_time - workspace->start_time );

               

              time_left = MAX( ( ( 2 * MINUTES ) - ( current_time - workspace->start_time ) )/1000, 0);

               

              This should help reduce the waiting time for wiced_wps_enrollee().

              1 of 1 people found this helpful
              • 4. Re: wiced_wps_enrollee関数実行後の待ち状態から、強制的に終了させたい
                KEKA_4568351

                Thank you very much.

                I understand that changing the timeout can be changed by modifying the wiced_wps_thread_main function (wiced_wps.c).