Class PubSubOption

java.lang.Object
edu.wpi.first.networktables.PubSubOption

public class PubSubOption
extends Object
NetworkTables publish/subscribe option.
  • Method Details

    • periodic

      public static PubSubOption periodic​(double period)
      How frequently changes will be sent over the network. NetworkTables may send more frequently than this (e.g. use a combined minimum period for all values) or apply a restricted range to this value. The default if unspecified is 100 ms.
      Parameters:
      period - time between updates, in seconds
      Returns:
      option
    • sendAll

      public static PubSubOption sendAll​(boolean enabled)
      If enabled, sends all value changes over the network. This option defaults to disabled.
      Parameters:
      enabled - True to enable, false to disable
      Returns:
      option
    • topicsOnly

      public static PubSubOption topicsOnly​(boolean enabled)
      If enabled on a subscription, does not request value changes. This option defaults to disabled.
      Parameters:
      enabled - True to enable, false to disable
      Returns:
      option
    • keepDuplicates

      public static PubSubOption keepDuplicates​(boolean enabled)
      If enabled, preserves duplicate value changes (rather than ignoring them). This option defaults to disabled.
      Parameters:
      enabled - True to enable, false to disable
      Returns:
      option
    • pollStorage

      public static PubSubOption pollStorage​(int depth)
      Polling storage for subscription. Specifies the maximum number of updates NetworkTables should store between calls to the subscriber's readQueue() function. Defaults to 1 if sendAll is false, 20 if sendAll is true.
      Parameters:
      depth - number of entries to save for polling.
      Returns:
      option
    • disableRemote

      public static PubSubOption disableRemote​(boolean disabled)
      For subscriptions, specify whether remote value updates should not be queued for readQueue(). See also disableLocal(). Defaults to false (remote value updates are queued).
      Parameters:
      disabled - True to disable, false to enable
      Returns:
      option
    • disableLocal

      public static PubSubOption disableLocal​(boolean disabled)
      For subscriptions, specify whether local value updates should not be queued for readQueue(). See also disableRemote(). Defaults to false (local value updates are queued).
      Parameters:
      disabled - True to disable, false to enable
      Returns:
      option
    • excludePublisher

      public static PubSubOption excludePublisher​(int publisher)
      Don't queue value updates for the given publisher. Only has an effect on subscriptions. Only one exclusion may be set.
      Parameters:
      publisher - publisher handle to exclude
      Returns:
      option
    • excludePublisher

      public static PubSubOption excludePublisher​(Publisher publisher)
      Don't queue value updates for the given publisher. Only has an effect on subscriptions. Only one exclusion may be set.
      Parameters:
      publisher - publisher to exclude
      Returns:
      option
    • excludeSelf

      public static PubSubOption excludeSelf​(boolean enabled)
      Don't queue value updates for the internal publisher for an entry. Only has an effect on entries.
      Parameters:
      enabled - True to enable, false to disable
      Returns:
      option