Class MacroHelper.MacroExecuteRequest

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

public static class MacroHelper.MacroExecuteRequest
extends DataRequest
implements IWriteOnlyRequest<java.lang.String>
This class implements macro execute request. It is a WRITE type request, writing a string at offset 0x0D70. This string than identifies what macro from what macro file should FSUIPC execute. Note that the string format is: "<macro file name>:<macro_name>". The maximum length of the <macro file name> is 16 characters. The maximum length of the <macro_name> is 16 characters. The separator char must be ":". The constructors as well as the setValue(java.lang.String) will check for these limitations and will raise the InvalidParameterException if not met.
  • Field Details

    • MACRO_SEPARATOR

      public static final char MACRO_SEPARATOR
      This character is used to separate macro file name and macro name when calling macro using FSUIPC
      See Also:
      Constant Field Values
  • Constructor Details

    • MacroExecuteRequest

      public MacroExecuteRequest​(java.lang.String macro) throws java.security.InvalidParameterException
      Constructs new macro execute request to execute given macro.
      Parameters:
      macro - A macro to execute.
      Throws:
      java.security.InvalidParameterException
    • MacroExecuteRequest

      public MacroExecuteRequest​(java.lang.String macro, java.nio.charset.Charset charset) throws java.security.InvalidParameterException
      Constructs new macro execute request to execute given macro.
      Parameters:
      macro - A macro to execute.
      charset - Charset to use during conversion of macro to the byte array for FSUIPC.
      Throws:
      java.security.InvalidParameterException
    • MacroExecuteRequest

      public MacroExecuteRequest​(java.lang.String macroFile, java.lang.String macroName) throws java.security.InvalidParameterException
      Constructs new macro execute request to execute given macro from given macro file.
      Parameters:
      macroFile - Macro file name.
      macroName - Name of the macro inside the macro file.
      Throws:
      java.security.InvalidParameterException
    • MacroExecuteRequest

      public MacroExecuteRequest​(java.lang.String macroFile, java.lang.String macroName, java.nio.charset.Charset charset) throws java.security.InvalidParameterException
      Constructs new macro execute request to execute given macro from given macro file.
      Parameters:
      macroFile - Macro file name.
      macroName - Name of the macro inside the macro file.
      charset - Charset to use during conversion of macroFile and macroName to the byte array for FSUIPC.
      Throws:
      java.security.InvalidParameterException
  • Method Details

    • setValue

      public void setValue​(java.lang.String value)
      (The name of the macro file, the ":" char and the name of macro within that file).
      Specified by:
      setValue in interface IDataRequest<java.lang.String>
      Parameters:
      value - A macro to execute.
    • getCharset

      public java.nio.charset.Charset getCharset()
      Returns the charset that is used to convert string containing macro file and macro name 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 macro file name and macro name 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.