9#ifndef LIBE3_JSON_ENCODER_HPP
10#define LIBE3_JSON_ENCODER_HPP
13#include <nlohmann/json.hpp>
41 nlohmann::json encode_setup_request(
const SetupRequest& req)
const;
42 nlohmann::json encode_setup_response(
const SetupResponse& resp)
const;
46 std::optional<nlohmann::json> encode_indication_message(
const IndicationMessage& msg)
const;
48 nlohmann::json encode_dapp_report(
const DAppReport& report)
const;
50 nlohmann::json encode_release_message(
const ReleaseMessage& msg)
const;
51 nlohmann::json encode_message_ack(
const MessageAck& ack)
const;
54 SetupRequest decode_setup_request(
const nlohmann::json& j)
const;
55 SetupResponse decode_setup_response(
const nlohmann::json& j)
const;
59 IndicationMessage decode_indication_message(
const nlohmann::json& j,
const std::string& raw_json)
const;
61 DAppReport decode_dapp_report(
const nlohmann::json& j)
const;
63 ReleaseMessage decode_release_message(
const nlohmann::json& j)
const;
64 MessageAck decode_message_ack(
const nlohmann::json& j)
const;
67 static std::string binary_to_hex(
const std::vector<uint8_t>& data);
68 static std::vector<uint8_t> hex_to_binary(
const std::string& hex);
71 std::optional<PduType> string_to_pdu_type(
const std::string& s)
const;
72 ErrorCode string_to_error_code(
const std::string& s)
const;
E3Encoder(const E3Encoder &)=delete
~JsonE3Encoder() override=default
EncodeResult< Pdu > decode(const EncodedMessage &encoded) override
Decode bytes to a PDU.
EncodingFormat format() const noexcept override
Get the encoding format.
EncodeResult< EncodedMessage > encode(const Pdu &pdu) override
Encode a PDU to bytes.
Abstract E3 Encoder interface for PDU encoding/decoding.
ErrorCode
Error codes returned by libe3 operations Use shared error-code list (see libe3/error_codes....
EncodingFormat
E3AP encoding formats supported by the library.
@ JSON
JSON encoding (for development/debugging).
tl::expected< T, ErrorCode > EncodeResult
Result type for encoding/decoding operations.
E3AP dApp Control Action structure.
E3AP dApp Report structure.
E3AP Indication Message structure.
E3AP Message Acknowledgment structure.
Generic E3AP PDU structure.
E3AP Release Message structure.
E3AP Setup Request structure.
E3AP Setup Response structure.
E3AP Subscription Delete structure.
E3AP Subscription Request structure.
E3AP Subscription Response structure.
E3AP xApp Control Action structure.