#ifndef MODBUS_HANDLER_H
#define MODBUS_HANDLER_H

#include <stdint.h>

#include "config.h"
#include "modbus_master.h"

typedef void (*modbus_value_cb)(uint8_t device_idx, const char* property,
                                uint16_t value);

void modbus_handler_init(modbus_context_t* ctx, modbus_value_cb value_callback);
void modbus_handler_process(void);
uint8_t modbus_handler_send_request(uint8_t device_idx, const char* property,
                                    uint8_t is_write, uint16_t value);

#endif