2021-05-27 10:59:22 -04:00
|
|
|
|
/*
|
|
|
|
|
sdt.h
|
|
|
|
|
|
|
|
|
|
Copyright (c) 2020 Kevin Matz (kevin.matz@gmail.com)
|
|
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in all
|
|
|
|
|
copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
|
SOFTWARE.
|
|
|
|
|
*/
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2022-11-30 09:52:25 -05:00
|
|
|
|
#include "pdu.h"
|
|
|
|
|
#include "sdt/udp.h" // EPI 18
|
2021-08-18 16:55:57 -04:00
|
|
|
|
|
2022-11-15 11:32:29 -05:00
|
|
|
|
/**
|
|
|
|
|
* @brief @cite SDT ANSI E1.17- 2015, Architecture for Control Networks–
|
|
|
|
|
* Session Data Transport Protocol
|
|
|
|
|
*/
|
2021-08-24 18:10:20 -04:00
|
|
|
|
namespace ACN::SDT {
|
2021-05-27 10:59:22 -04:00
|
|
|
|
|
2021-07-30 09:11:32 -04:00
|
|
|
|
/**
|
2021-08-18 16:55:57 -04:00
|
|
|
|
* @brief 7.1 Protocol Code
|
2021-07-30 09:11:32 -04:00
|
|
|
|
*/
|
2021-08-18 16:55:57 -04:00
|
|
|
|
static const uint32_t SDT_PROTOCOL_ID = 1; // PDU protocol value
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief SDT vector codes
|
|
|
|
|
*/
|
|
|
|
|
const static uint8_t REL_WRAP = 1; //!< 4.4 SDT Base Layer Message
|
|
|
|
|
const static uint8_t UNREL_WRAP = 2; //!< 4.4 SDT Base Layer Message
|
|
|
|
|
const static uint8_t CHANNEL_PARAMS = 3; //!< 4.5 SDT Wrapped Messages
|
|
|
|
|
const static uint8_t JOIN = 4; //!< 4.4 SDT Base Layer Message
|
|
|
|
|
const static uint8_t JOIN_REFUSE = 5; //!< 4.4 SDT Base Layer Message
|
|
|
|
|
const static uint8_t JOIN_ACCEPT = 6; //!< 4.4 SDT Base Layer Message
|
|
|
|
|
const static uint8_t LEAVE = 7; //!< 4.4 SDT Base Layer Message
|
|
|
|
|
const static uint8_t LEAVING = 8; //!< 4.5 SDT Wrapped Messages
|
|
|
|
|
const static uint8_t CONNECT = 9; //!< 4.5 SDT Wrapped Messages
|
|
|
|
|
const static uint8_t CONNECT_ACCEPT = 10; //!< 4.5 SDT Wrapped Messages
|
|
|
|
|
const static uint8_t CONNECT_REFUSE = 11; //!< 4.5 SDT Wrapped Messages
|
|
|
|
|
const static uint8_t DISCONNECT = 12; //!< 4.5 SDT Wrapped Messages
|
|
|
|
|
const static uint8_t DISCONNECTING = 13; //!< 4.5 SDT Wrapped Messages
|
|
|
|
|
const static uint8_t ACK = 14; //!< 4.5 SDT Wrapped Messages
|
|
|
|
|
const static uint8_t NAK = 15; //!< 4.4 SDT Base Layer Message
|
|
|
|
|
const static uint8_t GET_SESSIONS = 16; //!< 4.4 SDT Base Layer Message
|
|
|
|
|
const static uint8_t SESSIONS = 17; //!< 4.4 SDT Base Layer Message
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Table 6: Reason Codes
|
|
|
|
|
*/
|
|
|
|
|
const static uint8_t NONSPECIFIC = 1; //!< Non-specific, non-SDT reason.
|
|
|
|
|
const static uint8_t ILLEGAL_PARAMETERS = 2; //!< Illegal channel parameters.
|
|
|
|
|
const static uint8_t LOW_RESOURCES = 3; //!< Insufficient resources.
|
|
|
|
|
const static uint8_t ALREADY_MEMBER = 4; //!< Multiple MIDs for single component.
|
|
|
|
|
const static uint8_t BAD_ADDRESS_TYPE = 5; //!< Unrecognized transport address type.
|
|
|
|
|
const static uint8_t NO_RECIPROCAL_CHANNEL = 6; //!< No upstream channel and can’t create one
|
|
|
|
|
const static uint8_t CHANNEL_EXPIRED = 7; //!< Channel has expired.
|
|
|
|
|
const static uint8_t LOST_SEQUENCE = 8; //!< Unrecoverable packets missed.
|
|
|
|
|
const static uint8_t SATURATED = 9; //!< Can’t keep up, processor saturation.
|
|
|
|
|
const static uint8_t TRANSPORT_ADDRESS_CHANGING = 10; //!< (e.g., IP number lease expired).
|
|
|
|
|
const static uint8_t ASKED_TO_LEAVE = 11; //!< Asked to leave the channel.
|
|
|
|
|
const static uint8_t NO_RECIPIENT = 12; //!< Component does not support protocol ID.
|
|
|
|
|
const static uint8_t ONLY_UNICAST_SUPPORTED = 13; //!< Only unicast channels are supported
|
2021-05-27 10:59:22 -04:00
|
|
|
|
|
2021-07-30 09:11:32 -04:00
|
|
|
|
|
|
|
|
|
/**
|
2021-08-18 16:55:57 -04:00
|
|
|
|
* @brief Table 7: Address Specification Types
|
2021-07-30 09:11:32 -04:00
|
|
|
|
*/
|
2022-06-04 10:49:24 -04:00
|
|
|
|
enum ip_addr_spec : uint8_t {
|
2021-08-18 16:55:57 -04:00
|
|
|
|
SDT_ADDR_NULL = 0, //!< Address is not present (0 octets).
|
|
|
|
|
SDT_ADDR_IPV4 = 1, //!< Address specified is in IP v4 format
|
|
|
|
|
SDT_ADDR_IPV6 = 2 //!< Address specified is in IP v6 format
|
2021-05-27 10:59:22 -04:00
|
|
|
|
};
|
|
|
|
|
|
2021-07-30 09:11:32 -04:00
|
|
|
|
|
2021-08-18 16:55:57 -04:00
|
|
|
|
/// 3.5.1.1 Member Identifiers
|
2021-05-27 10:59:22 -04:00
|
|
|
|
using MID = uint16_t;
|
|
|
|
|
|
2021-07-30 09:11:32 -04:00
|
|
|
|
|
2021-08-18 16:55:57 -04:00
|
|
|
|
namespace CLIENT {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief The CLIENT::Pdu class
|
|
|
|
|
*/
|
|
|
|
|
class Pdu
|
|
|
|
|
: public PDU::Pdu
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
Pdu();
|
|
|
|
|
void iStream(PDU::Stream) override;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 4.4.7 SDT Client Block
|
|
|
|
|
*/
|
|
|
|
|
struct client_header
|
|
|
|
|
: PDU::pdu_header
|
|
|
|
|
{
|
2021-08-25 17:20:33 -04:00
|
|
|
|
uint32_t protocol; //!< protocol number
|
|
|
|
|
uint16_t association; //!< association
|
2021-08-18 16:55:57 -04:00
|
|
|
|
|
|
|
|
|
size_t streamSize() const override { return 6; };
|
|
|
|
|
void iStream(PDU::Stream) override;
|
|
|
|
|
void oStream(PDU::Stream) const override;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace CLIENT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief The SDT::Pdu class
|
|
|
|
|
*/
|
|
|
|
|
class Pdu
|
|
|
|
|
: public PDU::Pdu
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
Pdu();
|
|
|
|
|
void iStream(PDU::Stream) override;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-07-30 09:11:32 -04:00
|
|
|
|
/**
|
|
|
|
|
* @brief 4.4.1.2 Channel Parameter Block
|
|
|
|
|
*/
|
2021-08-18 16:55:57 -04:00
|
|
|
|
struct params
|
2023-04-02 13:24:55 -04:00
|
|
|
|
: streamable
|
2021-08-15 23:36:29 -04:00
|
|
|
|
{
|
2021-08-18 16:55:57 -04:00
|
|
|
|
uint8_t Expiry; //!< number of seconds without traffic before leaving
|
|
|
|
|
union {
|
|
|
|
|
uint8_t flags = 0; //!< packed field of parameter flags
|
|
|
|
|
struct {
|
|
|
|
|
uint8_t reserved : 7;
|
|
|
|
|
bool NAK_Outbound : 1; //!< NAK to channel (true) or destination address (false)
|
|
|
|
|
};
|
2021-05-27 10:59:22 -04:00
|
|
|
|
};
|
2021-08-18 16:55:57 -04:00
|
|
|
|
|
|
|
|
|
uint16_t NAKholdoff; //!< calculation of a standoff time for sending NAKs
|
|
|
|
|
uint16_t NAKmodulus; //!< calculation of a standoff time for sending NAKs
|
|
|
|
|
uint16_t NAKmaxwait; //!< maximum milliseconds to wait before sending a NAK.
|
|
|
|
|
|
|
|
|
|
size_t streamSize() const override { return 8; }
|
|
|
|
|
void iStream(PDU::Stream) override;
|
|
|
|
|
void oStream(PDU::Stream) const override;
|
2021-05-27 10:59:22 -04:00
|
|
|
|
};
|
|
|
|
|
|
2021-07-30 09:11:32 -04:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 4.4.1 Join
|
|
|
|
|
*/
|
2021-08-18 16:55:57 -04:00
|
|
|
|
struct join_data
|
2021-08-15 23:36:29 -04:00
|
|
|
|
: PDU::pdu_data
|
|
|
|
|
{
|
2021-08-25 17:20:33 -04:00
|
|
|
|
UUID::uuid cid; //!< component UUID
|
|
|
|
|
MID mid; //!< message ID
|
|
|
|
|
uint16_t channel; //!< channel number
|
|
|
|
|
uint16_t reciprocal; //!< reciprocol channel
|
|
|
|
|
uint32_t sequence; //!< sequence number
|
|
|
|
|
uint32_t reliable; //!< reliable number
|
|
|
|
|
UDP::ipAddress destination; //!< destination IP address
|
|
|
|
|
params parameters; //!< parameters
|
|
|
|
|
uint8_t expiry; //!< expiry timeout
|
2021-08-15 23:36:29 -04:00
|
|
|
|
|
2021-08-18 16:55:57 -04:00
|
|
|
|
size_t streamSize() const override;
|
2021-07-29 19:26:49 -04:00
|
|
|
|
void iStream(PDU::Stream) override;
|
2021-08-18 16:55:57 -04:00
|
|
|
|
void oStream(PDU::Stream) const override;
|
2021-05-27 10:59:22 -04:00
|
|
|
|
};
|
|
|
|
|
|
2021-07-30 09:11:32 -04:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 4.4.2 Join Accept
|
|
|
|
|
*/
|
2021-08-18 16:55:57 -04:00
|
|
|
|
struct join_accept_data
|
2021-08-15 23:36:29 -04:00
|
|
|
|
: PDU::pdu_data
|
|
|
|
|
{
|
2021-08-25 17:20:33 -04:00
|
|
|
|
UUID::uuid leader; //!< channel leader UUID
|
|
|
|
|
uint16_t number; //!< channel number
|
|
|
|
|
MID mid; //!< message ID
|
|
|
|
|
uint32_t reliable; //!< reliable number
|
|
|
|
|
uint16_t reciprocal; //!< reciprocal channel
|
2021-08-15 23:36:29 -04:00
|
|
|
|
|
2021-07-29 23:40:46 -04:00
|
|
|
|
size_t streamSize() const override { return 26; }
|
2021-07-29 19:26:49 -04:00
|
|
|
|
void iStream(PDU::Stream) override;
|
2021-08-18 16:55:57 -04:00
|
|
|
|
void oStream(PDU::Stream) const override;
|
2021-05-27 10:59:22 -04:00
|
|
|
|
};
|
|
|
|
|
|
2021-07-30 09:11:32 -04:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 4.4.3 Join Refuse & 4.4.4 Leaving
|
|
|
|
|
*/
|
2021-08-18 16:55:57 -04:00
|
|
|
|
struct join_refuse_data
|
2021-08-15 23:36:29 -04:00
|
|
|
|
: PDU::pdu_data
|
|
|
|
|
{
|
2021-08-25 17:20:33 -04:00
|
|
|
|
UUID::uuid leader; //!< channel leader UUID
|
|
|
|
|
uint16_t number; //!< channel number
|
|
|
|
|
MID mid; //!< message ID
|
|
|
|
|
uint32_t reliable; //!< realiable number
|
|
|
|
|
uint8_t reason; //!< NAK reason code
|
2021-08-15 23:36:29 -04:00
|
|
|
|
|
2021-07-29 23:40:46 -04:00
|
|
|
|
size_t streamSize() const override { return 25; }
|
2021-07-29 19:26:49 -04:00
|
|
|
|
void iStream(PDU::Stream) override;
|
2021-08-18 16:55:57 -04:00
|
|
|
|
void oStream(PDU::Stream) const override;
|
2021-05-27 10:59:22 -04:00
|
|
|
|
};
|
|
|
|
|
|
2021-07-30 09:11:32 -04:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 4.4.5 NAK
|
|
|
|
|
*/
|
2021-08-18 16:55:57 -04:00
|
|
|
|
struct nak_data
|
2021-08-15 23:36:29 -04:00
|
|
|
|
: PDU::pdu_data
|
|
|
|
|
{
|
2021-08-25 17:20:33 -04:00
|
|
|
|
UUID::uuid leader; //!< leader UUID
|
|
|
|
|
uint16_t number; //!< channel number
|
|
|
|
|
MID mid; //!< message ID
|
|
|
|
|
uint32_t reliable; //!< reliable number
|
|
|
|
|
uint32_t missed_first; //!< first missed message
|
|
|
|
|
uint32_t missed_last; //!< last missed message
|
2021-08-15 23:36:29 -04:00
|
|
|
|
|
2021-07-29 23:40:46 -04:00
|
|
|
|
size_t streamSize() const override { return 32; }
|
2021-07-29 19:26:49 -04:00
|
|
|
|
void iStream(PDU::Stream) override;
|
2021-08-18 16:55:57 -04:00
|
|
|
|
void oStream(PDU::Stream) const override;
|
2021-05-27 10:59:22 -04:00
|
|
|
|
};
|
|
|
|
|
|
2021-07-30 09:11:32 -04:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 4.4.6 Reliable Wrapper and Unreliable Wrapper
|
|
|
|
|
*/
|
2021-08-18 16:55:57 -04:00
|
|
|
|
struct wrapper_data
|
2021-08-15 23:36:29 -04:00
|
|
|
|
: PDU::pdu_data
|
|
|
|
|
{
|
2021-08-25 17:20:33 -04:00
|
|
|
|
uint16_t channel; //!< channel number
|
|
|
|
|
uint32_t sequence; //!< sequence number
|
|
|
|
|
uint32_t reliable; //!< reliable number
|
|
|
|
|
uint32_t oldest; //!< oldest sequence number
|
|
|
|
|
MID ack_range_begin; //!< first MID to acknowledge
|
|
|
|
|
MID ack_range_end; //!< last MID to acknowledge
|
|
|
|
|
uint16_t MAK_threshold; //!< MAK Threshold
|
|
|
|
|
PDU::Block<CLIENT::Pdu> block; //!< client PDU block
|
2021-08-15 23:36:29 -04:00
|
|
|
|
|
2021-08-18 16:55:57 -04:00
|
|
|
|
size_t streamSize() const override;
|
2021-07-29 19:26:49 -04:00
|
|
|
|
void iStream(PDU::Stream) override;
|
2021-08-18 16:55:57 -04:00
|
|
|
|
void oStream(PDU::Stream) const override;
|
2021-05-27 10:59:22 -04:00
|
|
|
|
};
|
|
|
|
|
|
2021-07-30 09:11:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 4.4.8 Get Sessions
|
|
|
|
|
*/
|
2021-08-18 16:55:57 -04:00
|
|
|
|
struct get_sessions_data
|
2021-08-15 23:36:29 -04:00
|
|
|
|
: PDU::pdu_data
|
|
|
|
|
{
|
2021-08-25 17:20:33 -04:00
|
|
|
|
UUID::uuid cid; //!< component UUID
|
2021-08-15 23:36:29 -04:00
|
|
|
|
|
2021-08-18 16:55:57 -04:00
|
|
|
|
size_t streamSize() const override { return UUID_LENGTH; }
|
|
|
|
|
void iStream(PDU::Stream s) override { *s >> cid; }
|
|
|
|
|
void oStream(PDU::Stream s) const override { *s << cid; }
|
2021-05-27 10:59:22 -04:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2021-07-30 09:11:32 -04:00
|
|
|
|
/**
|
|
|
|
|
* @brief 4.4.9.1 Channel Owner Info Block
|
2021-08-18 16:55:57 -04:00
|
|
|
|
* 4.4.9.2 Channel Member Info Block
|
2021-07-30 09:11:32 -04:00
|
|
|
|
*/
|
2021-08-18 16:55:57 -04:00
|
|
|
|
struct channel_info_block
|
2023-04-02 13:24:55 -04:00
|
|
|
|
: streamable
|
2021-08-15 23:36:29 -04:00
|
|
|
|
{
|
2021-08-25 17:20:33 -04:00
|
|
|
|
MID mid; //!< MID
|
|
|
|
|
UUID::uuid owner; //!< channel owner UUID
|
|
|
|
|
uint16_t channel; //!< channel number
|
|
|
|
|
UDP::ipAddress destination; //!< destination IP address
|
|
|
|
|
UDP::ipAddress source; //!< source IP address
|
|
|
|
|
uint16_t reciprocal; //!< reciprocal channel
|
|
|
|
|
uint16_t sessions; //!< session count
|
|
|
|
|
std::vector<uint32_t> protocols; //!< transported protocols
|
2021-08-18 16:55:57 -04:00
|
|
|
|
|
|
|
|
|
size_t streamSize() const override;
|
|
|
|
|
void iStream(PDU::Stream) override;
|
|
|
|
|
void oStream(PDU::Stream) const override;
|
2021-05-27 10:59:22 -04:00
|
|
|
|
};
|
|
|
|
|
|
2021-07-30 09:11:32 -04:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 4.4.9 Sessions
|
|
|
|
|
*/
|
2021-08-18 16:55:57 -04:00
|
|
|
|
struct sessions_data
|
2021-08-15 23:36:29 -04:00
|
|
|
|
: PDU::pdu_data
|
|
|
|
|
{
|
2021-08-25 17:20:33 -04:00
|
|
|
|
std::vector<channel_info_block> list; //!< list of channel info blocks
|
2021-08-15 23:36:29 -04:00
|
|
|
|
|
2021-08-18 16:55:57 -04:00
|
|
|
|
size_t streamSize() const override;
|
|
|
|
|
void iStream(PDU::Stream) override;
|
|
|
|
|
void oStream(PDU::Stream) const override;
|
2021-05-27 10:59:22 -04:00
|
|
|
|
};
|
|
|
|
|
|
2021-07-30 09:11:32 -04:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 4.5.1 ACK
|
|
|
|
|
*/
|
2021-08-18 16:55:57 -04:00
|
|
|
|
struct ack_data
|
2021-08-15 23:36:29 -04:00
|
|
|
|
: PDU::pdu_data
|
|
|
|
|
{
|
2021-08-25 17:20:33 -04:00
|
|
|
|
uint32_t sequence; //!< sequence number
|
2021-08-15 23:36:29 -04:00
|
|
|
|
|
2021-07-29 23:40:46 -04:00
|
|
|
|
size_t streamSize() const override { return 4; }
|
2021-08-18 16:55:57 -04:00
|
|
|
|
void iStream(PDU::Stream s) override { *s >> sequence; }
|
|
|
|
|
void oStream(PDU::Stream s) const override { *s << sequence; }
|
2021-05-27 10:59:22 -04:00
|
|
|
|
};
|
|
|
|
|
|
2021-07-30 09:11:32 -04:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 4.5.2 Channel Params
|
|
|
|
|
*/
|
2021-08-18 16:55:57 -04:00
|
|
|
|
struct channel_params_data
|
2021-08-15 23:36:29 -04:00
|
|
|
|
: PDU::pdu_data
|
|
|
|
|
{
|
2021-08-25 17:20:33 -04:00
|
|
|
|
params parameters; //!< parameters
|
|
|
|
|
UDP::ipAddress address; //!< IP address
|
|
|
|
|
uint8_t expiry; //!< timeout
|
2021-08-15 23:36:29 -04:00
|
|
|
|
|
2021-08-18 16:55:57 -04:00
|
|
|
|
size_t streamSize() const override;
|
|
|
|
|
void iStream(PDU::Stream) override;
|
|
|
|
|
void oStream(PDU::Stream) const override;
|
2021-05-27 10:59:22 -04:00
|
|
|
|
};
|
|
|
|
|
|
2021-07-30 09:11:32 -04:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 4.5.3 Connect, 4.5.4 Connect Accept, & 4.5.6 Disconnect
|
|
|
|
|
*/
|
2021-08-18 16:55:57 -04:00
|
|
|
|
struct connect_data
|
2021-08-15 23:36:29 -04:00
|
|
|
|
: PDU::pdu_data
|
|
|
|
|
{
|
2021-08-25 17:20:33 -04:00
|
|
|
|
uint32_t protocol; //!< protocol number
|
2021-08-15 23:36:29 -04:00
|
|
|
|
|
2021-07-30 09:11:32 -04:00
|
|
|
|
size_t streamSize() const override { return 4; }
|
2021-08-18 16:55:57 -04:00
|
|
|
|
void iStream(PDU::Stream s) override { *s >> protocol; }
|
|
|
|
|
void oStream(PDU::Stream s) const override { *s << protocol; }
|
2021-05-27 10:59:22 -04:00
|
|
|
|
};
|
|
|
|
|
|
2021-07-30 09:11:32 -04:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief 4.5.5 Connect Refuse & 4.5.7 Disconnecting
|
|
|
|
|
*/
|
2021-08-18 16:55:57 -04:00
|
|
|
|
struct disconnecting_data
|
2021-08-15 23:36:29 -04:00
|
|
|
|
: PDU::pdu_data
|
|
|
|
|
{
|
2021-08-25 17:20:33 -04:00
|
|
|
|
uint32_t protocol; //!< protocol number
|
|
|
|
|
uint8_t reason; //!< refuse/disconnect reason code
|
2021-05-27 10:59:22 -04:00
|
|
|
|
|
2021-08-18 16:55:57 -04:00
|
|
|
|
size_t streamSize() const override { return 5; }
|
|
|
|
|
void iStream(PDU::Stream) override;
|
|
|
|
|
void oStream(PDU::Stream) const override;
|
2021-05-27 10:59:22 -04:00
|
|
|
|
};
|
|
|
|
|
|
2021-08-24 18:10:20 -04:00
|
|
|
|
} // ACN::SDT
|