Interface BoardIdentifier

All Known Implementing Classes:
Board, BoardIfaceLink, FirmwareUpdatableLink, HardwareLink, UpdatableBoard

public interface BoardIdentifier
Uniquely identifies a board in an assembly. Every board has both a type and an identifier.

The type represents the logical type of the board. For example, a "microStatic12" or "agit8" or ADA board. The type of the board generally defines the functionality of the board. It may be that there are multiple revisions or models of a given board, even minor differences in the functionality of those revisions, but for any given board type the general function of the board in the device is reasonably well-defined.

The type is flexible, and namespaced types are encouraged. For example, Freestyle hardware types may be namespaced such as:

  • freestyle.microStatic12
  • freestyle.agit8
This minimizes the possibility of type collisions when mixing hardware from different sources. The instanceId of the board is used to differentiate multiple instances of the same board within the device.

Consider a dispenser with three ingredient shelves, each with a microStatic12 board. Each board must be correctly located within the dispenser to ensure the correct board is used to control the pumps on the correct shelf. Some Freestyle hardware uses a position indicator in the wiring harness that the board can read from the bootloader, which identifies the position such as 1, 2, 3, etc.

This can be used as the identifierId to properly locate the correct logical board in the assembly. Anything that uniquely identifies multiple instances of the same board can be used as the instanceId, but this must be deterministic and known in advance as the logical board in the assembly will be statically configured with this instanceId. This means the instanceId cannot be something only known at runtime, such as the serial number, as there is no way to know which serial number is located where in advance of discovering the serial number.

If there is only one instance of a board type in an assembly, then the identifierId can be null.

Since:
1.0
Version:
2022-12-01
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the instanceId of the board.
    Returns the type of the board.
  • Method Details

    • getType

      String getType()
      Returns the type of the board.

      The hardware service uses the type to determine compatible firmware, as well as to link with adapters that are connected to the matching physical board.

      If a physical board is revised, it may keep the same type but have different variant information. The logical board is primarily concerned with the high-level feature set of the hardware, and leverages the link to the adapter to perform actual operations on the hardware. This means that a new version of a board can be spun with a different CPU and hardware changes, but so long as the protocol to the device is the same, it can still have the same board type.

    • getInstanceId

      String getInstanceId()
      Returns the instanceId of the board.

      If there is more than one instance of the board in the system, then the instanceId is used to determine which one is which. Typically, the hardware has a mechanism to identify which instance it is (via cable harness, jumper or some other mechanism), and that is the value that must be used here. For example, if a device can contain three instances of a board, and the cable harness allows the board to identify its position as "1", "2", or "3", then the logical board must use an instanceId of "1", "2", or "3" so that hardware service can match the incoming adapter link to the logical board.

      In general, there should never be more than one instance of a particular board type with the same identifierId, as there is no way to distinguish them from each other.

      If there is only one instance of the board, this will typically return null, as the hardware will not need to determine an instance ID in the adapter code.