Class LVarHelper.LVarControlRequest

java.lang.Object
com.mouseviator.fsuipc.datarequest.DataRequest
com.mouseviator.fsuipc.helpers.LVarHelper.LVarControlRequest
All Implemented Interfaces:
IDataRequest<java.lang.String>, IWriteOnlyRequest<java.lang.String>
Enclosing class:
LVarHelper

public static class LVarHelper.LVarControlRequest
extends DataRequest
implements IWriteOnlyRequest<java.lang.String>
This class implements Lvar control offset. It is a WRITE type request, writing a string at offset 0x0D70. This string than identifies what should FSUIPC do - read Lvar, write Lvar or create Lvar. By default the control request will tell FSUIPC to read the given Lvar. The Lvar name can be set via constructor or via the setValue(java.lang.String) method. The command - what to do, is being set by constructor or by setCommand(com.mouseviator.fsuipc.helpers.LVarHelper.LVarControlRequestCommand) method.
  • Constructor Details

    • LVarControlRequest

      public LVarControlRequest​(java.lang.String lvar)
      Constructs new Lvar control request to read given Lvar.
      Parameters:
      lvar - Lvar to read.
    • LVarControlRequest

      public LVarControlRequest​(java.lang.String lvar, java.nio.charset.Charset charset)
      Constructs new Lvar control request to read given Lvar.
      Parameters:
      lvar - Lvar to read.
      charset - Charset to use when encoding Lvar name and command to the byte array fro FSUIPC.
    • LVarControlRequest

      public LVarControlRequest​(LVarHelper.LVarControlRequestCommand command, java.lang.String lvar)
      Constructs new Lvar control request to read/write to/create given Lvar.
      Parameters:
      command - A command - whether to read/write to or create given Lvar.
      lvar - An Lvar to read/write to/create.
    • LVarControlRequest

      public LVarControlRequest​(LVarHelper.LVarControlRequestCommand command, java.lang.String lvar, java.nio.charset.Charset charset)
      Constructs new Lvar control request to read/write to/create given Lvar.
      Parameters:
      command - A command - whether to read/write to or create given Lvar.
      lvar - An Lvar to read/write to/create.
      charset - Charset to use when encoding Lvar name and command to the byte array for FSUIPC.
  • Method Details

    • setValue

      public void setValue​(java.lang.String value)
      Will set the value - the name of the lvar to be read/write to/created by this control request. Note that command is LVarHelper.LVarControlRequestCommand.READ by default, unless other command was set by the LVarHelper.LVarControlRequest constructor or setCommand(com.mouseviator.fsuipc.helpers.LVarHelper.LVarControlRequestCommand).
      Specified by:
      setValue in interface IDataRequest<java.lang.String>
      Parameters:
      value - An Lvar name this control command is referencing.
    • getCommand

      Returns the command this control request is set to perform. This is, what should FSUIPC do with the Lvar this control request is referencing to.
      Returns:
      The command.
    • setCommand

      public void setCommand​(LVarHelper.LVarControlRequestCommand command)
      This method will set the command - what should FSUIPC do with the Lvar this control request is referencing.
      Parameters:
      command - The command.
    • getCharset

      public java.nio.charset.Charset getCharset()
      Returns the charset that is used to convert string containing Lvar name and command to the byte array for FSUIPC.
      Returns:
      The charset used.
    • setCharset

      public void setCharset​(java.nio.charset.Charset charset)
      Sets the charset to use when converting string value that should contain Lvar name and command to the byte array for FSUIPC. Call this before setValue(java.lang.String), otherwise the change will have no effect.
      Parameters:
      charset - The charset to use.