Beacon Frame Event Handler not triggering

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

cross mob
shedc_3597396
Level 1
Level 1
First like received

Hi,

Using Wiced-Studio 6.2 with the CYW943907AEWVAL1F board, I have the following code for an event handler:

    if (wwd_management_set_event_handler( event_type_trig,

            event_handler, NULL, WICED_STA_INTERFACE ) != WWD_SUCCESS)

        WPRINT_APP_INFO(("\nFailed to set event handlers! \n"));

the events are:

static const wwd_event_num_t event_type_trig[]  = { WLC_E_BEACON_RX, WLC_E_BEACON_FRAME_RX, WLC_E_NONE};

the event handler:

void* event_handler ( const wwd_event_header_t* event_header, const uint8_t* event_data, /*@null@*/ void* handler_user_data )

{

    if (event_header->event_type == WLC_E_BEACON_FRAME_RX)

        WPRINT_APP_INFO(("\nWLC_E_BEACON_FRAME_RX!\n\n"));

    if (event_header->event_type == WLC_E_BEACON_RX)

        WPRINT_APP_INFO(("\nBEACONS received/lost indication !\n\n"));

    WPRINT_APP_INFO(("\nCall back...\n\n"));

    return NULL;

}

The two events are not being triggered at all.

I know the event handler works because when I use this:

static const wwd_event_num_t event_type_trig[]  = {WLC_E_BT_WIFI_HANDOVER_REQ, WLC_E_BCNRX_MSG, WLC_E_BEACON_FRAME_RX,WLC_E_WAKE_EVENT,WLC_E_PROBRESP_MSG,

      WLC_E_ACTION_FRAME,WLC_E_PSK_SUP, WLC_E_PSM_WATCHDOG, WLC_E_WNM_STA_SLEEP, WLC_E_AUTH, WLC_E_BEACON_RX, WLC_E_ASSOC, WLC_E_NONE};

I can see some callbacks.

Thanks

0 Likes
7 Replies
RaktimR_11
Moderator
Moderator
Moderator
500 replies posted 250 replies posted 100 replies posted

The events that you have mentioned (WLC_E_BEACON_RX, WLC_E_BEACON_FRAME_RX) has not been used in the driver implementation ( check  43xxx_Wi-Fi/WICED/internal/wifi.c) where you can find declaration of link_events, ap_client_events etc. That's why you were able to see some callbacks in case of second event_trigger definition and not in the first case.

Could you please provide a little bit information about your end application which requires information about beacon frames?

If you want to check the events generated by the driver while running your application, you can enable the WWD Debug prints (WPRINT_ENABLE_WWD_DEBUG) as mentioned in 43xxx_Wi-Fi/include/wiced_defaults.h and then you can set the handler function accordingly.

We need to keep track all the activities of the wifi driver, including any instances of beacon reception or loss of an expected beacon. We need this feature to troubleshoot the causes of station disassociation from an access point.

0 Likes

To check the station disassociation from an access point, you can enable WPRINT_ENABLE_NETWORK_DEBUG macro in 43xxx_Wi-Fi/include/wiced_defaults.h and you should be able to see the link up, link down events. Does that work for your use-case?

I didn't see anything new when enabling that macro

I have checked these events in snip.apsta where if the AP goes off, you receive a link down event and when the AP comes back up, you can see a link up event. In your test-case, if the STA not getting disassociated from AP, you won't see any.

So in the wifi.c file, I added the BEACON_RX and BEACON_FRAME_RX to the link_events array and added print statements to their cases in the link_events_handler. Nothing changed. Was that what I was supposed to do?

0 Likes

rroy any updates on this?

0 Likes