Class RelayJNI


public class RelayJNI
extends DIOJNI
Relay Output HAL JNI Functions.
See Also:
"hal/Relay.h"
  • Method Details

    • initializeRelayPort

      public static int initializeRelayPort​(int halPortHandle, boolean forward)
      Initializes a relay.

      Note this call will only initialize either the forward or reverse port of the relay. If you need both, you will need to initialize 2 relays.

      Parameters:
      halPortHandle - the port handle to initialize
      forward - true for the forward port, false for the reverse port
      Returns:
      the created relay handle
      See Also:
      "HAL_InitializeRelayPort"
    • freeRelayPort

      public static void freeRelayPort​(int relayPortHandle)
      Frees a relay port.
      Parameters:
      relayPortHandle - the relay handle
      See Also:
      "HAL_FreeRelayPort"
    • checkRelayChannel

      public static boolean checkRelayChannel​(int channel)
      Checks if a relay channel is valid.
      Parameters:
      channel - the channel to check
      Returns:
      true if the channel is valid, otherwise false
      See Also:
      "HAL_CheckRelayChannel"
    • setRelay

      public static void setRelay​(int relayPortHandle, boolean on)
      Sets the state of a relay output.
      Parameters:
      relayPortHandle - the relay handle
      on - true for on, false for off
      See Also:
      "HAL_SetRelay"
    • getRelay

      public static boolean getRelay​(int relayPortHandle)
      Gets the current state of the relay channel.
      Parameters:
      relayPortHandle - the relay handle
      Returns:
      true for on, false for off
      See Also:
      "HAL_GetRelay"