-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Added support for packet send, receive over serial io similar to mqtt #11580
New issue
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -33,6 +33,9 @@ | |||||||||||||||||||||
| #include "platform/portduino/PortduinoGlue.h" | ||||||||||||||||||||||
| #include "serialization/MeshPacketSerializer.h" | ||||||||||||||||||||||
| #endif | ||||||||||||||||||||||
| #ifdef USE_SERIAL_PACKET_IO | ||||||||||||||||||||||
| #include "modules/SerialModule.h" | ||||||||||||||||||||||
| #endif | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| #define MAX_RX_FROMRADIO \ | ||||||||||||||||||||||
| 4 // max number of packets destined to our queue, we dispatch packets quickly so it doesn't need to be big | ||||||||||||||||||||||
|
|
@@ -595,7 +598,11 @@ ErrorCode Router::send(meshtastic_MeshPacket *p) | |||||||||||||||||||||
| #endif | ||||||||||||||||||||||
| packetPool.release(p_decoded); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| #ifdef USE_SERIAL_PACKET_IO | ||||||||||||||||||||||
| if (moduleConfig.serial.enabled) { | ||||||||||||||||||||||
| serialModuleRadio->onSend(p); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| #endif | ||||||||||||||||||||||
|
Comment on lines
+601
to
+605
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win Check
The adjacent UDP block on Line 607 uses the same shape and does check 🐛 Proposed fix `#ifdef` USE_SERIAL_PACKET_IO
- if (moduleConfig.serial.enabled) {
+ if (serialModuleRadio && moduleConfig.serial.enabled) {
serialModuleRadio->onSend(p);
}
`#endif`📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||
| #if HAS_UDP_MULTICAST | ||||||||||||||||||||||
| if (udpHandler && config.network.enabled_protocols & meshtastic_Config_NetworkConfig_ProtocolFlags_UDP_BROADCAST) { | ||||||||||||||||||||||
| udpHandler->onSend(const_cast<meshtastic_MeshPacket *>(p)); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: meshtastic/firmware
Length of output: 5708
🏁 Script executed:
Repository: meshtastic/firmware
Length of output: 50378
Use a valid channel when no pending packet exists.
When
config.lora.tx_enabledis false,oldcan be null, but line 90 dereferencesold->packet->channel. Usep->channelor guard the null case before callingsendAckNak; otherwise wired-only traffic can crash the router.🤖 Prompt for AI Agents