azure - Instantiate DeviceClient with IoT Hub -
i have console app sends commands directly raspberry pi via azure iot hub. works fine.
where confused though, on 2 different ways (possibly more?) instantiate deviceclient.
ex:
deviceclient = deviceclient.create(iot_hub_host_name, authenticationmethodfactory .createauthenticationwithregistrysymmetrickey(iot_hub_device, iot_device_key), transporttype.http1);
or
deviceclient = deviceclient.createfromconnectionstring(iot_hub_conn_string);
seem same thing.
why use 1 on other? can receive messages either way.
yes, in end of day have same result.
create(...) method invokes iothubconnectionstringbuilder.create(...) createfromconnectionstring(...) , has description method creates deviceclient individual parameters.
so, believe, create 1 kind of wrapper gets parameters, creates connection string individual params , passes createfromconnectionstring(...). so, main difference, think, performance.
Comments
Post a Comment