@@ -24,10 +24,10 @@ int arduino::WiFiClass::begin(char* ssid, const char *passphrase) {
2424 return WL_CONNECT_FAILED;
2525 }
2626
27- if (wifi_if == NULL ) {
27+ if (wifi_if == nullptr ) {
2828 // 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;
3131 }
3232
3333 // too long? break it off
@@ -50,18 +50,18 @@ int arduino::WiFiClass::begin(char* ssid, const char *passphrase) {
5050int arduino::WiFiClass::beginAP (const char * ssid, const char *passphrase, uint8_t channel) {
5151
5252#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4)
53- softap = WhdSoftAPInterface::get_default_instance ();
53+ _softAP = WhdSoftAPInterface::get_default_instance ();
5454#endif
5555
56- if (softap == NULL ) {
56+ if (_softAP == NULL ) {
5757 return WL_CONNECT_FAILED;
5858 }
5959
6060 ensureDefaultAPNetworkConfiguration ();
6161
6262 // 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 */ );
6565
6666 return ret == NSAPI_ERROR_OK ? WL_AP_LISTENING : WL_CONNECT_FAILED;
6767}
@@ -83,8 +83,8 @@ void arduino::WiFiClass::end() {
8383}
8484
8585int 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 ();
8888 } else {
8989 return wifi_if->disconnect ();
9090 }
@@ -171,7 +171,7 @@ static uint8_t sec2enum(nsapi_security_t sec)
171171
172172int8_t arduino::WiFiClass::scanNetworks () {
173173 uint8_t count = 10 ;
174- if (ap_list == NULL ) {
174+ if (ap_list == nullptr ) {
175175 ap_list = new WiFiAccessPoint[count];
176176 }
177177 return wifi_if->scan (ap_list, count);
@@ -243,8 +243,8 @@ arduino::IPAddress arduino::WiFiClass::gatewayIP() {
243243}
244244
245245NetworkInterface *arduino::WiFiClass::getNetwork () {
246- if (softap != NULL ) {
247- return softap ;
246+ if (_softAP != nullptr ) {
247+ return _softAP ;
248248 } else {
249249 return wifi_if;
250250 }
0 commit comments