- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- Permalink
- 印刷
- 不適切なコンテンツを報告
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;
}
解決済! 解決策の投稿を見る。
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- Permalink
- 印刷
- 不適切なコンテンツを報告
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().