** Copyright (C) 2001-2025 Zabbix SIA
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
** We use the library go-modbus (goburrow/modbus), which is
** distributed under the terms of the 3-Clause BSD License
** available at https://github.com/goburrow/modbus/blob/master/LICENSE
named "github.com/BurntSushi/locker"
"github.com/goburrow/modbus"
mblib "github.com/goburrow/modbus"
"golang.zabbix.com/sdk/conf"
"golang.zabbix.com/sdk/errs"
"golang.zabbix.com/sdk/plugin"
// Endpoint is a connection string consisting of a protocol scheme, a host address and a port or seral port name and attributes.
Endpoint string `conf:"optional"`
// SlaveID of modbus devices.
SlaveID string `conf:"optional"`
// Timeout of modbus devices.
Timeout int `conf:"optional"`
type PluginOptions struct {
// Sessions stores pre-defined named sets of connections settings.
Sessions map[string]*Session `conf:"optional"`