Beispiel #1
0
wwd_result_t wwd_wifi_ap_init( wiced_ssid_t* ssid, wiced_security_t auth_type, const uint8_t* security_key, uint8_t key_length, uint8_t channel )
{
    wwd_result_t result;

    /* Keep WLAN awake while setting up softAP */
    WWD_WLAN_KEEP_AWAKE( );

    result = internal_ap_init( ssid, auth_type, security_key, key_length, channel );

    WWD_WLAN_LET_SLEEP( );

    return result;
}
wwd_result_t wwd_wifi_read_wlan_log( char* buffer, uint32_t buffer_size )
{
    wwd_result_t result;
    uint32_t wlan_shared_address;

    /* Backplane access needs HT clock. So, disabling bus sleep */
    WWD_WLAN_KEEP_AWAKE();

    /* FW populates the last word of RAM with wlan_shared_t struct address */
    if ( wwd_is_fw_sr_capable() == WICED_TRUE )
    {
        wlan_shared_address = PLATFORM_WLAN_RAM_BASE + PLATFORM_WLAN_RAM_SIZE - SOCSRAM_SRMEM_SIZE - 4;
    }
    else
    {
        wlan_shared_address = PLATFORM_WLAN_RAM_BASE + PLATFORM_WLAN_RAM_SIZE - 4;
    }

    result = wwd_wifi_read_wlan_log_unsafe( wlan_shared_address, buffer, buffer_size );

    WWD_WLAN_LET_SLEEP();

    return result;
}
Beispiel #3
0
wiced_result_t wiced_wlu_server_serial_start( wiced_uart_t uart_id )
{
    wiced_assert("wlu_server already started",
            (wlu_server.started == WICED_FALSE));

    wlu_server.started = WICED_TRUE;
    wlu_server.uart_id = uart_id;

    WWD_WLAN_KEEP_AWAKE( );

    if ( uart_id != STDIO_UART )
    {
        static const platform_uart_config_t uart_config =
        {
            .baud_rate    = 115200,
            .data_width   = DATA_WIDTH_8BIT,
            .parity       = NO_PARITY,
            .stop_bits    = STOP_BITS_1,
            .flow_control = FLOW_CONTROL_DISABLED,
        };

        WICED_VERIFY( wiced_uart_init( uart_id, &uart_config, NULL ) );
    }
    /* Start wlu server thread */
    wiced_rtos_create_thread(&wlu_server.thread, WLU_SERVER_THREAD_PRIORITY, "wlu_server", wlu_server_thread, WLU_SERVER_STACK_SIZE, &wlu_server);
    return WICED_SUCCESS;
}

wiced_result_t wiced_wlu_server_serial_stop( void )
{
    if ( wiced_rtos_is_current_thread( &wlu_server.thread ) != WICED_SUCCESS )
    {
        wiced_rtos_thread_force_awake( &wlu_server.thread );
        wiced_rtos_thread_join( &wlu_server.thread );
        wiced_rtos_delete_thread( &wlu_server.thread );
    }
    WWD_WLAN_LET_SLEEP( );
    wlu_server.started = WICED_FALSE;
    return WICED_SUCCESS;
}

static void wlu_server_thread( uint32_t thread_input )
{
    wiced_wlu_server_t* wlu = (wiced_wlu_server_t*) thread_input;
    int argc = 2;
    char *argv[] = { (char*)wlu->uart_id, "" };
#ifdef  RWL_SOCKET
    char *arge[] = { (char *)wlu->eth_port, "" };
#endif


    wiced_assert( "invalid argument", wlu->uart_id < WICED_UART_MAX );

    UNUSED_PARAMETER(thread_input);

#ifdef  RWL_SOCKET
    if (wlu->eth_started ==  WICED_TRUE)
#endif
    {
#ifdef  RWL_SOCKET
        remote_server_exec( argc, (wlu->eth_started ==  WICED_TRUE)?arge:argv, NULL );
#else
        remote_server_exec(argc, argv, NULL);
#endif


    }
}