Skip to content

Commit

Permalink
Add local domain socket ProtocolInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
lhoward committed Apr 5, 2024
1 parent 97cee6a commit 3e1b50c
Show file tree
Hide file tree
Showing 7 changed files with 758 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Expand Up @@ -31,6 +31,7 @@ option(BUILD_AVDECC_INTERFACE_MAC "Build the macOS native protocol interface (ma
option(BUILD_AVDECC_INTERFACE_PROXY "Build the proxy protocol interface." FALSE)
option(BUILD_AVDECC_INTERFACE_VIRTUAL "Build the virtual protocol interface (for unit tests)." TRUE)
option(BUILD_AVDECC_INTERFACE_SERIAL "Build the serial protocol interface." !${WIN32})
option(BUILD_AVDECC_INTERFACE_LOCAL "Build the local domain socket protocol interface." !${WIN32})
# Install options
option(INSTALL_AVDECC_EXAMPLES "Install examples." FALSE)
option(INSTALL_AVDECC_TESTS "Install unit tests." FALSE)
Expand Down
1 change: 1 addition & 0 deletions include/la/avdecc/internals/protocolInterface.hpp
Expand Up @@ -67,6 +67,7 @@ class ProtocolInterface : public la::avdecc::utils::Subject<ProtocolInterface, s
Proxy = 1u << 2, /**< IEEE Std 1722.1 Proxy protocol interface. */
Virtual = 1u << 3, /**< Virtual protocol interface. */
Serial = 1u << 4, /**< Serial port protocol interface. */
Local = 1u << 5, /**< Local domain socket protocol interface. */
};

/** Possible Error status returned (or thrown) by a ProtocolInterface */
Expand Down
1 change: 1 addition & 0 deletions include/la/avdecc/internals/typedefs.h
Expand Up @@ -135,6 +135,7 @@ enum avdecc_protocol_interface_type_e
avdecc_protocol_interface_type_proxy = 1u << 2, /**< IEEE Std 1722.1 Proxy protocol interface. */
avdecc_protocol_interface_type_virtual = 1u << 3, /**< Virtual protocol interface. */
avdecc_protocol_interface_type_serial = 1u << 4, /**< Serial port protocol interface. */
avdecc_protocol_interface_type_local = 1u << 5, /**< Local domain socket protocol interface. */
};

/** Valid values for avdecc_protocol_interface_error_t */
Expand Down
11 changes: 11 additions & 0 deletions src/CMakeLists.txt
Expand Up @@ -232,6 +232,17 @@ if(BUILD_AVDECC_INTERFACE_SERIAL)
list(APPEND ADD_PRIVATE_COMPILE_OPTIONS "-DHAVE_PROTOCOL_INTERFACE_SERIAL")
endif()

# Local Domain Socket Protocol interface
if(BUILD_AVDECC_INTERFACE_LOCAL)
list(APPEND SOURCE_FILES_PROTOCOL_INTERFACE
protocolInterface/protocolInterface_local.cpp
)
list(APPEND HEADER_FILES_PROTOCOL_INTERFACE
protocolInterface/protocolInterface_local.hpp
)
list(APPEND ADD_PRIVATE_COMPILE_OPTIONS "-DHAVE_PROTOCOL_INTERFACE_LOCAL")
endif()

# Features
if(ENABLE_AVDECC_FEATURE_REDUNDANCY)
list(APPEND ADD_PUBLIC_COMPILE_OPTIONS "-DENABLE_AVDECC_FEATURE_REDUNDANCY")
Expand Down
3 changes: 3 additions & 0 deletions src/protocolInterface/protocolInterface.cpp
Expand Up @@ -42,6 +42,9 @@
#ifdef HAVE_PROTOCOL_INTERFACE_SERIAL
# include "protocolInterface/protocolInterface_serial.hpp"
#endif // HAVE_PROTOCOL_INTERFACE_SERIAL
#ifdef HAVE_PROTOCOL_INTERFACE_LOCAL
# include "protocolInterface/protocolInterface_local.hpp"
#endif // HAVE_PROTOCOL_INTERFACE_LOCAL

namespace la
{
Expand Down

0 comments on commit 3e1b50c

Please sign in to comment.