Skip to main content

Module mission

Module mission 

Source
Expand description

The mission (plan) transfer protocol.

A plan is transferred one item at a time, driven entirely by the receiver: the receiver announces or is told the item count, then requests item 0, item 1, and so on, and the sender answers each request with the matching MissionItemInt. The transfer ends with a MissionAck. Items must arrive in order; an out-of-order item is dropped and the expected sequence number is re-requested.

The two roles are symmetric, so this module models them as two machines rather than by direction: a MissionSender holds the items and answers requests, and a MissionReceiver asks for items and collects them. A ground station uploading a plan is a sender talking to a vehicle receiver; a ground station downloading a plan is a receiver talking to a vehicle sender. The same two machines cover both, and neither allocates: the sender borrows the item slice, and the receiver hands each item back to the caller instead of storing them.

Structs§

MissionReceiver
Requests a plan’s items in order and collects them, ending with an acknowledgement.
MissionSender
Holds a plan and answers a receiver’s requests for its items.

Enums§

ReceiverAction
The next thing a MissionReceiver should send.