pub enum Command<'a> {
    Wait {
        correlation_id: Option<u32>,
        poll: Option<u32>,
    },
    Sync {
        version: Bytes<'a>,
        correlation_id: Option<u32>,
        poll: Option<u32>,
    },
    Write {
        version: Bytes<'a>,
        correlation_id: Option<u32>,
        offset: u32,
        data: Bytes<'a>,
    },
    Swap {
        version: Bytes<'a>,
        correlation_id: Option<u32>,
        checksum: Bytes<'a>,
    },
}
Expand description

Represents a command issued from the update service to a device.

Variants

Wait

Fields

correlation_id: Option<u32>

Correlation id matching the id sent in the status update.

poll: Option<u32>

The number of seconds the device should wait before sending another status update.

Instruct the device to wait and send its status update at a later time.

Sync

Fields

version: Bytes<'a>

The version that was used for deciding the device was up to date. The device should check it matches its own version.

correlation_id: Option<u32>

Correlation id matching the id sent in the status update.

poll: Option<u32>

The number of seconds the device should wait before sending another status update.

Tell the device that it is up to date and that it can send its status update at a later time.

Write

Fields

version: Bytes<'a>

The firmware version that this block corresponds to. The device should check that this matches version it has been writing so far.

correlation_id: Option<u32>

Correlation id matching the id sent in the status update.

offset: u32

The offset where this block should be written.

data: Bytes<'a>

The firmware data to write.

A block of firmware data that should be written to the device at a given offset.

Swap

Fields

version: Bytes<'a>

The version that was used for deciding the device is ready to swap. The device should check it matches the version being written.

correlation_id: Option<u32>

Correlation id matching the id sent in the status update.

checksum: Bytes<'a>

The full checksum of the firmware being written. The device should compare this with the checksum of the firmware it has written before swapping.

Tell the device that it has now written all of the firmware and that it can commence the swap/update operation.

Implementations

Create a new Wait command

Create a new Sync command.

Create a new Swap command

Create a new Write command.

Trait Implementations

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.