// 文件名: src/modbus/generic_modbus_parser.h #ifndef GENERIC_MODBUS_PARSER_H #define GENERIC_MODBUS_PARSER_H #include "modbus_common.h" #include #include #include class GenericModbusParser { public: /** * @brief 将从Modbus设备读取的原始寄存器映射,根据配置解析成JSON对象 * @param registers_map 以地址为键,原始寄存器值为值的map * @param data_points 描述如何解析这些寄存器的配置列表 * @return 包含所有解析后数据的 nlohmann::json 对象 */ static nlohmann::json parse(const std::map& registers_map, const std::vector& data_points); }; #endif // GENERIC_MODBUS_PARSER_H