How can I use <INTERFERENCE_OVERRIDE_MODE> in my application?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
StKi_2157971
Level 3
Level 3
First like received

Hello!

I want to implement <Get/Set INTERFERENCE_OVERRIDE_MODE> in my application.

About that, I found that there is a sample-code in mfg_test.

How can I use <INTERFERENCE_OVERRIDE_MODE> in my application?

In other words, I want to use the below function in my application.

static int wl_interfere_override(void *wl, cmd_t *cmd, char **argv);

Do I have to copy source-codes from mfg_test to my application?

Is there any easy way to use <INTERFERENCE_OVERRIDE_MODE>?

Thanks in advance.

0 Likes
1 Solution
StKi_2157971
Level 3
Level 3
First like received

(Self-answering)

I just solved the problem as below. (in SDK 2.4.0)

wiced_result_t wwd_wifi_set_interference_mode( uint32_t mode )

{

    wiced_buffer_t buffer;

    wiced_result_t retval;

    uint32_t* data;

    data = wiced_get_ioctl_buffer( &buffer, (uint16_t) 4 );

    CHECK_IOCTL_BUFFER( data );

    *data = (uint32_t) mode;

    retval = wiced_send_ioctl( SDPCM_SET, WLC_SET_INTERFERENCE_MODE, buffer, 0, SDPCM_STA_INTERFACE );

    wiced_assert("Failed to wwd_wifi_set_interference_mode\r\n", retval == WICED_SUCCESS);

    return retval;

}

wiced_result_t wwd_wifi_get_interference_mode( uint32_t* mode )

{

    wiced_buffer_t buffer;

    wiced_buffer_t response;

    wiced_result_t result;

    wiced_get_ioctl_buffer( &buffer, (uint16_t) 4 );

       result = wiced_send_ioctl(SDPCM_GET, WLC_GET_INTERFERENCE_MODE, buffer, &response, SDPCM_STA_INTERFACE);

    if ( result != WICED_SUCCESS )

    {

        return WICED_ERROR;

    }

    memcpy( mode, host_buffer_get_current_piece_data_pointer( response ), sizeof(int32_t) );

    host_buffer_release( response, WICED_NETWORK_RX );

    return WICED_SUCCESS;

}

Thanks.

View solution in original post

0 Likes
1 Reply
StKi_2157971
Level 3
Level 3
First like received

(Self-answering)

I just solved the problem as below. (in SDK 2.4.0)

wiced_result_t wwd_wifi_set_interference_mode( uint32_t mode )

{

    wiced_buffer_t buffer;

    wiced_result_t retval;

    uint32_t* data;

    data = wiced_get_ioctl_buffer( &buffer, (uint16_t) 4 );

    CHECK_IOCTL_BUFFER( data );

    *data = (uint32_t) mode;

    retval = wiced_send_ioctl( SDPCM_SET, WLC_SET_INTERFERENCE_MODE, buffer, 0, SDPCM_STA_INTERFACE );

    wiced_assert("Failed to wwd_wifi_set_interference_mode\r\n", retval == WICED_SUCCESS);

    return retval;

}

wiced_result_t wwd_wifi_get_interference_mode( uint32_t* mode )

{

    wiced_buffer_t buffer;

    wiced_buffer_t response;

    wiced_result_t result;

    wiced_get_ioctl_buffer( &buffer, (uint16_t) 4 );

       result = wiced_send_ioctl(SDPCM_GET, WLC_GET_INTERFERENCE_MODE, buffer, &response, SDPCM_STA_INTERFACE);

    if ( result != WICED_SUCCESS )

    {

        return WICED_ERROR;

    }

    memcpy( mode, host_buffer_get_current_piece_data_pointer( response ), sizeof(int32_t) );

    host_buffer_release( response, WICED_NETWORK_RX );

    return WICED_SUCCESS;

}

Thanks.

0 Likes