|
NanoOcp
Minimal AES70 / OCP.1 TCP client/server library for d&b Soundscape devices
|
#include <Ocp1Message.h>
Public Member Functions | |
| Ocp1Header (std::uint8_t msgType, std::size_t parameterDataLength) | |
| Ocp1Header (const ByteVector &memory) | |
| virtual | ~Ocp1Header ()=default |
| std::uint8_t | GetMessageType () const |
| std::uint32_t | GetMessageSize () const |
| bool | IsValid () const |
| ByteVector | GetSerializedData () const |
Static Public Member Functions | |
| static std::uint32_t | CalculateMessageSize (std::uint8_t msgType, size_t parameterDataLength) |
Static Public Attributes | |
| static constexpr std::uint32_t | Ocp1HeaderSize = 10 |
Protected Attributes | |
| std::uint8_t | m_syncVal |
| std::uint16_t | m_protoVers |
| std::uint32_t | m_msgSize |
| std::uint8_t | m_msgType |
| std::uint16_t | m_msgCnt |
Representation of the header of a OCA message.
Definition at line 171 of file Ocp1Message.h.
|
inline |
Class constructor.
Definition at line 177 of file Ocp1Message.h.
|
explicit |
Class constructor which creates a Ocp1Header based on a ByteVector.
Definition at line 88 of file Ocp1Message.cpp.
References NanoOcp1::Ocp1Message::KeepAlive, m_msgCnt, m_msgSize, m_msgType, m_protoVers, m_syncVal, Ocp1HeaderSize, NanoOcp1::ReadUint16(), and NanoOcp1::ReadUint32().
|
virtualdefault |
Class destructor.
|
static |
Helper method to calculate the OCA message size based on the message's type and the number of parameter data bytes contained in the message.
| [in] | msgType | Type of OCA message (i.e. Notification, KeepAlive, etc). |
| [in] | parameterDataLength | Number of parameter data bytes contained in the message. |
Definition at line 139 of file Ocp1Message.cpp.
References NanoOcp1::Ocp1Message::Command, NanoOcp1::Ocp1Message::CommandResponseRequired, NanoOcp1::Ocp1Message::KeepAlive, NanoOcp1::Ocp1Message::Notification, and NanoOcp1::Ocp1Message::Response.
|
inline |
Gets the size of the OCA message.
Definition at line 211 of file Ocp1Message.h.
References m_msgSize.
Referenced by NanoOcp1::Ocp1CommandResponseRequired::GetSerializedData(), NanoOcp1::Ocp1Response::GetSerializedData(), and NanoOcp1::Ocp1Notification::GetSerializedData().
|
inline |
Gets the type of the OCA message. (i.e. Notification, KeepAlive, etc).
Definition at line 201 of file Ocp1Message.h.
References m_msgType.
Referenced by NanoOcp1::Ocp1Message::GetMessageType(), and NanoOcp1::Ocp1Message::UnmarshalOcp1Message().
| ByteVector NanoOcp1::Ocp1Header::GetSerializedData | ( | ) | const |
Returns a vector of bytes representing the binary contents of the header.
Definition at line 121 of file Ocp1Message.cpp.
References m_msgCnt, m_msgSize, m_msgType, m_protoVers, and m_syncVal.
Referenced by NanoOcp1::Ocp1CommandResponseRequired::GetSerializedData(), NanoOcp1::Ocp1Response::GetSerializedData(), NanoOcp1::Ocp1Notification::GetSerializedData(), and NanoOcp1::Ocp1KeepAlive::GetSerializedData().
| bool NanoOcp1::Ocp1Header::IsValid | ( | ) | const |
Checks if the header is valid.
Definition at line 115 of file Ocp1Message.cpp.
References NanoOcp1::Ocp1Message::KeepAlive, m_msgCnt, m_msgSize, m_msgType, m_protoVers, m_syncVal, and Ocp1HeaderSize.
Referenced by NanoOcp1::Ocp1Message::UnmarshalOcp1Message().
|
protected |
Definition at line 251 of file Ocp1Message.h.
Referenced by GetSerializedData(), IsValid(), and Ocp1Header().
|
protected |
Definition at line 249 of file Ocp1Message.h.
Referenced by GetMessageSize(), GetSerializedData(), IsValid(), and Ocp1Header().
|
protected |
Definition at line 250 of file Ocp1Message.h.
Referenced by GetMessageType(), GetSerializedData(), IsValid(), and Ocp1Header().
|
protected |
Definition at line 248 of file Ocp1Message.h.
Referenced by GetSerializedData(), IsValid(), and Ocp1Header().
|
protected |
Definition at line 247 of file Ocp1Message.h.
Referenced by GetSerializedData(), IsValid(), and Ocp1Header().
|
staticconstexpr |
Size of an OCA message header, in bytes, including the starting sync byte.
Definition at line 244 of file Ocp1Message.h.
Referenced by IsValid(), Ocp1Header(), and NanoOcp1::Ocp1Message::UnmarshalOcp1Message().