Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit dcbe596

Browse files
Merge pull request #399 from SrJoosh/master
Add WiFI.config() functionality to mbed Wifi Library
2 parents 4c1dae1 + b1b4167 commit dcbe596

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

‎libraries/WiFi/src/WiFi.cpp‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ int arduino::WiFiClass::begin(const char* ssid, const char* passphrase) {
3030
return _currentNetworkStatus;
3131
}
3232

33+
//Config Wifi to set Static IP && Disable DHCP
34+
void arduino::WiFiClass::config(const char* localip, const char* netmask, const char* gateway){
35+
wifi_if->set_network(localip, netmask, gateway);
36+
wifi_if->set_dhcp(false);
37+
}
38+
3339
int arduino::WiFiClass::beginAP(const char* ssid, const char* passphrase, uint8_t channel) {
3440

3541
#if defined(COMPONENT_4343W_FS)

‎libraries/WiFi/src/WiFi.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ class WiFiClass : public MbedSocketClass {
8585
* must be between ASCII 32-126 (decimal).
8686
*/
8787
int begin(const char* ssid, const char* passphrase);
88+
89+
void config(const char* localip, const char* netmask, const char* gateway);
8890

8991
int beginAP(const char* ssid, const char* passphrase, uint8_t channel = DEFAULT_AP_CHANNEL);
9092

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /