I am working on a MQTT project , where a where my device the client will need to generate a SAS token. The original code was written in C on the .net compiler. I have manged to get it working on the AVR but at times my AVR just hangs in some code. I am suspecting this is due to how the code handles the allocated memory.
Can you some one advice me if the following functions are handle appropriately by the AVR compiler and if not what must i change?
These are samples of them. Please note this is the not the full code, but i would like to know that once this code in a AVR how does the device handle them.
h = malloc(sizeof(CONECTIONSTRINGSTRUCT)); memset(h->keywords, 0, sizeof(char*) * tokenCount); tolower(keywordStart[i]); free(h->keywords[i]); if ((snprintf(tokenExpiryStr, sizeof(tokenExpiryStr), "%lu", tokenExpiry)) > sizeof(tokenExpiryStr)) return -1; int uriLen = 1 + strlen(GetKeywordValue(h, ("Hostname"))) + strlen(("/devices/")) + strlen(devicedata.iot_imei); snprintf(toSign, toSignLen, "%s\n%s", encodedUri, tokenExpiryStr);