/**
 * @file mb_tcp_server.hpp
 * @author David Stejskal (xstejs30@stud.feec.vutbr.cz)
 * @brief Implementation of common functions for Modbus TCP server
 * @version 1.0
 * @date 2021-05-21
 * 
 * @copyright Copyright (c) 2021
 * 
 */

#ifndef __MB_TCP_SERVER_HPP__
#define __MB_TCP_SERVER_HPP__
#include "modbus_data_types.hpp"	// for modbus data types definitions

class mb_tcp_server
{

/**
 * @brief Initialization of Modbus TCP server
 * 
 */
void mb_server_init(void);

/**
 * @brief Set up the register values into known state
 * 
 */
void setup_reg_data(void);

/**
 * @brief Modbus TCP server operation
 * 
 * @param arg 
 */
void mb_server_operation(void *arg);

/**
 * @brief Stop the Modbus TCP server
 * 
 */
void mb_server_stop(void);

/**
 * @brief Initialization of NVS Flash
 * 
 */
void nvs_flash_initialization(void);

}; /* mb_tcp_server */


// /**
// * @brief Modbus event declarations
// *
// */
// enum class EMb_event_t : uint32_t
// {
//     MODBUS_EVENT_START,		/*!< Modbus driver start */
//     MODBUS_EVENT_STOP		/*!< Modbus driver stop */
// };

// /**
//  * @brief Event handler for Modbus events
//  * 
//  * @param arg 
//  * @param event_base 
//  * @param event_id 
//  * @param event_data 
//  */
// void mb_event_handler(void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data);

// /**
// * @brief Modbus event base declaration
// *
// */
// ESP_EVENT_DECLARE_BASE(MB_EVENT);

#endif /* __MB_TCP_SERVER_HPP__ */