#include <stdlib.h>
#include "udp_handler.h"
#include "json_handler.h"
#include "tcp_handler.h"
#include "logger.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_system.h"
#include "freertos/queue.h"
#include "freertos/event_groups.h"
#include "freertos/semphr.h"
#include "esp_err.h"
#include "protocol_examples_common.h"
Go to the source code of this file.
◆ MESSAGE_QUEUE_SIZE
#define MESSAGE_QUEUE_SIZE CONFIG_MESSAGE_QUEUE_SIZE |
◆ init_queue()
esp_err_t init_queue |
( |
void |
| ) |
|
Initialises message queue.
- Returns
- esp_err_t ESP_OK - if queue init sucessfully, ESP_FAIL - if queue init failed
◆ init_transport()
void init_transport |
( |
void |
| ) |
|
Initialises transport, i.e. connect to wifi.
◆ pid_const_read()
Returns pid_const_data struct. Checks if the resource is blocked by mutex for writing or it is accessible, waits till pid_const_data is accessible and returns it.
- Returns
- struct pid_const - Returns pid_const_data, can be used to access Kp, Ki, Kd and current values
◆ pid_const_transport()
void pid_const_transport |
( |
| ) |
|
Handles TCP client, which receives pid_constants from server, and parses the data and stores it in a global struct pid_const_data.
◆ pid_transport()
Handles UDP client, which sends pid_terms received through message queue.
◆ receive_from_queue()
◆ send_to_queue()
esp_err_t send_to_queue |
( |
struct pid_terms |
pid_data | ) |
|
Sends pid_data struct to message queue.
- Parameters
-
- Returns
- esp_err_t ESP_OK - if queue init sucessfully, ESP_FAIL - if queue init failed
◆ pid_const_data
◆ pid_const_read_write_mutex
SemaphoreHandle_t pid_const_read_write_mutex |
◆ pid_const_transport_handle
TaskHandle_t pid_const_transport_handle |
◆ pid_struct_queue
QueueHandle_t pid_struct_queue |
◆ pid_transport_handle
TaskHandle_t pid_transport_handle |