wifi11 2.0.0.0
main.c File Reference

Wifi11 Click example. More...

#include "board.h"
#include "log.h"
#include "wifi11.h"
#include "string.h"

Macros

#define APP_OK   0
 
#define APP_ERROR_DRIVER   -1
 
#define APP_ERROR_OVERFLOW   -2
 
#define APP_ERROR_TIMEOUT   -3
 
#define RSP_OK   "OK"
 
#define RSP_ERROR   "ERROR"
 
#define AP_SSID   ""
 
#define AP_PASSWORD   ""
 
#define LOCAL_PORT   1
 
#define PROCESS_BUFFER_SIZE   500
 

Functions

void application_init (void)
 
void application_task (void)
 
int main (void)
 

Detailed Description

Wifi11 Click example.

Description

This example reads and processes data from WiFi 11 clicks.

The demo application is composed of two sections :

Application Init

Initializes the driver and powers up the module, then connects to the desired AP and creates TCP and UDP servers on the desired local port.

Application Task

Logs all the received data and module's responses on the USB UART.

Additional Function

  • static void wifi11_clear_app_buf ( void )
  • static void wifi11_error_check( err_t error_flag )
  • static void wifi11_log_app_buf ( void )
  • static err_t wifi11_rsp_check ( void )
  • static err_t wifi11_process ( void )
Note
In order for the example to work, user needs to set the AP SSID, password, and Local port on which the TCP and UDP servers will be created. Enter valid data for the following macros: AP_SSID, AP_PASSWORD and LOCAL_PORT.
Author
MikroE Team

Macro Definition Documentation

◆ AP_PASSWORD

#define AP_PASSWORD   ""

◆ AP_SSID

#define AP_SSID   ""

◆ APP_ERROR_DRIVER

#define APP_ERROR_DRIVER   -1

◆ APP_ERROR_OVERFLOW

#define APP_ERROR_OVERFLOW   -2

◆ APP_ERROR_TIMEOUT

#define APP_ERROR_TIMEOUT   -3

◆ APP_OK

#define APP_OK   0

◆ LOCAL_PORT

#define LOCAL_PORT   1

◆ PROCESS_BUFFER_SIZE

#define PROCESS_BUFFER_SIZE   500

◆ RSP_ERROR

#define RSP_ERROR   "ERROR"

◆ RSP_OK

#define RSP_OK   "OK"

Function Documentation

◆ application_init()

void application_init ( void )

Logger initialization. Default baud rate: 115200 Default log level: LOG_LEVEL_DEBUG

Note
If USB_UART_RX and USB_UART_TX are defined as HAL_PIN_NC, you will need to define them manually for log to work. See LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( void )

◆ main()

int main ( void )