2 Replies Latest reply on Oct 22, 2015 12:01 PM by userc_21822

    wiced_join_ap_specific ignores BSSID

      Hi

      I am trying to use the following function to connect an emw3165 to a AP with static setup (no need to do a scan):

      static int wifi_join_specific(wiced_interface_t interface, char* ssid, wiced_security_t auth_type, uint8_t* security_key, uint16_t key_length, char* bssid, char* channel, char* ip, char* netmask, char* gateway)

      {

        wiced_network_config_t network_config;

          wiced_ip_setting_t static_ip_settings;

          wiced_scan_result_t ap;


          memset( &ap, 0, sizeof( ap ) );

          ap.SSID.length = strlen( ssid );

          memcpy( ap.SSID.value, ssid, ap.SSID.length );

          str_to_mac( bssid, &ap.BSSID );

          ap.channel = atoi( channel );

          ap.security = auth_type;

          ap.band = WICED_802_11_BAND_2_4GHZ;

          ap.bss_type = WICED_BSS_TYPE_ADHOC;

       

       

          if ( !( NULL_MAC(ap.BSSID.octet) ) && wiced_join_ap_specific( &ap, key_length, security_key ) == WWD_SUCCESS )

          {

              /* Tell the network stack to setup it's interface */

              if (ip == NULL )

              {

                  network_config = WICED_USE_EXTERNAL_DHCP_SERVER;

              }

              else

              {

                  network_config = WICED_USE_STATIC_IP;

                  str_to_ip( ip,      &static_ip_settings.ip_address );

                  str_to_ip( netmask, &static_ip_settings.netmask );

                  str_to_ip( gateway, &static_ip_settings.gateway );

              }

       

              if ( wiced_ip_up( interface, network_config, &static_ip_settings ) == WICED_SUCCESS )

              {

                  return WICED_SUCCESS;

              }

          }

          return WICED_ERROR;

      }

       

      There are two problems:

      1) the function always returns WICED_SUCCESS even if the AP is down.

      2) The BSSID of the connection (read out using wwd_wifi_get_ap_info) is sometimes changed to a random BSSID (always if the AP is down)

       

      Any thoughts?

       

      Regards

       

      Jakob