We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, Im currently receiving JSON payload from MQTT shadow topic and having this error
E (14264) coreMQTT: Dumped packet. DumpedBytes=19. E (14264) coreMQTT: Dumped packet. DumpedBytes=46.
I need help on increasing the size.
This is how handle to read/receive the JSON payload
` // Increase buffer size to receive the whole JSON payload char *payloadBuffer = (char *)malloc(pPublishInfo->payloadLength + 1); if (payloadBuffer == NULL) { LogError(("Failed to allocate memory for payload buffer!")); eventCallbackError = true; return; } // Copy the payload data into the buffer memcpy(payloadBuffer, pPublishInfo->pPayload, pPublishInfo->payloadLength); payloadBuffer[pPublishInfo->payloadLength] = '\0';
// Print the parsed JSON for debugging LogInfo(("Received JSON:\n%s", payloadBuffer)); // Parse the entire JSON payload using cJSON cJSON *jsonObject = cJSON_Parse(payloadBuffer); // Free the allocated memory for payload buffer free(payloadBuffer); if (jsonObject == NULL) { LogError(("Failed to parse JSON payload!!")); eventCallbackError = true; return; }`
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi, Im currently receiving JSON payload from MQTT shadow topic and having this error
E (14264) coreMQTT: Dumped packet. DumpedBytes=19. E (14264) coreMQTT: Dumped packet. DumpedBytes=46.
I need help on increasing the size.
This is how handle to read/receive the JSON payload
` // Increase buffer size to receive the whole JSON payload
char *payloadBuffer = (char *)malloc(pPublishInfo->payloadLength + 1);
if (payloadBuffer == NULL) {
LogError(("Failed to allocate memory for payload buffer!"));
eventCallbackError = true;
return;
}
// Copy the payload data into the buffer
memcpy(payloadBuffer, pPublishInfo->pPayload, pPublishInfo->payloadLength);
payloadBuffer[pPublishInfo->payloadLength] = '\0';
The text was updated successfully, but these errors were encountered: