File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 170
170
171
171
#define USE_PWM
172
172
#define USE_URL_ARDUINO
173
+ #define USE_WIFI
173
174
#define USE_WIFI_CLIENT_SECURE
174
175
#define USE_I2S
175
176
#define USE_AUDIO_SERVER
@@ -230,6 +231,7 @@ typedef uint32_t eps32_i2s_sample_rate_type;
230
231
231
232
#define USE_PWM
232
233
#define USE_URL_ARDUINO
234
+ #define USE_WIFI
233
235
#define USE_WIFI_CLIENT_SECURE
234
236
#define USE_I2S
235
237
#define USE_AUDIO_SERVER
@@ -282,6 +284,7 @@ typedef uint32_t eps32_i2s_sample_rate_type;
282
284
#define USE_EFFECTS_SUITE
283
285
#define USE_TIMER
284
286
#define USE_URL_ARDUINO
287
+ #define USE_WIFI
285
288
286
289
#define PIN_PWM_START 12
287
290
#define PIN_I2S_BCK -1
@@ -390,6 +393,7 @@ typedef uint32_t eps32_i2s_sample_rate_type;
390
393
// The Pico W has WIFI support
391
394
#ifdef ARDUINO_RASPBERRY_PI_PICO_W
392
395
# define USE_URL_ARDUINO
396
+ # define USE_WIFI
393
397
# define USE_WIFI_CLIENT_SECURE
394
398
# define USE_AUDIO_SERVER
395
399
#endif
@@ -399,7 +403,8 @@ typedef uint32_t eps32_i2s_sample_rate_type;
399
403
#ifdef __AVR__
400
404
#define USE_PWM
401
405
#define USE_TIMER
402
-
406
+ #include <Ethernet.h>
407
+ #define USE_URL_ARDUINO
403
408
#ifndef assert
404
409
#define assert (T )
405
410
#endif
Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ class URLStream : public AbstractURLStream {
182
182
char * network=nullptr ;
183
183
char * password=nullptr ;
184
184
Client *client=nullptr ;
185
- WiFiClient *clientInsecure=nullptr ;
185
+ Client *clientInsecure=nullptr ;
186
186
#ifdef USE_WIFI_CLIENT_SECURE
187
187
WiFiClientSecure *clientSecure=nullptr ;
188
188
#endif
@@ -250,11 +250,16 @@ class URLStream : public AbstractURLStream {
250
250
return *clientSecure;
251
251
}
252
252
#endif
253
+ #ifdef USE_WIFI
253
254
if (clientInsecure==nullptr ){
254
255
clientInsecure = new WiFiClient ();
255
256
LOGI (" WiFiClient" );
256
257
}
257
258
return *clientInsecure;
259
+ #else
260
+ LOGE (" Client not set" );
261
+ stop ();
262
+ #endif
258
263
}
259
264
260
265
inline void fillBuffer () {
@@ -270,7 +275,7 @@ class URLStream : public AbstractURLStream {
270
275
}
271
276
272
277
void login (){
273
- #ifndef IS_DESKTOP
278
+ #ifdef IS_WIFI
274
279
LOGD (" connectWiFi" );
275
280
if (network!=nullptr && password != nullptr && WiFi.status () != WL_CONNECTED){
276
281
WiFi.begin (network, password);
@@ -281,6 +286,8 @@ class URLStream : public AbstractURLStream {
281
286
Serial.println ();
282
287
}
283
288
delay (500 );
289
+ #else
290
+ LOGE (" login not supported" );
284
291
#endif
285
292
}
286
293
You can’t perform that action at this time.
0 commit comments