manual telem packet creation, compiles.

This commit is contained in:
Tavis 2024-07-10 11:53:47 -10:00
parent 86eaf152ba
commit 416fac62dd
2 changed files with 9 additions and 2 deletions

@ -1 +1 @@
Subproject commit 8f4faf76e52c2ef63c582c26642d312d9781b7c0
Subproject commit 7370460a591f80e3ca462df1f36ceeac452c4dc5

View File

@ -313,12 +313,19 @@ int32_t SerialModule::runOnce()
LOG_INFO("(Sending): wind speed=%fm/s, direction=%d degrees\n", m.variant.environment_metrics.wind_speed,
m.variant.environment_metrics.wind_direction);
meshtastic_MeshPacket *p = allocDataProtobuf(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);
// reset counters
velSum = velCount = dirSum = dirCount = 0;
gust = 0;