Document CmndSetoptionBase()

This commit is contained in:
Theo Arends 2021-01-26 12:03:08 +01:00
parent d7de841a1b
commit 8ba0c9d1b7
1 changed files with 8 additions and 10 deletions

View File

@ -47,7 +47,7 @@ const char kTasmotaCommands[] PROGMEM = "|" // No prefix
void (* const TasmotaCommand[])(void) PROGMEM = { void (* const TasmotaCommand[])(void) PROGMEM = {
&CmndBacklog, &CmndDelay, &CmndPower, &CmndStatus, &CmndState, &CmndSleep, &CmndUpgrade, &CmndUpgrade, &CmndOtaUrl, &CmndBacklog, &CmndDelay, &CmndPower, &CmndStatus, &CmndState, &CmndSleep, &CmndUpgrade, &CmndUpgrade, &CmndOtaUrl,
&CmndSeriallog, &CmndRestart, &CmndPowerOnState, &CmndPulsetime, &CmndBlinktime, &CmndBlinkcount, &CmndSavedata, &CmndSeriallog, &CmndRestart, &CmndPowerOnState, &CmndPulsetime, &CmndBlinktime, &CmndBlinkcount, &CmndSavedata,
&CmndSetoptionSO, &CmndSetoption, &CmndTemperatureResolution, &CmndHumidityResolution, &CmndPressureResolution, &CmndPowerResolution, &CmndSetoption, &CmndSetoption, &CmndTemperatureResolution, &CmndHumidityResolution, &CmndPressureResolution, &CmndPowerResolution,
&CmndVoltageResolution, &CmndFrequencyResolution, &CmndCurrentResolution, &CmndEnergyResolution, &CmndWeightResolution, &CmndVoltageResolution, &CmndFrequencyResolution, &CmndCurrentResolution, &CmndEnergyResolution, &CmndWeightResolution,
&CmndModule, &CmndModules, &CmndGpio, &CmndGpios, &CmndTemplate, &CmndPwm, &CmndPwmfrequency, &CmndPwmrange, &CmndModule, &CmndModules, &CmndGpio, &CmndGpios, &CmndTemplate, &CmndPwm, &CmndPwmfrequency, &CmndPwmrange,
&CmndButtonDebounce, &CmndSwitchDebounce, &CmndSyslog, &CmndLoghost, &CmndLogport, &CmndSerialSend, &CmndBaudrate, &CmndSerialConfig, &CmndButtonDebounce, &CmndSwitchDebounce, &CmndSyslog, &CmndLoghost, &CmndLogport, &CmndSerialSend, &CmndBaudrate, &CmndSerialConfig,
@ -844,19 +844,17 @@ void CmndSavedata(void)
ResponseCmndChar((Settings.save_data > 1) ? stemp1 : GetStateText(Settings.save_data)); ResponseCmndChar((Settings.save_data > 1) ? stemp1 : GetStateText(Settings.save_data));
} }
void CmndSetoptionSO(void) void CmndSetoption(void) {
{
snprintf_P(XdrvMailbox.command, CMDSZ, PSTR(D_CMND_SETOPTION)); // Rename result shortcut command SO to SetOption snprintf_P(XdrvMailbox.command, CMDSZ, PSTR(D_CMND_SETOPTION)); // Rename result shortcut command SO to SetOption
CmndSetoptionBase(1); CmndSetoptionBase(1);
} }
void CmndSetoption(void) void CmndSetoptionBase(bool indexed) {
{ // Allow a command to access a single SetOption by it's command name
CmndSetoptionBase(1); // indexed = 0 : No index will be returned attached to the command
} // {"ClockDirection":"OFF"}
// indexed = 1 : The SetOption index will be returned with the command
void CmndSetoptionBase(bool indexed) // {"SetOption16":"OFF"}
{
if (XdrvMailbox.index < 146) { if (XdrvMailbox.index < 146) {
uint32_t ptype; uint32_t ptype;
uint32_t pindex; uint32_t pindex;