The tutorial asks the user to paste in code into the template solution as part of the tutorial. This example code contains two macros: ENUM_TO_STRING and __FAILURE__ which are not defined in the tutorial or the template.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@gw111zz Thank you for the valuable feedback,we are investigating the issue.
@gw111zz I believe you are talking about the second line in this code:
printf("ERROR: IoTHubModuleClient_LL_SetInputMessageCallback(\"input1\")..........FAILED!\r\n");
ret = __FAILURE__;
@gw111zz Could you please confirm @Alberto-Vega-MSFT ask?
ret = __FAILURE__; should be changed to ret = 1;
Please update it.
@formulahendry Thanks for taking the time to help. I have assigned the issue to the content author to evaluate and update as appropriate.
The definition of ENUM_TO_STRING is also missing.
Thanks everybody. I'll open a pull request to update the sample code.
@formulahendry or @shizn Can you check where ENUM_TO_STRING in the moduleTwinCallback function is supposed to be defined?
Hi @kganjam , it seems like ENUM_TO_STRING is also changed in C SDK side. (I will create another issue for C SDK to follow up).
For quick turn around, please also make below change:
Change
printf("\r\nTwin callback called with (state=%s, size=%zu):\r\n%s\r\n",
ENUM_TO_STRING(DEVICE_TWIN_UPDATE_STATE, update_state), size, payLoad);
to
printf("\r\nTwin callback called with (size=%zu):\r\n%s\r\n",
size, payLoad);
Thanks a lot!
Until the fix has been implemented know that ENUM_TO_STRING(...) has been changed to MU_ENUM_TO_STRING(...) in the macro_utils.h. You may change it to that if you would like until the docs have been updated.
@danewalton Thanks for the PR.
@gw111zz Changes will be updated once the PR is merged,
We will now proceed to close this thread. If there are further questions regarding this matter, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue.