![]() |
Max OS 0.3
|
A UDP socket. More...
#include <udp.h>
Public Member Functions | |
| UDPSocket () | |
| Socket | |
| virtual void | handle_user_datagram_protocol_payload (uint8_t *data, uint16_t size) |
| Handle the recivement of a UDP payload. | |
| virtual void | send (uint8_t *data, uint16_t size) |
| send data through the UDP socket | |
| virtual void | disconnect () |
| disconnect the UDP socket | |
Public Member Functions inherited from MaxOS::common::EventManager< UDPEvents > | |
| void | connect_event_handler (EventHandler< UDPEvents > *handler) |
| connect an event handler to the event manager if it is not already connected | |
| void | disconnect_event_handler (EventHandler< UDPEvents > *handler) |
| disconnect an event handler from the event manager if it is connected | |
| Vector< Event< UDPEvents > * > | raise_event (Event< UDPEvents > *event) |
| Calls the on_event function of all the event m_handlers connected to the event manager and returns a list of the results. | |
Protected Attributes | |
| bool | listening |
| Wether the port is waiting for incoming connections. | |
| uint16_t | local_port = 0 |
| The port on this device. | |
| uint16_t | remote_port = 0 |
| The port on the remote device. | |
| uint32_t | local_ip = 0 |
| The IP of this device. | |
| uint32_t | remote_ip = 0 |
| The IP of the remote device. | |
| UserDatagramProtocolHandler * | user_datagram_protocol_handler |
| The UDP handler this socket is connected to. | |
Protected Attributes inherited from MaxOS::common::EventManager< UDPEvents > | |
| Vector< EventHandler< UDPEvents > * > | m_handlers |
Friends | |
| class | UserDatagramProtocolHandler |
| UDPSocket::UDPSocket | ( | ) |
|
virtual |
disconnect the UDP socket
Definition at line 96 of file udp.cpp.
References MaxOS::net::UserDatagramProtocolHandler::disconnect(), and user_datagram_protocol_handler.
Handle the recivement of a UDP payload.
| data | The data received |
| size | The size of the data received |
Definition at line 72 of file udp.cpp.
References MaxOS::memory::MemoryManager::kfree(), and MaxOS::common::EventManager< UDPEvents >::raise_event().
Referenced by MaxOS::net::UserDatagramProtocolHandler::handle_internet_protocol_payload().
send data through the UDP socket
| data | The data to send |
| size | The size of the data |
Definition at line 87 of file udp.cpp.
References MaxOS::net::UserDatagramProtocolHandler::send(), and user_datagram_protocol_handler.
|
friend |
|
protected |
Wether the port is waiting for incoming connections.
Definition at line 89 of file udp.h.
Referenced by MaxOS::net::UserDatagramProtocolHandler::handle_internet_protocol_payload(), and UDPSocket().
|
protected |
|
protected |
|
protected |
The IP of the remote device.
Definition at line 95 of file udp.h.
Referenced by MaxOS::net::UserDatagramProtocolHandler::handle_internet_protocol_payload(), and MaxOS::net::UserDatagramProtocolHandler::send().
|
protected |
The port on the remote device.
Definition at line 92 of file udp.h.
Referenced by MaxOS::net::UserDatagramProtocolHandler::handle_internet_protocol_payload().
|
protected |
The UDP handler this socket is connected to.
Definition at line 97 of file udp.h.
Referenced by disconnect(), and send().