Hi, I'm understanding how to use Arduino IoT Cloud and, therefore, I'm analyzing the main instructions. Does anyone know in the function ArduinoCloud.begin(ArduinoIoTPreferredConnection);
what "ArduinoIoTPreferredConnection" stands for? Is it a constant or something like that? I'm writing because the webpage
doesn't include the instructions
The Arduino programming language Reference, organized into Functions, Variable and Constant, and Structure keywords.
J-M-L
April 18, 2024, 3:46pm
2
it's an instance of a suitable class depending on how you connect to the internet (could be ethernet, wifi, GSM, ...)
#if defined(BOARD_HAS_ETHERNET)
/* DHCP mode */
//EthernetConnectionHandler ArduinoIoTPreferredConnection;
/* Manual mode. It will fallback in DHCP mode if SECRET_OPTIONAL_IP is invalid or equal to "0.0.0.0" */
EthernetConnectionHandler ArduinoIoTPreferredConnection(SECRET_OPTIONAL_IP, SECRET_OPTIONAL_DNS, SECRET_OPTIONAL_GATEWAY, SECRET_OPTIONAL_NETMASK);
#elif defined(BOARD_HAS_WIFI)
WiFiConnectionHandler ArduinoIoTPreferredConnection(SECRET_SSID, SECRET_PASS);
#elif defined(BOARD_HAS_GSM)
GSMConnectionHandler ArduinoIoTPreferredConnection(SECRET_PIN, SECRET_APN, SECRET_LOGIN, SECRET_PASS);
#elif defined(BOARD_HAS_LORA)
LoRaConnectionHandler ArduinoIoTPreferredConnection(SECRET_APP_EUI, SECRET_APP_KEY, _lora_band::EU868, NULL, _lora_class::CLASS_A);
#elif defined(BOARD_HAS_NB)
NBConnectionHandler ArduinoIoTPreferredConnection(SECRET_PIN, SECRET_APN, SECRET_LOGIN, SECRET_PASS);
#elif defined(BOARD_HAS_CATM1_NBIOT)
CatM1ConnectionHandler ArduinoIoTPreferredConnection(SECRET_PIN, SECRET_APN, SECRET_LOGIN, SECRET_PASS);
#endif
1 Like
system
Closed
October 15, 2024, 4:10pm
4
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.