@@ -24,10 +24,10 @@ int arduino::WiFiClass::begin(char* ssid, const char *passphrase) {
24
24
return WL_CONNECT_FAILED;
25
25
}
26
26
27
- if (wifi_if == NULL ) {
27
+ if (wifi_if == nullptr ) {
28
28
// Q: What is the callback for?
29
- cb ();
30
- if (wifi_if == NULL ) return WL_CONNECT_FAILED;
29
+ _initializerCallback ();
30
+ if (wifi_if == nullptr ) return WL_CONNECT_FAILED;
31
31
}
32
32
33
33
// too long? break it off
@@ -50,18 +50,18 @@ int arduino::WiFiClass::begin(char* ssid, const char *passphrase) {
50
50
int arduino::WiFiClass::beginAP (const char * ssid, const char *passphrase, uint8_t channel) {
51
51
52
52
#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4)
53
- softap = WhdSoftAPInterface::get_default_instance ();
53
+ _softAP = WhdSoftAPInterface::get_default_instance ();
54
54
#endif
55
55
56
- if (softap == NULL ) {
56
+ if (_softAP == NULL ) {
57
57
return WL_CONNECT_FAILED;
58
58
}
59
59
60
60
ensureDefaultAPNetworkConfiguration ();
61
61
62
62
// Set ap ssid, password and channel
63
- (( WhdSoftAPInterface*)softap )->set_network (_ip, _netmask, _gateway);
64
- nsapi_error_t ret = (( WhdSoftAPInterface*)softap )->start (ssid, passphrase, NSAPI_SECURITY_WPA2, channel, true /* dhcp server */ , NULL , true /* cohexistance */ );
63
+ static_cast < WhdSoftAPInterface*>(_softAP )->set_network (_ip, _netmask, _gateway);
64
+ nsapi_error_t ret = static_cast < WhdSoftAPInterface*>(_softAP )->start (ssid, passphrase, NSAPI_SECURITY_WPA2, channel, true /* dhcp server */ , NULL , true /* cohexistance */ );
65
65
66
66
return ret == NSAPI_ERROR_OK ? WL_AP_LISTENING : WL_CONNECT_FAILED;
67
67
}
@@ -83,8 +83,8 @@ void arduino::WiFiClass::end() {
83
83
}
84
84
85
85
int arduino::WiFiClass::disconnect () {
86
- if (softap != NULL ) {
87
- return static_cast <WhdSoftAPInterface*>(softap )->stop ();
86
+ if (_softAP != nullptr ) {
87
+ return static_cast <WhdSoftAPInterface*>(_softAP )->stop ();
88
88
} else {
89
89
return wifi_if->disconnect ();
90
90
}
@@ -171,7 +171,7 @@ static uint8_t sec2enum(nsapi_security_t sec)
171
171
172
172
int8_t arduino::WiFiClass::scanNetworks () {
173
173
uint8_t count = 10 ;
174
- if (ap_list == NULL ) {
174
+ if (ap_list == nullptr ) {
175
175
ap_list = new WiFiAccessPoint[count];
176
176
}
177
177
return wifi_if->scan (ap_list, count);
@@ -243,8 +243,8 @@ arduino::IPAddress arduino::WiFiClass::gatewayIP() {
243
243
}
244
244
245
245
NetworkInterface *arduino::WiFiClass::getNetwork () {
246
- if (softap != NULL ) {
247
- return softap ;
246
+ if (_softAP != nullptr ) {
247
+ return _softAP ;
248
248
} else {
249
249
return wifi_if;
250
250
}
0 commit comments