Hi.
I have several issues when trying to respond to Direct Methods (using v1.4.0 of the SDK):
In azure_iot_hub.c:
evt.data.method.rid = atoi(topic->prop_bag[0].value);
1. rid is not an int, it's a hex value (this affects everything, also sending responses via azure_iot_hub_method_respond). strtol might work, but since this is used when sending responses, it's easier to just keep it as char[] instead.
2. prop_bag[0].value only contains the first char if rid=11 or rid=ab (azure_iot_hub_topic_parse in azure_iot_hub_topic.c does not parse the values in prop_bag correctly)
3. After correcting the above, I'm still not able to get responses when rid has 2 chars.
In azure_iot_hub_method_respond (azure_iot_hub.c) both topic and len is correct (at least it seems that way)
param.message.topic.topic.size = len;
printk("Sending response to: %s\n", topic);
return mqtt_publish(&client, ¶m);
..but I still get no reply in the other end if rid has more than 1 char.
Any idea what the last, missing part of the puzzle is to send responses when rid has 2 chars?