Class NetworkTableEvent

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

public final class NetworkTableEvent extends Object
NetworkTables event.

There are different kinds of events. When creating a listener, a combination of event kinds can be listened to by building an EnumSet of NetworkTableEvent.Kind.

  • Field Details

    • listener

      public final int listener
      Handle of listener that was triggered. The value returned when adding the listener can be used to map this to a specific added listener.
    • connInfo

      public final ConnectionInfo connInfo
      Connection information (for connection events).
    • topicInfo

      public final TopicInfo topicInfo
      Topic information (for topic events).
    • valueData

      public final ValueEventData valueData
      Value data (for value events).
    • logMessage

      public final LogMessage logMessage
      Log message (for log message events).
    • timeSyncData

      Log message (for log message events).
  • Constructor Details

    • NetworkTableEvent

      public NetworkTableEvent(NetworkTableInstance inst, int listener, int flags, ConnectionInfo connInfo, TopicInfo topicInfo, ValueEventData valueData, LogMessage logMessage, TimeSyncEventData timeSyncData)
      Constructor. This should generally only be used internally to NetworkTables.
      Parameters:
      inst - Instance
      listener - Listener that was triggered
      flags - Event flags
      connInfo - Connection information
      topicInfo - Topic information
      valueData - Value data
      logMessage - Log message
      timeSyncData - Time sync data
  • Method Details

    • is

      public boolean is(NetworkTableEvent.Kind kind)
      Determine if event is of a particular kind. For example, kPublish if the topic was not previously published. Also indicates the data included with the event:
      • kConnected or kDisconnected: connInfo
      • kPublish, kUnpublish, or kProperties: topicInfo
      • kValueRemote, kValueLocal: valueData
      • kLogMessage: logMessage
      Parameters:
      kind - Kind
      Returns:
      True if event matches kind
    • getInstance

      Gets the instance associated with this event.
      Returns:
      Instance