3.1.6.1 Execution

main.c - Initialize the ATWINC15x0. By default, the device starts in station mode, then switches to AP mode. For details on each mode, refer to the MODE_STA, MODE_AP example.

  1. Code summary:
    • Configure the network parameters in main.h.
      /** Security mode Supported */
      #define USE_WPAPSK		1 /* WPA/WPA2 PSK Security Mode*/
      // #define USE_WEP			2 /* WEP Security Mode*/
      // #define USE_OPEN		3 /* No Security or OPEN Authentication Mode*/
      
      /** AP mode Settings */
      #define MAIN_WLAN_SSID           "WINC1500_AP" /* < SSID */
      #if (defined USE_WPAPSK)
      #define MAIN_WLAN_AUTH           M2M_WIFI_SEC_WPA_PSK /* < Security type */
      #define MAIN_WLAN_WPA_PSK        "1234567890" /* < Security Key in WPA PSK Mode */
      #elif (defined USE_WEP)
      #define MAIN_WLAN_AUTH           M2M_WIFI_SEC_WEP /* < Security type */
      #define MAIN_WLAN_WEP_KEY        "1234567890" /* < Security Key in WEP Mode */
      #define MAIN_WLAN_WEP_KEY_INDEX  (0)
      #elif (defined USE_OPEN)
      #define MAIN_WLAN_AUTH           M2M_WIFI_SEC_OPEN /* < Security type */
      #endif
      #define MAIN_WLAN_CHANNEL        (M2M_WIFI_CH_6) /* < Channel number */
    • AP mode gets enabled in the main() function. For more details, refer to the “How to Run AP mode” example.
      enable_disable_ap_mode();
      nm_bsp_sleep(DELAY_FOR_MODE_CHANGE);    
      
  2. Build the program and download it into the board.
  3. Start the application.