Skip to content

Commit 0bca667

Browse files
committed
add get setting
1 parent fa8e957 commit 0bca667

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

src/ConnectionHandlerInterface.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ class ConnectionHandler {
101101
return false;
102102
}
103103

104+
virtual void getSetting(models::NetworkSetting& s) {
105+
memcpy(&s, &_settings, sizeof(s));
106+
return;
107+
}
108+
104109
virtual void setKeepAlive(bool keep_alive=true) { this->_keep_alive = keep_alive; }
105110

106111
protected:

src/GenericConnectionHandler.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ bool GenericConnectionHandler::updateSetting(const models::NetworkSetting& s) {
4646
}
4747
}
4848

49+
void GenericConnectionHandler::getSetting(models::NetworkSetting& s) {
50+
if(_ch != nullptr) {
51+
_ch->getSetting(s);
52+
}
53+
}
54+
4955
NetworkConnectionState GenericConnectionHandler::updateConnectionState() {
5056
return _ch != nullptr ? _ch->updateConnectionState() : NetworkConnectionState::INIT;
5157
}

src/GenericConnectionHandler.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class GenericConnectionHandler : public ConnectionHandler
4949
#endif
5050

5151
bool updateSetting(const models::NetworkSetting& s) override;
52+
void getSetting(models::NetworkSetting& s) override;
5253

5354
void connect() override;
5455
void disconnect() override;

0 commit comments

Comments
 (0)