Skip to content

Commit

Permalink
SimRadio: send queue status to phone (#3041)
Browse files Browse the repository at this point in the history
Co-authored-by: Ben Meadors <[email protected]>
  • Loading branch information
GUVWAF and thebentern authored Dec 27, 2023
1 parent d318d34 commit 2d35f72
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/mesh/MeshService.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ class MeshService

bool isToPhoneQueueEmpty();

ErrorCode sendQueueStatusToPhone(const meshtastic_QueueStatus &qs, ErrorCode res, uint32_t mesh_packet_id);

private:
/// Called when our gps position has changed - updates nodedb and sends Location message out into the mesh
/// returns 0 to allow further processing
Expand All @@ -138,8 +140,6 @@ class MeshService
/// needs to keep the packet around it makes a copy
int handleFromRadio(const meshtastic_MeshPacket *p);
friend class RoutingModule;

ErrorCode sendQueueStatusToPhone(const meshtastic_QueueStatus &qs, ErrorCode res, uint32_t mesh_packet_id);
};

extern MeshService service;
4 changes: 3 additions & 1 deletion src/platform/portduino/SimRadio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ void SimRadio::startSend(meshtastic_MeshPacket *txp)
p->decoded.payload.size =
pb_encode_to_bytes(p->decoded.payload.bytes, sizeof(p->decoded.payload.bytes), &meshtastic_Compressed_msg, &c);
p->decoded.portnum = meshtastic_PortNum_SIMULATOR_APP;

service.sendQueueStatusToPhone(router->getQueueStatus(), 0, p->id);
service.sendToPhone(p); // Sending back to simulator
}

Expand Down Expand Up @@ -263,4 +265,4 @@ int16_t SimRadio::readData(uint8_t *data, size_t len)
}

return state;
}
}

0 comments on commit 2d35f72

Please sign in to comment.