aboutsummaryrefslogtreecommitdiff
path: root/pyecsca/sca/target/flash.py
blob: 8ab1883539b876b41b830db1af021221a6b9e567 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"""Provides a mix-in class of a flashable target (e.g. one where the code gets flashed to it before running)."""

from public import public
from abc import ABC, abstractmethod


@public
class Flashable(ABC):
    """A flashable target."""

    @abstractmethod
    def flash(self, fw_path: str) -> bool:
        """
        Flash the firmware at `fw_path` to the target.

        :param fw_path: The path to the firmware blob.
        :return: Whether the flashing was successful.
        """
        raise NotImplementedError