mirror of
https://github.com/markqvist/reticulum-cpp.git
synced 2025-08-10 15:20:11 -04:00
WIP: UDPInterface
This commit is contained in:
parent
5443d30282
commit
9e0fb02581
2 changed files with 5 additions and 3 deletions
|
@ -43,7 +43,7 @@ UDPInterface::UDPInterface(const char* name /*= "UDPInterface"*/) : Interface(na
|
||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UDPInterface::start(const char* wifi_ssid, const char* wifi_password, int local_port /*= DEFAULT_UDP_PORT*/, const char* local_host /*=nullptr*/) {
|
bool UDPInterface::start(const char* wifi_ssid, const char* wifi_password, int port /*= DEFAULT_UDP_PORT*/, const char* local_host /*=nullptr*/) {
|
||||||
online(false);
|
online(false);
|
||||||
|
|
||||||
if (wifi_ssid != nullptr) {
|
if (wifi_ssid != nullptr) {
|
||||||
|
@ -55,6 +55,8 @@ bool UDPInterface::start(const char* wifi_ssid, const char* wifi_password, int l
|
||||||
if (local_host != nullptr) {
|
if (local_host != nullptr) {
|
||||||
_local_host = local_host;
|
_local_host = local_host;
|
||||||
}
|
}
|
||||||
|
_local_port = port;
|
||||||
|
_remote_port = port;
|
||||||
extreme("UDPInterface: wifi ssid: " + _wifi_ssid);
|
extreme("UDPInterface: wifi ssid: " + _wifi_ssid);
|
||||||
extreme("UDPInterface: wifi password: " + _wifi_password);
|
extreme("UDPInterface: wifi password: " + _wifi_password);
|
||||||
extreme("UDPInterface: local host: " + _local_host);
|
extreme("UDPInterface: local host: " + _local_host);
|
||||||
|
|
|
@ -33,7 +33,7 @@ namespace RNS { namespace Interfaces {
|
||||||
UDPInterface(const char* name = "UDPInterface");
|
UDPInterface(const char* name = "UDPInterface");
|
||||||
virtual ~UDPInterface();
|
virtual ~UDPInterface();
|
||||||
|
|
||||||
bool start(const char* wifi_ssid, const char* wifi_password, int local_port = DEFAULT_UDP_PORT, const char* local_host = nullptr);
|
bool start(const char* wifi_ssid, const char* wifi_password, int port = DEFAULT_UDP_PORT, const char* local_host = nullptr);
|
||||||
void stop();
|
void stop();
|
||||||
void loop();
|
void loop();
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ namespace RNS { namespace Interfaces {
|
||||||
// broadcast
|
// broadcast
|
||||||
std::string _local_host = DEFAULT_UDP_LOCAL_HOST;
|
std::string _local_host = DEFAULT_UDP_LOCAL_HOST;
|
||||||
int _local_port = DEFAULT_UDP_PORT;
|
int _local_port = DEFAULT_UDP_PORT;
|
||||||
std::string _remote_host = DEFAULT_UDP_LOCAL_HOST;
|
std::string _remote_host = DEFAULT_UDP_REMOTE_HOST;
|
||||||
int _remote_port = DEFAULT_UDP_PORT;
|
int _remote_port = DEFAULT_UDP_PORT;
|
||||||
|
|
||||||
// create UDP instance
|
// create UDP instance
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue