Interface IfaceAwareBoard


public interface IfaceAwareBoard
It is common that a Board class in KOS is linked to physical hardware using an adapter. The Board class then needs to get access to the BinaryMsgSession from the adapter in order to create an instance of an iface used to communicate to the board.

To simplify this process, an adapter can implement the board iface. This allows HardwareService to automatically detect when the adapter is started, fetch the board details, and link the physical board to the logical board without any additional code. However, this doesn't solve the problem of creating the custom iface instance to interact with the board.

A board that implements IfaceAwareBoard that leverages the board detection logic mentioned above, will automatically call onLinkSession() when the board is linked and the board can bind any additional ifaces during this callback.

Since:
9
Version:
9
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Called with the BinaryMsgSession that linked to the board.
  • Method Details

    • onLinkSession

      void onLinkSession(BinaryMsgSession session)
      Called with the BinaryMsgSession that linked to the board. This can be used to bind specific ifaces to the session. The ifaces will automatically cleanup on disconnect.
      Since:
      9