BugID:17712886: fix coap dynamic register support
@@ -55,11 +55,6 @@ int IOT_SetupConnInfo(const char *product_key,
int device_secret_len = DEVICE_SECRET_MAXLEN;
sdk_impl_ctx_t *ctx = sdk_impl_get_ctx();
- if (!info_ptr) {
- sdk_err("Invalid argument, info_ptr = %p", info_ptr);
- return -1;
- }
-
STRING_PTR_SANITY_CHECK(product_key, -1);
STRING_PTR_SANITY_CHECK(device_name, -1);
@@ -113,6 +108,11 @@ int IOT_SetupConnInfo(const char *product_key,
iotx_device_info_init();
iotx_device_info_set(product_key, device_name, device_secret_actual);
+#if defined MQTT_COMM_ENABLED
+ if (NULL == info_ptr) {
+ return SUCCESS_RETURN;
+ }
+
if (0 == iotx_guider_auth_get()) {
rc = iotx_guider_authenticate();
}
@@ -123,6 +123,7 @@ int IOT_SetupConnInfo(const char *product_key,
iotx_guider_auth_set(0);
*info_ptr = NULL;
}
+#endif
return rc;
}
