ZUNO_SETUP_CONFIGPARAMETERS()

Z-Uno can be configured using standard Z-Wave Configuration feature. A Z-Wave controller can push parameter values to Z-Uno to tune Z-Uno behavior without changing Z-Uno sketch.

Z-Uno supports up to 32 configurable parameters.

User is able to add metainformation (like name, descriptions, minimal, maximal & default values) about device configuration parameters using this macro.
ZUNO_SETUP_CONFIGPARAMETERS(parameter1, parameter2, ...) parameter Parameter description array This array should contain structures, each consists of the following items:
  • name (c-string)
  • description (c-string)
  • minimal value
  • maximum value
  • default value
  • size (in bytes, up to 4)
  • format (signed/unsigned)
  • read only
  • altering (parameter changes Z-Wave structure of device)
  • advanced (not for common user interface)
To make life easier there are simple macro defining popular parameters types:
  • ZUNO_CONFIG_PARAMETER_INFO(NAME, DESCR, MN, MX, DEF) - defines 4 bytes unsigned parameter
  • ZUNO_CONFIG_PARAMETER_INFO_SIGN(NAME, DESCR, MN, MX, DEF) - defines 4 bytes signed parameter
  • ZUNO_CONFIG_PARAMETER_1B_INFO(NAME, DESCR, MN, MX, DEF) - defines 1 byte unsigned parameter
  • ZUNO_CONFIG_PARAMETER_1B_INFO_SIGN(NAME, DESCR, MN, MX, DEF) - defines 1 byte signed parameter
  • ZUNO_CONFIG_PARAMETER_2B_INFO(NAME, DESCR, MN, MX, DEF) - defines 2 bytes unsigned parameter
  • ZUNO_CONFIG_PARAMETER_2B_INFO_SIGN(NAME, DESCR, MN, MX, DEF) - defines 2 bytes signed parameter
  • ZUNO_CONFIG_PARAMETER(NAME, MN, MX, DEF) - defines 4 bytes unsigned parameter. Doesn't set description.
  • ZUNO_CONFIG_PARAMETER_SIGN(NAME, MN, MX, DEF) - defines 4 bytes signed parameter. Doesn't set description.
  • ZUNO_CONFIG_PARAMETER_1B(NAME, MN, MX, DEF) - defines 1 byte unsigned parameter. Doesn't set description.
  • ZUNO_CONFIG_PARAMETER_1B_SIGN(NAME, MN, MX, DEF) - defines 1 byte signed parameter. Doesn't set description.
  • ZUNO_CONFIG_PARAMETER_2B(NAME, MN, MX, DEF) - defines 2 bytes unsigned parameter. Doesn't set description.
  • ZUNO_CONFIG_PARAMETER_2B_SIGN(NAME, MN, MX, DEF) - defines 2 bytes signed parameter. Doesn't set description.
Core uses provided metainformation when receives set requests. If controller tries to setup invalid value request will be blocked.

// enum for parameter numbers
enum{
    TEMP_HYST_PARAM=64,
    HUMIDITY_HYST_PARAM,
    MOTION_RETRIGGER_TIME_PARAM 
};
// Device's configuration parametrs definitions  
ZUNO_SETUP_CONFIGPARAMETERS(
        ZUNO_CONFIG_PARAMETER_INFO("Temperature hysteresis", "Defines hysteresis of temperature", 1, 20, 5),
        ZUNO_CONFIG_PARAMETER_INFO("Humidity hysteresis", "Defines hysteresis of humidity", 1, 20, 5),
        ZUNO_CONFIG_PARAMETER_INFO("Motion trigger time", "Minimal trigger interval in ms", 0, 100000, 5000)
);
void setup(){
    Serial.begin();
}
void loop(){
    Serial.print("Temperature hyst.:");
    Serial.println(zunoLoadCFGParam(TEMP_HYST_PARAM));
    Serial.print("Humidity hyst.:");
    Serial.println(zunoLoadCFGParam(HUMIDITY_HYST_PARAM));
    Serial.print("Retrigger interval:");
    Serial.println(zunoLoadCFGParam(MOTION_RETRIGGER_TIME_PARAM));
    delay(10000);
}
ZUNO_SETUP_CFGPARAMETER_HANDLER().
Get more information about Z-Wave.