Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions libraries/WiFi/src/WiFiClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,16 @@ int WiFiClient::setSocketOption(int level, int option, const void* value, size_t
return res;
}

int WiFiClient::getSocketOption(int level, int option, const void* value, size_t size)
{
int res = getsockopt(fd(), level, option, (char *)value, (socklen_t*)&size);
if(res < 0) {
log_e("fail on fd %d, errno: %d, \"%s\"", fd(), errno, strerror(errno));
}
return res;
}


int WiFiClient::setTimeout(uint32_t seconds)
{
Client::setTimeout(seconds * 1000); // This should be here?
Expand Down
1 change: 1 addition & 0 deletions libraries/WiFi/src/WiFiClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class WiFiClient : public ESPLwIPClient

int setSocketOption(int option, char* value, size_t len);
int setSocketOption(int level, int option, const void* value, size_t len);
int getSocketOption(int level, int option, const void* value, size_t size);
int setOption(int option, int *value);
int getOption(int option, int *value);
int setTimeout(uint32_t seconds);
Expand Down