To make the same program work on Argon/Boron, I need to comment out either
Cellular.setActiveSim(EXTERNAL_SIM); Cellular.setCredentials("myrpovider"); if (!waitFor(Cellular.ready, 300000)) System.reset(); waitUntil(Particle.connected); //takes some time until 3G connection setup Particle.keepAlive(120);
or
WiFi.setCredentials("SSID", "PWD", WPA2); if (!waitFor(WiFi.ready, 300000)) System.reset(); waitUntil(Particle.connected); //takes some time until 3G connection setup Particle.keepAlive(20);
Is there a way to detect whether either wifi or cellular class is already declared, so that the same source code can be reused for both type of processors Argon (Wifi) AND boron(GSM)?