Add WIZnet W5500 UDP over IP socket (::picolibrary::WIZnet::W5500::IP::UDP::Socket) and associated mock (::picolibrary::Testing::Automated::WIZnet::W5500::IP::UDP::Mock_Socket).
[x] The Socket class should be defined in the include/picolibrary/wiznet/w5500/ip/udp.h/source/picolibrary/wiznet/w5500/ip/udp.cc header/source file pair
[x] The Mock_Socket class should be defined in the include/picolibrary/testing/automated/wiznet/w5500/ip/udp.h/source/picolibrary/testing/automated/wiznet/w5500/ip/udp.cc header/source file pair
[x] The Socket class should have automated tests
[x] The Socket class should be a friend of the ::picolibrary::WIZnet::W5500::IP::Network_Stack_Driver_Access_Key class
[x] The Socket class should be a friend of the ::picolibrary::WIZnet::W5500::IP::Network_Stack_Socket_Allocation_Key class
[x] The Socket class should be a friend of the ::picolibrary::WIZnet::W5500::IP::Network_Stack_UDP_Port_Allocator_Access_Key class
[x] The Socket class should have the following template parameters:
[x] typename Network_Stack: The type of network stack the socket is associated with
[x] The Socket class should have the following member types:
[x] enum class State: Socket state
[x] The State enum class should have an underlying type of std::uint_fast8_t
[x] The State enum class should have the following enumerators:
[x] UNINITIALIZED,: Uninitialized
[x] INITIALIZED,: Initialized
[x] BOUND,: Bound
[x] The Socket class should support the following operations:
[x] constexpr auto state() const noexcept -> State;: Get the socket's state
[x] constexpr auto socket_id() const noexcept -> Socket_ID;: Get the socket's hardware socket ID
[x] constexpr auto socket_interrupt_mask() const noexcept -> std::uint8_t;: Get the socket's socket interrupt mask (mask used when checking the network stack's socket interrupt context)
[x] void bind( ::picolibrary::IP::UDP::Endpoint const & endpoint = ::picolibrary::IP::UDP::Endpoint{} ) noexcept;: Bind the socket to a local endpoint
[x] auto local_endpoint() const noexcept -> ::picolibrary::IP::UDP::Endpoint;: Get the socket's local endpoint
[x] constexpr auto is_transmitting() const noexcept -> bool; Check if datagram transmission is in progress
[x] auto transmit( ::picolibrary::IP::UDP::Endpoint const & endpoint, std::uint8_t const * begin, std::uint8_t const * end ) noexcept -> Result<void>;: Transmit a datagram to a remote endpoint
[x] auto receive( std::uint8_t * begin, std::uint8_t * end ) noexcept -> Result<::picolibrary::IP::UDP::Reception_Result>;: Receive a datagram from a remote endpoint
[x] void close() noexcept;: Close the socket
[x] The Mock_Socket class should have a movable mock handle
[x] The following member types should be added to the ::picolibrary::WIZnet::W5500::IP::Network_Stack class:
[x] using UDP_Socket = UDP::Socket<Network_Stack>;: The type of UDP socket that is used to interact with the network stack
[x] Support for the following operations should be added to the ::picolibrary::WIZnet::W5500::IP::Network_Stack class:
[x] auto make_udp_socket() noexcept -> UDP_Socket;: Construct a UDP socket
[x] auto make_udp_socket( Socket_ID socket_id ) noexcept -> UDP_Socket;: Construct a UDP socket that uses a specific hardware socket
Add WIZnet W5500 UDP over IP socket (
::picolibrary::WIZnet::W5500::IP::UDP::Socket
) and associated mock (::picolibrary::Testing::Automated::WIZnet::W5500::IP::UDP::Mock_Socket
).Socket
class should be defined in theinclude/picolibrary/wiznet/w5500/ip/udp.h
/source/picolibrary/wiznet/w5500/ip/udp.cc
header/source file pairMock_Socket
class should be defined in theinclude/picolibrary/testing/automated/wiznet/w5500/ip/udp.h
/source/picolibrary/testing/automated/wiznet/w5500/ip/udp.cc
header/source file pairSocket
class should have automated testsSocket
class should be a friend of the::picolibrary::WIZnet::W5500::IP::Network_Stack_Driver_Access_Key
classSocket
class should be a friend of the::picolibrary::WIZnet::W5500::IP::Network_Stack_Socket_Allocation_Key
classSocket
class should be a friend of the::picolibrary::WIZnet::W5500::IP::Network_Stack_UDP_Port_Allocator_Access_Key
classSocket
class should have the following template parameters:typename Network_Stack
: The type of network stack the socket is associated withSocket
class should have the following member types:enum class State
: Socket stateState
enum class should have an underlying type ofstd::uint_fast8_t
State
enum class should have the following enumerators:UNINITIALIZED,
: UninitializedINITIALIZED,
: InitializedBOUND,
: BoundSocket
class should support the following operations:constexpr Socket() noexcept = default;
constexpr Socket( Socket_Construction_Key, Network_Stack & network_stack, Socket_ID socket_id ) noexcept;
constexpr Socket( Network_Stack & network_stack, Socket_ID socket_id, State state = State::INITIALIZED, bool is_transmitting = false ) noexcept;
PICOLIBRARY_ENABLE_AUTOMATED_TESTING
is definedconstexpr Socket( Socket && source ) noexcept;
~Socket() noexcept;
constexpr auto operator=( Socket && expression ) noexcept -> Socket &;
constexpr auto state() const noexcept -> State;
: Get the socket's stateconstexpr auto socket_id() const noexcept -> Socket_ID;
: Get the socket's hardware socket IDconstexpr auto socket_interrupt_mask() const noexcept -> std::uint8_t;
: Get the socket's socket interrupt mask (mask used when checking the network stack's socket interrupt context)void configure_broadcast_blocking( Broadcast_Blocking broadcast_blocking_configuration ) noexcept;
: Configure socket broadcast blockingauto braodcast_blocking_configuration() const noexcept -> Broadcast_Blocking;
; Get the socket's broadcast blocking configurationvoid configure_unicast_blocking( Unicast_Blocking unicast_blocking_configuration ) noexcept;
: Configure socket unicast blockingauto unicast_blocking_configuration() const noexcept -> Unicast_Blocking;
; Get the socket's unicast blocking configurationvoid configure_time_to_live( std::uint8_t time_to_live ) noexcept;
: Configure the socket's IPv4 time to live field value (defaults to 0x80)auto time_to_live() const noexcept -> std::uint8_t;
: Get the socket's IPv4 time to live field valuevoid enable_interrupts( std::uint8_t mask ) noexcept;
: Enable interruptsvoid disable_interrupts( std::uint8_t mask ) noexcept;
: Disable interruptsvoid disable_interrupts() noexcept;
: Disable all interruptsauto enabled_interrupts() const noexcept -> std::uint8_t;
: Get a mask identifying the interrupts that are enabledauto interrupt_context() const noexcept -> std::uint8_t;
: Get the interrupt context (SN_IR register value)void clear_interrupts( std::uint8_t mask ) noexcept;
: Clear interruptsvoid bind( ::picolibrary::IP::UDP::Endpoint const & endpoint = ::picolibrary::IP::UDP::Endpoint{} ) noexcept;
: Bind the socket to a local endpointauto local_endpoint() const noexcept -> ::picolibrary::IP::UDP::Endpoint;
: Get the socket's local endpointconstexpr auto is_transmitting() const noexcept -> bool;
Check if datagram transmission is in progressauto transmit( ::picolibrary::IP::UDP::Endpoint const & endpoint, std::uint8_t const * begin, std::uint8_t const * end ) noexcept -> Result<void>;
: Transmit a datagram to a remote endpointauto receive( std::uint8_t * begin, std::uint8_t * end ) noexcept -> Result<::picolibrary::IP::UDP::Reception_Result>;
: Receive a datagram from a remote endpointvoid close() noexcept;
: Close the socketMock_Socket
class should have a movable mock handle::picolibrary::WIZnet::W5500::IP::Network_Stack
class:using UDP_Socket = UDP::Socket<Network_Stack>;
: The type of UDP socket that is used to interact with the network stack::picolibrary::WIZnet::W5500::IP::Network_Stack
class:auto make_udp_socket() noexcept -> UDP_Socket;
: Construct a UDP socketauto make_udp_socket( Socket_ID socket_id ) noexcept -> UDP_Socket;
: Construct a UDP socket that uses a specific hardware socket