mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-23 11:10:52 +00:00
Revert "factor out sendTelemetry function"
This reverts commit b61ba1a3c5.
This commit is contained in:
Submodule protobufs updated: 8f4faf76e5...d191975ebc
@@ -336,7 +336,18 @@ int32_t SerialModule::runOnce()
|
||||
m.variant.environment_metrics.wind_lull, m.variant.environment_metrics.wind_gust,
|
||||
m.variant.environment_metrics.voltage);
|
||||
|
||||
sendTelemetry(m);
|
||||
meshtastic_MeshPacket *p = router->allocForSending();
|
||||
|
||||
p->decoded.portnum = meshtastic_PortNum_TELEMETRY_APP;
|
||||
|
||||
p->decoded.payload.size = pb_encode_to_bytes(p->decoded.payload.bytes, sizeof(p->decoded.payload.bytes),
|
||||
&meshtastic_Telemetry_msg, &m);
|
||||
|
||||
LOG_INFO("payload size : %i\n", p->decoded.payload.size);
|
||||
p->to = NODENUM_BROADCAST;
|
||||
p->decoded.want_response = false;
|
||||
p->priority = meshtastic_MeshPacket_Priority_RELIABLE;
|
||||
service.sendToMesh(p, RX_SRC_LOCAL, true);
|
||||
|
||||
// reset counters and gust/lull
|
||||
velSum = velCount = dirCount = 0;
|
||||
@@ -362,27 +373,6 @@ int32_t SerialModule::runOnce()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends telemetry packet over the mesh network.
|
||||
*
|
||||
* @param m The telemetry data to be sent
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws None
|
||||
*/
|
||||
void SerialModule::sendTelemetry(meshtastic_Telemetry m)
|
||||
{
|
||||
meshtastic_MeshPacket *p = router->allocForSending();
|
||||
p->decoded.portnum = meshtastic_PortNum_TELEMETRY_APP;
|
||||
p->decoded.payload.size =
|
||||
pb_encode_to_bytes(p->decoded.payload.bytes, sizeof(p->decoded.payload.bytes), &meshtastic_Telemetry_msg, &m);
|
||||
p->to = NODENUM_BROADCAST;
|
||||
p->decoded.want_response = false;
|
||||
p->priority = meshtastic_MeshPacket_Priority_RELIABLE;
|
||||
service.sendToMesh(p, RX_SRC_LOCAL, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Allocates a new mesh packet for use as a reply to a received packet.
|
||||
*
|
||||
|
||||
@@ -28,7 +28,6 @@ class SerialModule : public StreamAPI, private concurrency::OSThread
|
||||
|
||||
private:
|
||||
uint32_t getBaudRate();
|
||||
void sendTelemetry(meshtastic_Telemetry m);
|
||||
};
|
||||
|
||||
extern SerialModule *serialModule;
|
||||
|
||||
Reference in New Issue
Block a user