hi,
this line:
char *payloadhex = utils.buildHexData(nullptr, payload, payloadlen);
leaks memory because it is missing free:
free(payloadhex);
after some time esp32 gets 0 bytes free memory (depends how often you call this function).
problem is that: char* BLEUtils::buildHexData(); does not free the memory so once you call it, you need to free manually before next loop/call/whatever
and onResult() is repeated all the time you receive data so after some time you get restart of esp32 once no more memory left
hi,
this line:
char *payloadhex = utils.buildHexData(nullptr, payload, payloadlen);leaks memory because it is missing free:
free(payloadhex);after some time esp32 gets 0 bytes free memory (depends how often you call this function).
problem is that:
char* BLEUtils::buildHexData();does not free the memory so once you call it, you need to free manually before next loop/call/whateverand
onResult()is repeated all the time you receive data so after some time you get restart of esp32 once no more memory left