wifi8  2.0.0.0
Data Structures | Macros | Typedefs | Functions | Variables
main.c File Reference

WiFi8 Click example. More...

#include "board.h"
#include "log.h"
#include "wifi8.h"

Data Structures

struct  s_msg_wifi_product
 

Macros

#define MAIN_WLAN_SSID   "MikroE Public" /* < Destination SSID */
 
#define MAIN_WLAN_AUTH   M2M_WIFI_SEC_WPA_PSK /* < Security type */
 
#define MAIN_WLAN_PSK   "mikroe.guest" /* < Password for Destination SSID */
 

Typedefs

typedef struct s_msg_wifi_product t_msg_wifi_product
 

Functions

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

Variables

struct wifi8_sockaddr_in_t addr
 

Detailed Description

WiFi8 Click example.

Description

This application showcases capability of the WiFi 8 Click board. It initializes device, connects to local WiFi. Creates TCP, waits for connection and logs every message it receives for clients when it receives CR or LF flag it returns message back to Client.

The demo application is composed of two sections :

Application Init

Initializes Host logger, and communication module and pins. Then resets device and initializes devices firmware. If no error occurred it sets callback functions for WiFi and TCP socket, and checks current firmware version. After firmware is read it connects to local WiFi network set by user. When connected it initializes and creates socket.

Application Task

It loops function for handleing events. Should notify and log messages when Client is connected/disconnected to TCP server and returns back when receives CR or LF flag.

note: User should set MAIN_WLAN_SSID and MAIN_WLAN_PSK for connecting to local network. When devices connects to network it will log it's IP that user need to connect to. After user connects it should get notification and it can send data to server. Server will return message "WiFi 8 Click" when Client sends CR or LF character in message.

Author
Luka Filipovic

Macro Definition Documentation

◆ MAIN_WLAN_AUTH

#define MAIN_WLAN_AUTH   M2M_WIFI_SEC_WPA_PSK /* < Security type */

◆ MAIN_WLAN_PSK

#define MAIN_WLAN_PSK   "mikroe.guest" /* < Password for Destination SSID */

◆ MAIN_WLAN_SSID

#define MAIN_WLAN_SSID   "MikroE Public" /* < Destination SSID */

Wi-Fi Settings

Typedef Documentation

◆ t_msg_wifi_product

Function Documentation

◆ application_init()

void application_init ( void  )

◆ application_task()

void application_task ( void  )

◆ main()

void main ( void  )

Variable Documentation

◆ addr

struct wifi8_sockaddr_in_t addr