mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-25 17:42:48 +00:00
SimRadio: send queue status to phone (#3041)
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
parent
d318d34c3c
commit
2d35f72d85
@ -129,6 +129,8 @@ class MeshService
|
|||||||
|
|
||||||
bool isToPhoneQueueEmpty();
|
bool isToPhoneQueueEmpty();
|
||||||
|
|
||||||
|
ErrorCode sendQueueStatusToPhone(const meshtastic_QueueStatus &qs, ErrorCode res, uint32_t mesh_packet_id);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// Called when our gps position has changed - updates nodedb and sends Location message out into the mesh
|
/// Called when our gps position has changed - updates nodedb and sends Location message out into the mesh
|
||||||
/// returns 0 to allow further processing
|
/// returns 0 to allow further processing
|
||||||
@ -138,8 +140,6 @@ class MeshService
|
|||||||
/// needs to keep the packet around it makes a copy
|
/// needs to keep the packet around it makes a copy
|
||||||
int handleFromRadio(const meshtastic_MeshPacket *p);
|
int handleFromRadio(const meshtastic_MeshPacket *p);
|
||||||
friend class RoutingModule;
|
friend class RoutingModule;
|
||||||
|
|
||||||
ErrorCode sendQueueStatusToPhone(const meshtastic_QueueStatus &qs, ErrorCode res, uint32_t mesh_packet_id);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern MeshService service;
|
extern MeshService service;
|
@ -198,6 +198,8 @@ void SimRadio::startSend(meshtastic_MeshPacket *txp)
|
|||||||
p->decoded.payload.size =
|
p->decoded.payload.size =
|
||||||
pb_encode_to_bytes(p->decoded.payload.bytes, sizeof(p->decoded.payload.bytes), &meshtastic_Compressed_msg, &c);
|
pb_encode_to_bytes(p->decoded.payload.bytes, sizeof(p->decoded.payload.bytes), &meshtastic_Compressed_msg, &c);
|
||||||
p->decoded.portnum = meshtastic_PortNum_SIMULATOR_APP;
|
p->decoded.portnum = meshtastic_PortNum_SIMULATOR_APP;
|
||||||
|
|
||||||
|
service.sendQueueStatusToPhone(router->getQueueStatus(), 0, p->id);
|
||||||
service.sendToPhone(p); // Sending back to simulator
|
service.sendToPhone(p); // Sending back to simulator
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user