2026-04-03 16:23:56 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <cstddef>
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
|
|
|
|
|
#include <QByteArray>
|
|
|
|
|
#include <QString>
|
|
|
|
|
|
2026-04-07 14:20:04 +08:00
|
|
|
#include "plugins/protocols/modbusrtu/types/ModbusRtuPdu.h"
|
2026-04-03 16:23:56 +08:00
|
|
|
|
|
|
|
|
namespace softbus::message_bus::pipeline
|
|
|
|
|
{
|
|
|
|
|
enum class BusDirection;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
namespace softbus::message_bus::pipeline::protocol
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
bool decodeModbusRtu(softbus::message_bus::pipeline::BusDirection dir,
|
|
|
|
|
const std::uint8_t* p,
|
|
|
|
|
std::size_t n,
|
|
|
|
|
ModbusRtuPdu& out,
|
|
|
|
|
QString* errMsg = nullptr);
|
|
|
|
|
|
|
|
|
|
bool encodeModbusRtu(const ModbusRtuPdu& pdu, QByteArray& out, QString* errMsg = nullptr);
|
|
|
|
|
|
|
|
|
|
} // namespace softbus::message_bus::pipeline::protocol
|