mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-29 11:01:15 +00:00
issue 879 - changes to Router.cpp
This commit is contained in:
parent
ee9c72b8c7
commit
5eb2e6401f
@ -161,7 +161,7 @@ ErrorCode Router::sendLocal(MeshPacket *p)
|
|||||||
// If we are sending a broadcast, we also treat it as if we just received it ourself
|
// If we are sending a broadcast, we also treat it as if we just received it ourself
|
||||||
// this allows local apps (and PCs) to see broadcasts sourced locally
|
// this allows local apps (and PCs) to see broadcasts sourced locally
|
||||||
if (p->to == NODENUM_BROADCAST) {
|
if (p->to == NODENUM_BROADCAST) {
|
||||||
handleReceived(p);
|
handleReceived(p, RX_SRC_LOCAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return send(p);
|
return send(p);
|
||||||
@ -324,7 +324,7 @@ NodeNum Router::getNodeNum()
|
|||||||
* Handle any packet that is received by an interface on this node.
|
* Handle any packet that is received by an interface on this node.
|
||||||
* Note: some packets may merely being passed through this node and will be forwarded elsewhere.
|
* Note: some packets may merely being passed through this node and will be forwarded elsewhere.
|
||||||
*/
|
*/
|
||||||
void Router::handleReceived(MeshPacket *p)
|
void Router::handleReceived(MeshPacket *p, RxSource src)
|
||||||
{
|
{
|
||||||
// Also, we should set the time from the ISR and it should have msec level resolution
|
// Also, we should set the time from the ISR and it should have msec level resolution
|
||||||
p->rx_time = getValidTime(RTCQualityFromNet); // store the arrival timestamp for the phone
|
p->rx_time = getValidTime(RTCQualityFromNet); // store the arrival timestamp for the phone
|
||||||
@ -333,13 +333,16 @@ void Router::handleReceived(MeshPacket *p)
|
|||||||
bool decoded = perhapsDecode(p);
|
bool decoded = perhapsDecode(p);
|
||||||
if (decoded) {
|
if (decoded) {
|
||||||
// parsing was successful, queue for our recipient
|
// parsing was successful, queue for our recipient
|
||||||
printPacket("handleReceived", p);
|
if (src == RX_SRC_LOCAL)
|
||||||
|
printPacket("handleReceived(local)", p);
|
||||||
|
else
|
||||||
|
printPacket("handleReceived(remote)", p);
|
||||||
} else {
|
} else {
|
||||||
printPacket("packet decoding failed (no PSK?)", p);
|
printPacket("packet decoding failed (no PSK?)", p);
|
||||||
}
|
}
|
||||||
|
|
||||||
// call plugins here
|
// call plugins here
|
||||||
MeshPlugin::callPlugins(*p);
|
MeshPlugin::callPlugins(*p, src);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Router::perhapsHandleReceived(MeshPacket *p)
|
void Router::perhapsHandleReceived(MeshPacket *p)
|
||||||
|
@ -122,7 +122,7 @@ class Router : protected concurrency::OSThread
|
|||||||
* Note: this packet will never be called for messages sent/generated by this node.
|
* Note: this packet will never be called for messages sent/generated by this node.
|
||||||
* Note: this method will free the provided packet.
|
* Note: this method will free the provided packet.
|
||||||
*/
|
*/
|
||||||
void handleReceived(MeshPacket *p);
|
void handleReceived(MeshPacket *p, RxSource src = RX_SRC_RADIO);
|
||||||
|
|
||||||
/** Frees the provided packet, and generates a NAK indicating the speicifed error while sending */
|
/** Frees the provided packet, and generates a NAK indicating the speicifed error while sending */
|
||||||
void abortSendAndNak(Routing_Error err, MeshPacket *p);
|
void abortSendAndNak(Routing_Error err, MeshPacket *p);
|
||||||
|
Loading…
Reference in New Issue
Block a user