java.lang.Object
ch.ladestation.connectncharge.util.Pi4JContext

public final class Pi4JContext extends Object
Pi4JContext is made for applications with GUI and PUI.

These applications need to run on desktop (for development) and on Raspberry Pi.

In desktop environment the Pi4J MockPlatform is used, on Raspberry Pi the Pi4J RaspberryPiPlatform.

  • Method Details

    • createContext

      public static com.pi4j.context.Context createContext()
      Creates a new Pi4J Context depending on the machine the app is running.
      Returns:
      Context that will be used by this app
    • createMockContext

      public static com.pi4j.context.Context createMockContext()
      This is needed in 'Desktop Mode' when we don't have a real GPIO
      Returns:
      Context that will be used by this app