Package edu.wpi.first.networktables
Class RpcCall
- java.lang.Object
-
- edu.wpi.first.networktables.RpcCall
-
- All Implemented Interfaces:
AutoCloseable
public final class RpcCall extends Object implements AutoCloseable
NetworkTables Remote Procedure Call.
-
-
Constructor Summary
Constructors Constructor Description RpcCall(NetworkTableEntry entry, int call)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancelResult()Ignore the result.voidclose()Cancels the result if no other action taken.intgetCall()Get the call native handle.NetworkTableEntrygetEntry()Get the RPC entry.byte[]getResult()Get the result (return value).byte[]getResult(double timeout)Get the result (return value).booleanisValid()Determines if the native handle is valid.
-
-
-
Constructor Detail
-
RpcCall
public RpcCall(NetworkTableEntry entry, int call)
Constructor. This should generally only be used internally to NetworkTables.- Parameters:
entry- Entrycall- Call handle
-
-
Method Detail
-
close
public void close()
Cancels the result if no other action taken.- Specified by:
closein interfaceAutoCloseable
-
isValid
public boolean isValid()
Determines if the native handle is valid.- Returns:
- True if the native handle is valid, false otherwise.
-
getEntry
public NetworkTableEntry getEntry()
Get the RPC entry.- Returns:
- NetworkTableEntry for the RPC.
-
getCall
public int getCall()
Get the call native handle.- Returns:
- Native handle.
-
getResult
public byte[] getResult()
Get the result (return value). This function blocks until the result is received.- Returns:
- Received result (output)
-
getResult
public byte[] getResult(double timeout)
Get the result (return value). This function blocks until the result is received or it times out.- Parameters:
timeout- timeout, in seconds- Returns:
- Received result (output)
-
cancelResult
public void cancelResult()
Ignore the result. This function is non-blocking.
-
-