38 if (parameters.
Size() == 0)
40 param = String(parameters.
Pop());
56 if (parameters.
Size() == 0)
58 param = String(parameters.
Pop()).toInt();
74 if (parameters.
Size() == 0)
76 param = String(parameters.
Pop()).toInt();
92 if (parameters.
Size() == 0)
94 param = String(parameters.
Pop()).toDouble();
111 if (parameters.
Size() == 0)
113 String rawParam = String(parameters.
Pop());
114 rawParam.toUpperCase();
116 if (rawParam ==
"ON" || rawParam ==
"1")
118 else if (rawParam ==
"OFF" || rawParam ==
"0")
146 for (
size_t i = 0; i < optionsSize; i++)
148 if (paramStr.equalsIgnoreCase(options[i].
stem) || paramStr.equalsIgnoreCase(options[i].
stem + options[i].
suffix))
150 param = options[i].
tag;
172uint8_t
ScpiChoiceToName(
const SCPI_choice_def_t *options,
size_t optionsSize, int8_t value, String &name)
174 for (
size_t i = 0; i < optionsSize; i++)
176 if (options[i].tag == value)
uint8_t Size() const
Get the number of stored strings.
char * Pop()
Remove and return the last string (LIFO pop).
#define TRUE
TRUE constant value, defined to be compatible with comparisons.
#define FALSE
FALSE constant value.
uint8_t ScpiParamChoice(SCPI_P ¶meters, const SCPI_choice_def_t *options, size_t optionsSize, uint8_t ¶m)
Extracts a choice parameter from the SCPI parameter list and maps it to a numerical tag.
uint8_t ScpiParamBool(SCPI_P ¶meters, bool ¶m)
Extracts a boolean parameter ('ON', '1', 'OFF', or '0') from the SCPI parameter list.
uint8_t ScpiParamUInt8(SCPI_P ¶meters, uint8_t ¶m)
Extracts an unsigned 8-bit integer parameter from the SCPI parameter list.
uint8_t ScpiParamUInt32(SCPI_P ¶meters, uint32_t ¶m)
Extracts an unsigned 32-bit integer parameter from the SCPI parameter list.
uint8_t ScpiParamDouble(SCPI_P ¶meters, double ¶m)
Extracts a double-precision floating-point parameter from the SCPI parameter list.
uint8_t ScpiChoiceToName(const SCPI_choice_def_t *options, size_t optionsSize, int8_t value, String &name)
Converts a numerical choice tag back to its string representation.
uint8_t ScpiParamString(SCPI_P ¶meters, String ¶m)
Extracts a string parameter from the SCPI parameter list.
SCPI_Parameters SCPI_P
Alias for SCPI_Parameters.