Skip to content

Commit 4bda31b

Browse files
readapting ConnectionHandlerInterface to use setting struct
1 parent a0f3441 commit 4bda31b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/ConnectionHandlerInterface.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <Client.h>
3030
#include <Udp.h>
3131
#include "ConnectionHandlerDefinitions.h"
32+
#include "settings/settings.h"
3233

3334
/******************************************************************************
3435
TYPEDEFS
@@ -77,6 +78,17 @@ class ConnectionHandler {
7778
void addDisconnectCallback(OnNetworkEventCallback callback) __attribute__((deprecated));
7879
void addErrorCallback(OnNetworkEventCallback callback) __attribute__((deprecated));
7980

81+
/**
82+
* Update the interface settings. This can be performed only when the interface is
83+
* in INIT state. otherwise nothing is performed. The type of the interface should match
84+
* the type of the settings provided
85+
*/
86+
inline void updateSetting(const models::NetworkSetting& s) {
87+
if(_current_net_connection_state == NetworkConnectionState::INIT && s.type == _interface) {
88+
memcpy(&_settings, &s, sizeof(s));
89+
}
90+
}
91+
8092
protected:
8193

8294
bool _keep_alive;
@@ -88,6 +100,11 @@ class ConnectionHandler {
88100
virtual NetworkConnectionState update_handleDisconnecting() = 0;
89101
virtual NetworkConnectionState update_handleDisconnected () = 0;
90102

103+
<<<<<<< HEAD:src/ConnectionHandlerInterface.h
104+
=======
105+
models::NetworkSetting _settings;
106+
107+
>>>>>>> 8ee4dcd (readapting ConnectionHandlerInterface to use setting struct):src/Arduino_ConnectionHandlerInterface.h
91108
private:
92109

93110
unsigned long _lastConnectionTickTime;

0 commit comments

Comments
 (0)