Closed GregTerrell closed 7 years ago
Hi @GregTerrell ,
Thanks for your question, you are right, it is not necessary anymore. We can safely remove, not only the AzureIoTHubClient
definition, but the sslClient
as well, from both SimpleSample_MQTT and SimpleSample_HTTP.
// In the next line we decide each client ssl we'll use.
#ifdef ARDUINO_ARCH_ESP8266
static WiFiClientSecure sslClient; // for ESP8266
#elif ARDUINO_SAMD_FEATHER_M0
static Adafruit_WINC1500SSLClient sslClient; // for Adafruit WINC1500
#else
static WiFiSSLClient sslClient;
#endif
static AzureIoTHubClient iotHubClient;
iotHubClient.begin(sslClient);
If you would like to contribute with a pull request, I’ll be glad to accept and merge it.
Thanks, Marcos
Sorry for the delay... yes I will prepare a pull-request in the next day or two for the removal. Looks like it affects the items in the examples folder for azure-iot-arduino, azure-iot-arduino-protocol-http, and azure-iot-protocol-mqtt.
PR merged.
I am probably missing something, but when testing with the SimpleSample MQTT code I discovered that the references to AzureIoTHubClient appear to do nothing for the solution.
I followed the logic into the IoTHub code and searched IoTHub files for any reference to the AzureIoTHubClient class, without finding any purpose to this class. With that experience, I commented out the iotHubClient.begin(sslClient) line; this did not break the successful operation of the SimpleSample code example or my project based from it.
Is there a reason for AzureIoTHubClient and the invocation of the .begin() method?
Thanks, Greg