esp8684 2.1.0.0
|
ESP8684 Click Example. More...
#include "board.h"
#include "log.h"
#include "esp8684.h"
#include "string.h"
#include "conversions.h"
Macros | |
#define | PROCESS_BUFFER_SIZE 200 |
#define | ESP8684_SSID "MikroE Public" |
#define | ESP8684_PASSWORD "mikroe.guest" |
#define | ESP8684_DATA "MikroE ESP8684 Click" |
#define | REMOTE_IP "77.46.162.162" |
#define | REMOTE_PORT "51111" |
#define | TCP_LINK_ID "0" |
#define | UDP_LINK_ID "1" |
Functions | |
void | esp8684_clear_app_buf (void) |
ESP8684 clearing application buffer. | |
void | esp8684_log_app_buf (void) |
ESP8684 log application buffer. | |
err_t | esp8684_process (void) |
ESP8684 data reading function. | |
err_t | esp8684_rsp_check (uint8_t *response) |
ESP8684 response check function. | |
void | esp8684_error_check (err_t error_flag) |
ESP8684 error check function. | |
void | esp8684_send_message (uint8_t *link_id, uint8_t *message) |
ESP8684 send message function. | |
void | esp8684_con_device_to_network (void) |
ESP8684 connect device to the network. | |
void | esp8684_send_data (void) |
ESP8684 send message to the host. | |
void | application_init (void) |
void | application_task (void) |
int | main (void) |
Variables | |
esp8684_t | esp8684 |
log_t | logger |
uint8_t | app_buf [PROCESS_BUFFER_SIZE] = { 0 } |
int32_t | app_buf_len = 0 |
err_t | app_error_flag |
ESP8684 Click Example.
This example connects to the desired WiFi network and then connects to the TCP/UDP server, writes then reads data to and from it.
The demo application is composed of two sections :
Initializes driver and wifi communication, then connects to the desired WiFi network and sends data to the TCP/UDP server.
Writes and reads data from TCP/UDP server, processes all incoming data and displays them on the USB UART.
#define ESP8684_DATA "MikroE ESP8684 Click" |
#define ESP8684_PASSWORD "mikroe.guest" |
#define ESP8684_SSID "MikroE Public" |
#define PROCESS_BUFFER_SIZE 200 |
#define REMOTE_IP "77.46.162.162" |
#define REMOTE_PORT "51111" |
#define TCP_LINK_ID "0" |
#define UDP_LINK_ID "1" |
void application_init | ( | void | ) |
< Logger config object.
< Click config object.
Logger initialization. Default baud rate: 115200 Default log level: LOG_LEVEL_DEBUG
void application_task | ( | void | ) |
void esp8684_clear_app_buf | ( | void | ) |
ESP8684 clearing application buffer.
This function clears memory of application buffer and reset its length.
void esp8684_con_device_to_network | ( | void | ) |
ESP8684 connect device to the network.
This function is used to connect device to network.
void esp8684_error_check | ( | err_t | error_flag | ) |
ESP8684 error check function.
This function checks if error has occurred.
[in] | error_flag | : Data to be checked. |
void esp8684_log_app_buf | ( | void | ) |
ESP8684 log application buffer.
This function logs application buffer and reset its length.
err_t esp8684_process | ( | void | ) |
ESP8684 data reading function.
This function reads data from device and concatenates data to application buffer.
0
- Read some data. -1
- Nothing is read. See #err_t definition for detailed explanation. err_t esp8684_rsp_check | ( | uint8_t * | response | ) |
ESP8684 response check function.
This function checks the response of the sent command.
[in] | response | : Expected response. |
0
- Responded as expected. -1
- The response isn't the same.. See #err_t definition for detailed explanation. void esp8684_send_data | ( | void | ) |
ESP8684 send message to the host.
This function is used to send messages to the host.
void esp8684_send_message | ( | uint8_t * | link_id, |
uint8_t * | message ) |
ESP8684 send message function.
This function is used to send messages to the host.
[in] | link_id | : Host link id. |
[in] | message | : Message to be sent. |
int main | ( | void | ) |
uint8_t app_buf[PROCESS_BUFFER_SIZE] = { 0 } |
int32_t app_buf_len = 0 |
err_t app_error_flag |
esp8684_t esp8684 |
log_t logger |