#include <string.h>
#include <sys/param.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"
#include "esp_system.h"
#include "esp_wifi.h"
#include "esp_event.h"
#include "esp_log.h"
#include "nvs_flash.h"
#include "esp_netif.h"
#include "protocol_examples_common.h"
#include "lwip/err.h"
#include "lwip/sockets.h"
#include "lwip/sys.h"
#include <lwip/netdb.h>
Go to the source code of this file.
◆ HOST_IP_ADDR
#define HOST_IP_ADDR CONFIG_SERVER_IP_ADDRESS |
◆ PORT
#define PORT CONFIG_SERVER_PORT |
◆ close_network_manager()
Shutdown active connection, deallocate memory.
- Parameters
-
- Returns
- void
◆ network_manager()
Manages UDP connection to the server.
- Parameters
-
nm | network_data struct which contains necessary data for a UDP connection |
- Returns
- void
◆ receive_data()
Receives data from UDP server.
- Parameters
-
- Returns
- char array which contains data received
◆ send_data()
Sends data to the server through a UDP socket.
- Parameters
-
nm | A pointer to network_data struct |
payload | char array which contains data to be sent |
- Returns
- int - returns -1 if sending failed, number of bytes sent if successfully sent the data