mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-27 02:14:37 +00:00
Expand to MqttClientProxyMessage_size (#4726)
This commit is contained in:
parent
ff8baa1c85
commit
dc3eba9100
@ -468,7 +468,7 @@ void MQTT::publishQueuedMessages()
|
|||||||
LOG_DEBUG("Publishing enqueued MQTT message\n");
|
LOG_DEBUG("Publishing enqueued MQTT message\n");
|
||||||
// FIXME - this size calculation is super sloppy, but it will go away once we dynamically alloc meshpackets
|
// FIXME - this size calculation is super sloppy, but it will go away once we dynamically alloc meshpackets
|
||||||
meshtastic_ServiceEnvelope *env = mqttQueue.dequeuePtr(0);
|
meshtastic_ServiceEnvelope *env = mqttQueue.dequeuePtr(0);
|
||||||
static uint8_t bytes[meshtastic_MeshPacket_size + 64];
|
static uint8_t bytes[meshtastic_MqttClientProxyMessage_size];
|
||||||
size_t numBytes = pb_encode_to_bytes(bytes, sizeof(bytes), &meshtastic_ServiceEnvelope_msg, env);
|
size_t numBytes = pb_encode_to_bytes(bytes, sizeof(bytes), &meshtastic_ServiceEnvelope_msg, env);
|
||||||
std::string topic;
|
std::string topic;
|
||||||
if (env->packet->pki_encrypted) {
|
if (env->packet->pki_encrypted) {
|
||||||
@ -555,7 +555,7 @@ void MQTT::onSend(const meshtastic_MeshPacket &mp, const meshtastic_MeshPacket &
|
|||||||
|
|
||||||
if (moduleConfig.mqtt.proxy_to_client_enabled || this->isConnectedDirectly()) {
|
if (moduleConfig.mqtt.proxy_to_client_enabled || this->isConnectedDirectly()) {
|
||||||
// FIXME - this size calculation is super sloppy, but it will go away once we dynamically alloc meshpackets
|
// FIXME - this size calculation is super sloppy, but it will go away once we dynamically alloc meshpackets
|
||||||
static uint8_t bytes[meshtastic_MeshPacket_size + 64];
|
static uint8_t bytes[meshtastic_MqttClientProxyMessage_size];
|
||||||
size_t numBytes = pb_encode_to_bytes(bytes, sizeof(bytes), &meshtastic_ServiceEnvelope_msg, env);
|
size_t numBytes = pb_encode_to_bytes(bytes, sizeof(bytes), &meshtastic_ServiceEnvelope_msg, env);
|
||||||
std::string topic = cryptTopic + channelId + "/" + owner.id;
|
std::string topic = cryptTopic + channelId + "/" + owner.id;
|
||||||
LOG_DEBUG("MQTT Publish %s, %u bytes\n", topic.c_str(), numBytes);
|
LOG_DEBUG("MQTT Publish %s, %u bytes\n", topic.c_str(), numBytes);
|
||||||
@ -651,7 +651,7 @@ void MQTT::perhapsReportToMap()
|
|||||||
se->packet = mp;
|
se->packet = mp;
|
||||||
|
|
||||||
// FIXME - this size calculation is super sloppy, but it will go away once we dynamically alloc meshpackets
|
// FIXME - this size calculation is super sloppy, but it will go away once we dynamically alloc meshpackets
|
||||||
static uint8_t bytes[meshtastic_MeshPacket_size + 64];
|
static uint8_t bytes[meshtastic_MqttClientProxyMessage_size];
|
||||||
size_t numBytes = pb_encode_to_bytes(bytes, sizeof(bytes), &meshtastic_ServiceEnvelope_msg, se);
|
size_t numBytes = pb_encode_to_bytes(bytes, sizeof(bytes), &meshtastic_ServiceEnvelope_msg, se);
|
||||||
|
|
||||||
LOG_INFO("MQTT Publish map report to %s\n", mapTopic.c_str());
|
LOG_INFO("MQTT Publish map report to %s\n", mapTopic.c_str());
|
||||||
|
Loading…
Reference in New Issue
Block a user