This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ScanDone signal not received in fi.w1.wpa_supplicant1.Interface

Hi,

I am registering for ScanDone signal in fi.w1.wpa_supplicant1.Interface using dbus_bus_add_match and I am adding a handler for the signal using dbus_connection_add_filter function. But once scan is sent I am not receiving the ScanDone signal. But after a while if i go and read the results the scanned results are available. Am I missing anything to get the signal?

Regards,

Johncy.

  • Hi Johncy,

    It seemed to work for me.
    Can you just do the below?

    # dbus-monitor --system &
    # iw wlan0 scan | grep SSID

    I was getting the below log on my AM335x EVM.

    signal sender=:1.0 -> dest=(null destination) serial=17 path=/fi/w1/wpa_supplicant1/Interfaces/0; interface=fi.w1.wpa_supplicant1.Interface; member=ScanDone
    boolean true

    Can you verify this at your end too?

    Regards,
    Gigi Joseph.

  • Hi Gigi,

    This works. Thanks.

    In my code I am getting the signal now. Based on dbus_monitor code I coded as below.

    Is there any better way than handling in the while loop in the below code.

    My code snippet,

    main()

    {

        dbus_bus_add_match(conn,buf,NULL);
         dbus_connection_flush(conn);
        dbus_connection_add_filter(conn,filter_func,NULL,NULL); //filter_func is the signal handler.

    //Send Scan command to WPA_supplicant in dbus format.

    Then I am waiting in a while loop till the signal handler is called and the ScanDoneHandled flag becomes true which takes out of the loop.

           while (TRUE)
            {
                  dbus_connection_read_write_dispatch(conn,1000);

                    if(ScanDoneHandled)
                        {
                        ScanDoneHandled = FALSE;
                        break;
                        }
            }
    //Send ScanResults command.

    }

  • Hi Johncy,

    I am not an expert in dbus, but wouldn't you get the ScanDone signal in the filter_func()? Or do you want the "Scan" to be synchronous? If yes, then what you have written seems good.

    Regards,
    Gigi Joseph.

  • Hi Gigi,

    Yes I do get the ScanDone signal in the filter_func. In my code I send the scan command and waiting in the while loop untill I get the ScanDone signal. In the filter_func I set the ScanDoneHandled flag. This brings the control out of the while loop. Its like a blocking call where till the scan done signal is received I will not process any other messages. I need something like I should send a scan command and ready to receive messages from other modules. Once scandone signal is received process that and move to receive message state. For now I have moved the signal handling part as a seperate thread which receives the signal and send a message to my module. Is there any other approach?

    Regards,

    Johncy.