Skip to content

Latest commit

 

History

History
4692 lines (3434 loc) · 217 KB

helpers.md

File metadata and controls

4692 lines (3434 loc) · 217 KB

Modules

Templating API: Access helpers

This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}

Templating API: Attribute helpers

This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}

Templating API: C formatting helpers

This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}

Templating API: Command helpers

This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}

Templating API: Matter endpoint config helpers

This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}

Templating API: Future helpers

This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}

Templating API: SDK extension helpers

This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}

Templating API: C formatting helpers

This module contains the API for accessing SDK extensions.

Templating API: user-data specific helpers

This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}

Templating API: Token helpers

This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}

Templating API: toplevel utility helpers

This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}

Templating API: static zcl helpers

This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}

Templating API: Zigbee Specific helpers

This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}

Templating API: Access helpers

This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}

  • [Templating API: Access helpers](#module_Templating API_ Access helpers)
    • [~collectDefaultAccessList(ctx, entityType)](#module_Templating API_ Access helpers..collectDefaultAccessList) ⇒
    • [~collectAccesslist(ctx, options)](#module_Templating API_ Access helpers..collectAccesslist) ⇒
    • [~access_aggregate(options)](#module_Templating API_ Access helpers..access_aggregate)
    • [~access(options)](#module_Templating API_ Access helpers..access)
    • [~default_access(options)](#module_Templating API_ Access helpers..default_access) ⇒

Templating API: Access helpers~collectDefaultAccessList(ctx, entityType) ⇒

Collects the default access list

Kind: inner method of [Templating API: Access helpers](#module_Templating API_ Access helpers)
Returns: Promise of default access

Param Type
ctx *
entityType *

Templating API: Access helpers~collectAccesslist(ctx, options) ⇒

Get Access List based on on given options.

Kind: inner method of [Templating API: Access helpers](#module_Templating API_ Access helpers)
Returns: Access List

Param Type
ctx *
options *

Templating API: Access helpers~access_aggregate(options)

This helper creates a context for the aggregates of access.

Kind: inner method of [Templating API: Access helpers](#module_Templating API_ Access helpers)

Param Type
options *

Templating API: Access helpers~access(options)

Access helper iterates across all the access triplets associated with the element. For each element, context contains role, operation, accessModifier. Additionally it creates booleans hasRole, hasOperation and hasAccessModifier and hasAtLeastOneAccessElement and hasAllAccessElements

Kind: inner method of [Templating API: Access helpers](#module_Templating API_ Access helpers)

Param Type
options *

Templating API: Access helpers~default_access(options) ⇒

Get the access list information.

Kind: inner method of [Templating API: Access helpers](#module_Templating API_ Access helpers)
Returns: access list

Param Type
options *

Templating API: Attribute helpers

This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}

  • [Templating API: Attribute helpers](#module_Templating API_ Attribute helpers)
    • [~featureBits(options)](#module_Templating API_ Attribute helpers..featureBits) ⇒
    • [~attributeDefault()](#module_Templating API_ Attribute helpers..attributeDefault) ⇒

Templating API: Attribute helpers~featureBits(options) ⇒

Get feature bits from the given context.

Kind: inner method of [Templating API: Attribute helpers](#module_Templating API_ Attribute helpers)
Returns: feature bits

Param Type
options *

Templating API: Attribute helpers~attributeDefault() ⇒

Valid within a cluster context, requires code.

Kind: inner method of [Templating API: Attribute helpers](#module_Templating API_ Attribute helpers)
Returns: Produces attribute defaults.

Templating API: C formatting helpers

This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}

  • [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
    • [~asOffset(hex)](#module_Templating API_ C formatting helpers..asOffset)
    • [~asDelimitedMacro(label)](#module_Templating API_ C formatting helpers..asDelimitedMacro)
    • [~asHex(label)](#module_Templating API_ C formatting helpers..asHex) ⇒
    • [~asUnderlyingTypeHelper(dataType, context, packageIds)](#module_Templating API_ C formatting helpers..asUnderlyingTypeHelper) ⇒
    • [~asUnderlyingType(value)](#module_Templating API_ C formatting helpers..asUnderlyingType) ⇒
    • [~asType(label)](#module_Templating API_ C formatting helpers..asType) ⇒
    • [~asSymbol(label)](#module_Templating API_ C formatting helpers..asSymbol) ⇒
    • [~formatValue(value, length)](#module_Templating API_ C formatting helpers..formatValue) ⇒
    • [~asBytes(value)](#module_Templating API_ C formatting helpers..asBytes)
    • [~asCamelCased(str)](#module_Templating API_ C formatting helpers..asCamelCased) ⇒
    • [~cleanseLabel(label)](#module_Templating API_ C formatting helpers..cleanseLabel)
    • [~asUnderscoreLowercase(str)](#module_Templating API_ C formatting helpers..asUnderscoreLowercase) ⇒
    • [~cleanseLabelAsKebabCase(label)](#module_Templating API_ C formatting helpers..cleanseLabelAsKebabCase)
    • [~asSpacedLowercase(str)](#module_Templating API_ C formatting helpers..asSpacedLowercase) ⇒
    • [~asUnderscoreUppercase(str)](#module_Templating API_ C formatting helpers..asUnderscoreUppercase) ⇒
    • [~asCliType(size, isSigned)](#module_Templating API_ C formatting helpers..asCliType) ⇒
    • [~as_zcl_cli_type(str, optional, isSigned)](#module_Templating API_ C formatting helpers..as_zcl_cli_type)
    • [~dataTypeForBitmap(db, bitmap_name, packageIds)](#module_Templating API_ C formatting helpers..dataTypeForBitmap)
    • [~dataTypeForEnum(db, enum_name, packageIds)](#module_Templating API_ C formatting helpers..dataTypeForEnum)
    • [~addOne(number)](#module_Templating API_ C formatting helpers..addOne)
    • [~is_number_greater_than(num1, num2)](#module_Templating API_ C formatting helpers..is_number_greater_than) ⇒
    • [~cluster_extension(options)](#module_Templating API_ C formatting helpers..cluster_extension) ⇒
    • [~device_type_extension(options)](#module_Templating API_ C formatting helpers..device_type_extension) ⇒
    • [~attribute_type_extension(options)](#module_Templating API_ C formatting helpers..attribute_type_extension) ⇒
    • [~subentityExtension(context, prop, entityType)](#module_Templating API_ C formatting helpers..subentityExtension) ⇒
    • [~if_command_extension_true(options)](#module_Templating API_ C formatting helpers..if_command_extension_true) ⇒
    • [~if_command_extension_false(options)](#module_Templating API_ C formatting helpers..if_command_extension_false) ⇒
    • [~if_cluster_extension_true(options)](#module_Templating API_ C formatting helpers..if_cluster_extension_true) ⇒
    • [~if_cluster_extension_false(options)](#module_Templating API_ C formatting helpers..if_cluster_extension_false) ⇒
    • [~attribute_extension(options)](#module_Templating API_ C formatting helpers..attribute_extension) ⇒
    • [~command_extension(options)](#module_Templating API_ C formatting helpers..command_extension) ⇒
    • [~event_extension(options)](#module_Templating API_ C formatting helpers..event_extension) ⇒

Templating API: C formatting helpers~asOffset(hex)

Given a hex number, it prints the offset, which is the index of the first non-zero bit.

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)

Param Type
hex *

Templating API: C formatting helpers~asDelimitedMacro(label)

Takes a label, and delimits is on camelcasing. For example: VerySimpleLabel will turn into VERY_SIMPLE_LABEL

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)

Param Type
label *

Templating API: C formatting helpers~asHex(label) ⇒

Formats label as a C hex constant. If value starts as 0x or 0X it is already treated as hex, otherwise it is assumed decimal and converted to hex.

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: Label formatted as C hex constant.

Param Type
label *

Templating API: C formatting helpers~asUnderlyingTypeHelper(dataType, context, packageIds) ⇒

This function is a helper function for asUnderlyingType and assists in returning the correct C type for the given data type

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: The appropriate C type for the given data type

Param Type
dataType *
context *
packageIds *

Templating API: C formatting helpers~asUnderlyingType(value) ⇒

Converts the actual zcl type into an underlying usable C type.

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: The appropriate C Type

Param Type
value *

Templating API: C formatting helpers~asType(label) ⇒

Formats label as a C type.

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: Label formatted as C type.

Param Type
label *

Templating API: C formatting helpers~asSymbol(label) ⇒

Formats label as a C symbol.

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: Label formatted as C symbol.

Param Type
label *

Templating API: C formatting helpers~formatValue(value, length) ⇒

Formats the default value into an attribute of a given length

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: Formatted value

Param Type
value *
length *

Templating API: C formatting helpers~asBytes(value)

Given a default value of attribute, this method converts it into bytes

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)

Param Type
value *

Templating API: C formatting helpers~asCamelCased(str) ⇒

Given a string convert it into a camelCased string

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: a spaced out string in lowercase

Param Type
str *

Templating API: C formatting helpers~cleanseLabel(label)

returns a string after converting ':' and '-' into '_'

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)

Param Type
label *

Templating API: C formatting helpers~asUnderscoreLowercase(str) ⇒

Given a camel case string, convert it into one with underscore and lowercase

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: String in lowercase with underscores

Param Type
str *

Templating API: C formatting helpers~cleanseLabelAsKebabCase(label)

returns a string after converting ':', ' ' and camel case into '-'

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)

Param Type
label *

Templating API: C formatting helpers~asSpacedLowercase(str) ⇒

Given a camel case string convert it into one with space and lowercase

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: a spaced out string in lowercase

Param Type
str *

Templating API: C formatting helpers~asUnderscoreUppercase(str) ⇒

Given a camel case string convert it into one with underscore and uppercase

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: String in uppercase with underscores

Param Type
str *

Templating API: C formatting helpers~asCliType(size, isSigned) ⇒

Returns the cli type representation.

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: the type representation required for CLI.

Param
size
isSigned

Templating API: C formatting helpers~as_zcl_cli_type(str, optional, isSigned)

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)

Param Description
str
optional
isSigned Return the data type of zcl cli

Templating API: C formatting helpers~dataTypeForBitmap(db, bitmap_name, packageIds)

Returns the type of bitmap based on the bitmap's name

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)

Param Type
db *
bitmap_name *
packageIds *

Templating API: C formatting helpers~dataTypeForEnum(db, enum_name, packageIds)

Returns the type of enum

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)

Param Type
db *
enum_name *
packageIds *

Templating API: C formatting helpers~addOne(number)

Returns the number by adding 1 to it.

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)

Param Type
number *

Templating API: C formatting helpers~is_number_greater_than(num1, num2) ⇒

Return true if number1 is greater than number2

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: true if num1 is greater than num2 else returns false

Param
num1
num2

Templating API: C formatting helpers~cluster_extension(options) ⇒

When inside a context that contains 'code', this helper will output the value of the cluster extension specified by property="propName" attribute.

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: Value of the cluster extension property.

Param Type
options *

Templating API: C formatting helpers~device_type_extension(options) ⇒

When inside a context that contains 'code', this helper will output the value of the cluster extension specified by property="propName" attribute.

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: Value of the cluster extension property.

Param Type
options *

Templating API: C formatting helpers~attribute_type_extension(options) ⇒

When inside a context that contains 'type', this helper will output the value of the attribute type extension specified by property="propName" attribute.

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: Value of the attribute type extension property.

Param Type
options *

Templating API: C formatting helpers~subentityExtension(context, prop, entityType) ⇒

Get extension values for the given information.

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: extension default value

Param Type
context *
prop *
entityType *

Templating API: C formatting helpers~if_command_extension_true(options) ⇒

If helper for command extensions(true condition).

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: content like an if handlebar helper

Param Type
options *

Templating API: C formatting helpers~if_command_extension_false(options) ⇒

If helper for command extensions(false condition).

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: content like an if handlebar helper

Param Type
options *

Templating API: C formatting helpers~if_cluster_extension_true(options) ⇒

If helper for cluster extensions(true condition).

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: content like an if handlebar helper

Param Type
options *

Templating API: C formatting helpers~if_cluster_extension_false(options) ⇒

If helper for cluster extensions(false condition).

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: content like an if handlebar helper

Param Type
options *

Templating API: C formatting helpers~attribute_extension(options) ⇒

When inside a context that contains 'code' and parent 'code', this helper will output the value of the attribute extension specified by property="propName" attribute.

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: Value of the attribute extension property.

Param Type
options *

Templating API: C formatting helpers~command_extension(options) ⇒

When inside a context that contains 'code' and parent 'code', this helper will output the value of the command extension specified by property="propName" attribute.

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: Value of the command extension property.

Param Type
options *

Templating API: C formatting helpers~event_extension(options) ⇒

When inside a context that contains 'code' and parent 'code', this helper will output the value of the command extension specified by property="propName" attribute.

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: Value of the command extension property.

Param Type
options *

Templating API: Command helpers

This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}

  • [Templating API: Command helpers](#module_Templating API_ Command helpers)
    • [~if_command_arguments_exist(commandId, argument_return, no_argument_return)](#module_Templating API_ Command helpers..if_command_arguments_exist)
    • [~if_command_args_exist(commandId, options)](#module_Templating API_ Command helpers..if_command_args_exist) ⇒
    • [~if_ca_always_present_with_presentif(commandArg, trueReturn, falseReturn)](#module_Templating API_ Command helpers..if_ca_always_present_with_presentif) ⇒
    • [~if_command_arg_always_present_with_presentif(commandArg, options)](#module_Templating API_ Command helpers..if_command_arg_always_present_with_presentif) ⇒
    • [~if_command_is_not_fixed_length_but_command_argument_is_always_present(command, commandArg, trueReturn, falseReturn)](#module_Templating API_ Command helpers..if_command_is_not_fixed_length_but_command_argument_is_always_present) ⇒
    • [~if_command_not_fixed_length_command_argument_always_present(command, commandArg, options)](#module_Templating API_ Command helpers..if_command_not_fixed_length_command_argument_always_present) ⇒
    • [~if_ca_not_always_present_no_presentif(commandArg, trueReturn, falseReturn)](#module_Templating API_ Command helpers..if_ca_not_always_present_no_presentif) ⇒
    • [~if_command_arg_not_always_present_no_presentif(commandArg, options)](#module_Templating API_ Command helpers..if_command_arg_not_always_present_no_presentif) ⇒
    • [~if_ca_not_always_present_with_presentif(commandArg, trueReturn, falseReturn)](#module_Templating API_ Command helpers..if_ca_not_always_present_with_presentif) ⇒
    • [~if_command_arg_not_always_present_with_presentif(commandArg, options)](#module_Templating API_ Command helpers..if_command_arg_not_always_present_with_presentif) ⇒
    • [~if_command_is_fixed_length(commandId, fixedLengthReturn, notFixedLengthReturn)](#module_Templating API_ Command helpers..if_command_is_fixed_length)
    • [~if_command_fixed_length(commandId, options)](#module_Templating API_ Command helpers..if_command_fixed_length)

Templating API: Command helpers~if_command_arguments_exist(commandId, argument_return, no_argument_return)

Kind: inner method of [Templating API: Command helpers](#module_Templating API_ Command helpers)

Param Type Description
commandId *
argument_return *
no_argument_return * If the command arguments for a command exist then returns argument_return else returns no_argument_return Example: {{if_command_arguments_exist [command-id] "," ""}} The above will return ',' if the command arguments for a command exist and will return nothing if the command arguments for a command do not exist.

Templating API: Command helpers~if_command_args_exist(commandId, options) ⇒

If helper which checks if command arguments exist for a command or not example: {{#if_command_args_exist commandId}} command arguments exist for the command {{else}} command arguments do not exist for the command {{/if_command_args_exist}}

Kind: inner method of [Templating API: Command helpers](#module_Templating API_ Command helpers)
Returns: Returns content in the handlebar template based on whether the command arguments are present or not.

Param
commandId
options

Templating API: Command helpers~if_ca_always_present_with_presentif(commandArg, trueReturn, falseReturn) ⇒

Kind: inner method of [Templating API: Command helpers](#module_Templating API_ Command helpers)
Returns: trueReturn if command argument is always present and there is a presentIf condition else returns false

Param
commandArg
trueReturn
falseReturn

Templating API: Command helpers~if_command_arg_always_present_with_presentif(commandArg, options) ⇒

If helper that checks if a command argument is always present with a presentIf condition. example: {{#if_command_arg_always_present_with_presentif commandArg}} command argument has a presentIf condition {{else}} command argument does not have a presentIf condition {{/if_command_arg_always_present_with_presentif}}

Kind: inner method of [Templating API: Command helpers](#module_Templating API_ Command helpers)
Returns: Returns content in the handlebar template based on the command argument having a presentIf condition or not

Param
commandArg
options

Templating API: Command helpers~if_command_is_not_fixed_length_but_command_argument_is_always_present(command, commandArg, trueReturn, falseReturn) ⇒

Kind: inner method of [Templating API: Command helpers](#module_Templating API_ Command helpers)
Returns: trueReturn if command is not fixed length but command argument is always present else returns falseReturn

Param
command
commandArg
trueReturn
falseReturn

Templating API: Command helpers~if_command_not_fixed_length_command_argument_always_present(command, commandArg, options) ⇒

If helper that checks if command is not fixed lenth and that the command is always present. example: {{#if_command_not_fixed_length_command_argument_always_present commandId}} command is not fixed length and command argument is always present {{else}} either command is fixed length or command argument is not always present {{/if_command_not_fixed_length_command_argument_always_present}}

Kind: inner method of [Templating API: Command helpers](#module_Templating API_ Command helpers)
Returns: Returns content in the handlebar template based on the command being fixed length or not and whether the command argument is always present

Param
command
commandArg
options

Templating API: Command helpers~if_ca_not_always_present_no_presentif(commandArg, trueReturn, falseReturn) ⇒

Kind: inner method of [Templating API: Command helpers](#module_Templating API_ Command helpers)
Returns: trueReturn if command argument is not always present and there is no presentIf condition else returns false

Param
commandArg
trueReturn
falseReturn

Templating API: Command helpers~if_command_arg_not_always_present_no_presentif(commandArg, options) ⇒

If helper that checks if a command argument is not always present because it has a introduced in or removed in clause. The helper also checks that there is no presentIf condition. example: {{#if_command_arg_not_always_present_no_presentif commandArg}} command argument is not always present and there is no presentIf condition {{else}} Either command argument is always present or there is a presentIf condition {{/if_command_arg_not_always_present_no_presentif}}

Kind: inner method of [Templating API: Command helpers](#module_Templating API_ Command helpers)
Returns: Returns content in the handlebar template based on the command argument being present and if there is a presentIf condition.

Param
commandArg
options

Templating API: Command helpers~if_ca_not_always_present_with_presentif(commandArg, trueReturn, falseReturn) ⇒

Kind: inner method of [Templating API: Command helpers](#module_Templating API_ Command helpers)
Returns: trueReturn if command argument is not always present and there is a presentIf condition else returns false

Param
commandArg
trueReturn
falseReturn

Templating API: Command helpers~if_command_arg_not_always_present_with_presentif(commandArg, options) ⇒

If helper that checks if a command argument is not always present because it has a introduced in or removed in clause. The helper also checks that there is a presentIf condition. example: {{#if_command_arg_not_always_present_with_presentif commandArg}} command argument is not always present and there is a presentIf condition {{else}} Either command argument is always present or there is no presentIf condition {{/if_command_arg_not_always_present_with_presentif}}

Kind: inner method of [Templating API: Command helpers](#module_Templating API_ Command helpers)
Returns: Returns content in the handlebar template based on the command argument being present and if there is a presentIf condition.

Param
commandArg
options

Templating API: Command helpers~if_command_is_fixed_length(commandId, fixedLengthReturn, notFixedLengthReturn)

Kind: inner method of [Templating API: Command helpers](#module_Templating API_ Command helpers)

Param Description
commandId
fixedLengthReturn
notFixedLengthReturn Returns fixedLengthReturn or notFixedLengthReturn based on whether the command is fixed length or not. Also checks if the command arguments are always present or not.

Templating API: Command helpers~if_command_fixed_length(commandId, options)

If helper which checks if a command is fixed length or not

example: {{#if_command_fixed_length commandId}} command is fixed length {{else}} command is not fixed length {{/if_command_fixed_length}}

Kind: inner method of [Templating API: Command helpers](#module_Templating API_ Command helpers)

Param Description
commandId
options Returns content in the handlebar template based on the command being fixed length or not as shown in the example above.

Templating API: Matter endpoint config helpers

This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}

  • [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
    • [~endpoint_type_count(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_type_count) ⇒
    • [~endpoint_count(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_count) ⇒
    • [~endpoint_config_macros()](#module_Templating API_ Matter endpoint config helpers..endpoint_config_macros) ⇒
    • [~endpoint_fixed_endpoint_array(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_fixed_endpoint_array) ⇒
    • [~endpoint_fixed_profile_id_array(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_fixed_profile_id_array) ⇒
    • [~endpoint_fixed_parent_id_array()](#module_Templating API_ Matter endpoint config helpers..endpoint_fixed_parent_id_array) ⇒
    • [~endpoint_fixed_network_array(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_fixed_network_array) ⇒
    • [~endpoint_fixed_endpoint_type_array(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_fixed_endpoint_type_array) ⇒
    • [~createMfgCodes(codeIndexPairs)](#module_Templating API_ Matter endpoint config helpers..createMfgCodes) ⇒
    • [~endpoint_attribute_manufacturer_codes(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_attribute_manufacturer_codes) ⇒
    • [~endpoint_attribute_manufacturer_code_count(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_attribute_manufacturer_code_count) ⇒
    • [~endpoint_command_manufacturer_codes(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_command_manufacturer_codes) ⇒
    • [~endpoint_command_manufacturer_code_count(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_command_manufacturer_code_count) ⇒
    • [~endpoint_cluster_manufacturer_codes(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_cluster_manufacturer_codes) ⇒
    • [~endpoint_cluster_manufacturer_code_count(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_cluster_manufacturer_code_count) ⇒
    • [~endpoint_largest_attribute_size(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_largest_attribute_size) ⇒
    • [~endpoint_singletons_size(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_singletons_size) ⇒
    • [~endpoint_total_storage_size(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_total_storage_size) ⇒
    • [~endpoint_command_count(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_command_count) ⇒
    • [~endpoint_types_list(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_types_list) ⇒
    • [~endpoint_cluster_count(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_cluster_count) ⇒
    • [~endpoint_cluster_list(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_cluster_list) ⇒
    • [~endpoint_command_list(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_command_list) ⇒
    • [~endpoint_attribute_count(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_attribute_count) ⇒
    • [~endpoint_attribute_list(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_attribute_list) ⇒
    • [~device_list(context, options)](#module_Templating API_ Matter endpoint config helpers..device_list) ⇒
    • [~endpoint_fixed_device_type_array(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_fixed_device_type_array) ⇒
    • [~endpoint_fixed_device_type_array_offsets(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_fixed_device_type_array_offsets) ⇒
    • [~endpoint_fixed_device_type_array_lengths(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_fixed_device_type_array_lengths) ⇒
    • [~endpoint_attribute_min_max_count(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_attribute_min_max_count) ⇒
    • [~endpoint_attribute_min_max_list(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_attribute_min_max_list) ⇒
    • [~endpoint_reporting_config_defaults(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_reporting_config_defaults)
    • [~endpoint_reporting_config_default_count(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_reporting_config_default_count) ⇒
    • [~endpoint_attribute_long_defaults_count(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_attribute_long_defaults_count) ⇒
    • [~endpoint_attribute_long_defaults(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_attribute_long_defaults) ⇒
    • [~asMEI(manufacturerCode, code)](#module_Templating API_ Matter endpoint config helpers..asMEI) ⇒
    • [~determineAttributeDefaultValue(specifiedDefault, type, typeSize, isNullable, db, sessionId)](#module_Templating API_ Matter endpoint config helpers..determineAttributeDefaultValue) ⇒
    • [~collectAttributes()](#module_Templating API_ Matter endpoint config helpers..collectAttributes)
    • [~collectAttributeSizes(db, zclPackageIds, endpointTypes)](#module_Templating API_ Matter endpoint config helpers..collectAttributeSizes) ⇒
    • [~collectAttributeTypeInfo(db, zclPackageIds, endpointTypes)](#module_Templating API_ Matter endpoint config helpers..collectAttributeTypeInfo) ⇒
    • [~isGlobalAttrExcludedFromMetadata(attr)](#module_Templating API_ Matter endpoint config helpers..isGlobalAttrExcludedFromMetadata) ⇒
    • [~endpoint_config(options)](#module_Templating API_ Matter endpoint config helpers..endpoint_config) ⇒

Templating API: Matter endpoint config helpers~endpoint_type_count(options) ⇒

Returns number of endpoint types.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: number of endpoint types

Param Type
options *

Templating API: Matter endpoint config helpers~endpoint_count(options) ⇒

Returns number of endpoints.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: number of endpoints

Param Type
options *

Templating API: Matter endpoint config helpers~endpoint_config_macros() ⇒

Prints out all the macros that the endpoint config configuration depends on. These macros are created by ZAP, because the use of these macros is also created by ZAP.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: Macros that need to be created

Templating API: Matter endpoint config helpers~endpoint_fixed_endpoint_array(options) ⇒

Creates array of endpointId fields on endpoints

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: C array including the brackets

Param Type
options *

Templating API: Matter endpoint config helpers~endpoint_fixed_profile_id_array(options) ⇒

Creates array of profileId fields on endpoints

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: C array including the brackets

Param Type
options *

Templating API: Matter endpoint config helpers~endpoint_fixed_parent_id_array() ⇒

Creates Integer Array of parent endpoint identifier fields on endpoints. If the Parent Endpoint is not set then it will default to 0.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: C array including the brackets

Templating API: Matter endpoint config helpers~endpoint_fixed_network_array(options) ⇒

Creates array of networkId fields on endpoints

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: C array including the brackets

Param Type
options *

Templating API: Matter endpoint config helpers~endpoint_fixed_endpoint_type_array(options) ⇒

Each element of an array contains an index into the endpoint type array, for the appropriate endpoint.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: C array of indexes, one for each endpoint.

Param Type
options *

Templating API: Matter endpoint config helpers~createMfgCodes(codeIndexPairs) ⇒

Get indexes and manufacturer code.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: String

Param Type
codeIndexPairs *

Templating API: Matter endpoint config helpers~endpoint_attribute_manufacturer_codes(options) ⇒

Generates array of { index , mfgCode } pairs, matching the indexes in attribute table.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: manufacturer code array

Param Type
options *

Templating API: Matter endpoint config helpers~endpoint_attribute_manufacturer_code_count(options) ⇒

Get count of attributes with manufacturer code.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: Count of attributes with manufacturer code

Param Type
options *

Templating API: Matter endpoint config helpers~endpoint_command_manufacturer_codes(options) ⇒

Get all command manufacturer codes.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: all command manufacturer codes

Param Type
options *

Templating API: Matter endpoint config helpers~endpoint_command_manufacturer_code_count(options) ⇒

Get count of commands with manufacturer code.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: Count of commands with manufacturer code

Param Type
options *

Templating API: Matter endpoint config helpers~endpoint_cluster_manufacturer_codes(options) ⇒

Get all cluster manufacturer codes.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: all cluster manufacturer codes

Param Type
options *

Templating API: Matter endpoint config helpers~endpoint_cluster_manufacturer_code_count(options) ⇒

Get count of clusters with manufacturer code.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: Count of clusters with manufacturer code

Param Type
options *

Templating API: Matter endpoint config helpers~endpoint_largest_attribute_size(options) ⇒

Get size of largest attribute.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: size of largest attribute

Param Type
options *

Templating API: Matter endpoint config helpers~endpoint_singletons_size(options) ⇒

Get cumulative size of all singleton endpoint type attributes.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: cumulative size of all singleton endpoint type attributes

Param Type
options *

Templating API: Matter endpoint config helpers~endpoint_total_storage_size(options) ⇒

Get cumulative size of all endpoint type attributes.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: cumulative size of all endpoint type attributes

Param Type
options *

Templating API: Matter endpoint config helpers~endpoint_command_count(options) ⇒

Get count of endpoint type commands.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: Count of endpoint type commands

Param Type
options *

Templating API: Matter endpoint config helpers~endpoint_types_list(options) ⇒

Get endpoint type information.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: endpoint type information

Param Type
options *

Templating API: Matter endpoint config helpers~endpoint_cluster_count(options) ⇒

Get count of endpoint type clusters.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: Count of endpoint type clusters

Param Type
options *

Templating API: Matter endpoint config helpers~endpoint_cluster_list(options) ⇒

Get endpoint type cluster information.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: endpoint type cluster information

Param Type
options *

Templating API: Matter endpoint config helpers~endpoint_command_list(options) ⇒

Get endpoint type command information.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: endpoint type command information

Param Type
options *

Templating API: Matter endpoint config helpers~endpoint_attribute_count(options) ⇒

Get count of endpoint type attributes.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: Count of endpoint type attributes

Param Type
options *

Templating API: Matter endpoint config helpers~endpoint_attribute_list(options) ⇒

Get endpoint type attribute information.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: endpoint type attribute information

Param Type
options *

Templating API: Matter endpoint config helpers~device_list(context, options) ⇒

Extracting device versions and identifiers from endpoint types

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: list of device types

Param Type
context *
options *

Templating API: Matter endpoint config helpers~endpoint_fixed_device_type_array(options) ⇒

Get all device types in the configuration.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: device types

Param Type
options *

Templating API: Matter endpoint config helpers~endpoint_fixed_device_type_array_offsets(options) ⇒

Get device type offset per endpoint.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: Device type offset per endpoint

Param Type
options *

Templating API: Matter endpoint config helpers~endpoint_fixed_device_type_array_lengths(options) ⇒

Get count of device types per endpoint.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: Count of device types per endpoint

Param Type
options *

Templating API: Matter endpoint config helpers~endpoint_attribute_min_max_count(options) ⇒

Get count of total attributes with min max values listed.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: count of total attributes with min max values listed

Param Type
options *

Templating API: Matter endpoint config helpers~endpoint_attribute_min_max_list(options) ⇒

Get all attributes with min max values defined.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: All attributes with min max values listed

Param Type
options *

Templating API: Matter endpoint config helpers~endpoint_reporting_config_defaults(options)

This helper supports an "order" CSV string, such as: "direction,endpoint,clusterId,attributeId,mask,mfgCode,minmax" The string above is a default value, and it determines in what order are the fields generated.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)

Param Type
options *

Templating API: Matter endpoint config helpers~endpoint_reporting_config_default_count(options) ⇒

Get count of total attributes with reporting enabled

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: Count of total attributes with reporting enabled

Param Type
options *

Templating API: Matter endpoint config helpers~endpoint_attribute_long_defaults_count(options) ⇒

Get long(size>2 bytes) attribute count.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: count of long attributes

Param Type
options *

Templating API: Matter endpoint config helpers~endpoint_attribute_long_defaults(options) ⇒

Get long(size>2 bytes) attribute default values based on endianness.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: Long attribute's default values

Param Type
options *

Templating API: Matter endpoint config helpers~asMEI(manufacturerCode, code) ⇒

Get 32 bit code from the given code and manufacturer code.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: 32 bit Hex Code.

Param Type
manufacturerCode *
code *

Templating API: Matter endpoint config helpers~determineAttributeDefaultValue(specifiedDefault, type, typeSize, isNullable, db, sessionId) ⇒

The representation of null depends on the type, so we can't use a single macro that's defined elsewhere for "null value". Get the default value of an attribute.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: Attribute's default value

Param Type
specifiedDefault *
type *
typeSize *
isNullable *
db *
sessionId *

Templating API: Matter endpoint config helpers~collectAttributes()

Attribute collection works like this: 1.) Go over all the clusters that exist. 2.) If client is included on at least one endpoint add client atts. 3.) If server is included on at least one endpoint add server atts.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)

Templating API: Matter endpoint config helpers~collectAttributeSizes(db, zclPackageIds, endpointTypes) ⇒

This function goes over all the attributes and populates sizes.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: promise that resolves with the passed endpointTypes, after populating the attribute type sizes.

Param Type
db *
zclPackageIds *
endpointTypes *

Templating API: Matter endpoint config helpers~collectAttributeTypeInfo(db, zclPackageIds, endpointTypes) ⇒

This function goes over all attributes and populates atomic types.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: promise that resolves with the passed endpointTypes, after populating the attribute atomic types.

Param Type
db *
zclPackageIds *
endpointTypes *

Templating API: Matter endpoint config helpers~isGlobalAttrExcludedFromMetadata(attr) ⇒

Checks if global attribute is excluded from the meta data.

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: boolean

Param Type
attr *

Templating API: Matter endpoint config helpers~endpoint_config(options) ⇒

Starts the endpoint configuration block., longDefaults: longDefaults

Kind: inner method of [Templating API: Matter endpoint config helpers](#module_Templating API_ Matter endpoint config helpers)
Returns: a promise of a rendered block

Param Type
options *

Templating API: Future helpers

This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}

  • [Templating API: Future helpers](#module_Templating API_ Future helpers)
    • [~ifFuture(options)](#module_Templating API_ Future helpers..ifFuture)
    • [~setFuture(options)](#module_Templating API_ Future helpers..setFuture)
    • [~future(options)](#module_Templating API_ Future helpers..future)

Templating API: Future helpers~ifFuture(options)

Block helper resolving the block if the value of the specified future matches.

Kind: inner method of [Templating API: Future helpers](#module_Templating API_ Future helpers)

Param Type
options *

Templating API: Future helpers~setFuture(options)

This method sets the value of the future. Use it as: {{set_future name="NAME" value="VALUE"}}

Kind: inner method of [Templating API: Future helpers](#module_Templating API_ Future helpers)

Param Type
options *

Templating API: Future helpers~future(options)

This method defines the future with a given name. Use it as: {{future name="NAME"}}

Kind: inner method of [Templating API: Future helpers](#module_Templating API_ Future helpers)

Param Type
options *

Templating API: SDK extension helpers

This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}

Templating API: C formatting helpers

This module contains the API for accessing SDK extensions.

  • [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
    • [~asOffset(hex)](#module_Templating API_ C formatting helpers..asOffset)
    • [~asDelimitedMacro(label)](#module_Templating API_ C formatting helpers..asDelimitedMacro)
    • [~asHex(label)](#module_Templating API_ C formatting helpers..asHex) ⇒
    • [~asUnderlyingTypeHelper(dataType, context, packageIds)](#module_Templating API_ C formatting helpers..asUnderlyingTypeHelper) ⇒
    • [~asUnderlyingType(value)](#module_Templating API_ C formatting helpers..asUnderlyingType) ⇒
    • [~asType(label)](#module_Templating API_ C formatting helpers..asType) ⇒
    • [~asSymbol(label)](#module_Templating API_ C formatting helpers..asSymbol) ⇒
    • [~formatValue(value, length)](#module_Templating API_ C formatting helpers..formatValue) ⇒
    • [~asBytes(value)](#module_Templating API_ C formatting helpers..asBytes)
    • [~asCamelCased(str)](#module_Templating API_ C formatting helpers..asCamelCased) ⇒
    • [~cleanseLabel(label)](#module_Templating API_ C formatting helpers..cleanseLabel)
    • [~asUnderscoreLowercase(str)](#module_Templating API_ C formatting helpers..asUnderscoreLowercase) ⇒
    • [~cleanseLabelAsKebabCase(label)](#module_Templating API_ C formatting helpers..cleanseLabelAsKebabCase)
    • [~asSpacedLowercase(str)](#module_Templating API_ C formatting helpers..asSpacedLowercase) ⇒
    • [~asUnderscoreUppercase(str)](#module_Templating API_ C formatting helpers..asUnderscoreUppercase) ⇒
    • [~asCliType(size, isSigned)](#module_Templating API_ C formatting helpers..asCliType) ⇒
    • [~as_zcl_cli_type(str, optional, isSigned)](#module_Templating API_ C formatting helpers..as_zcl_cli_type)
    • [~dataTypeForBitmap(db, bitmap_name, packageIds)](#module_Templating API_ C formatting helpers..dataTypeForBitmap)
    • [~dataTypeForEnum(db, enum_name, packageIds)](#module_Templating API_ C formatting helpers..dataTypeForEnum)
    • [~addOne(number)](#module_Templating API_ C formatting helpers..addOne)
    • [~is_number_greater_than(num1, num2)](#module_Templating API_ C formatting helpers..is_number_greater_than) ⇒
    • [~cluster_extension(options)](#module_Templating API_ C formatting helpers..cluster_extension) ⇒
    • [~device_type_extension(options)](#module_Templating API_ C formatting helpers..device_type_extension) ⇒
    • [~attribute_type_extension(options)](#module_Templating API_ C formatting helpers..attribute_type_extension) ⇒
    • [~subentityExtension(context, prop, entityType)](#module_Templating API_ C formatting helpers..subentityExtension) ⇒
    • [~if_command_extension_true(options)](#module_Templating API_ C formatting helpers..if_command_extension_true) ⇒
    • [~if_command_extension_false(options)](#module_Templating API_ C formatting helpers..if_command_extension_false) ⇒
    • [~if_cluster_extension_true(options)](#module_Templating API_ C formatting helpers..if_cluster_extension_true) ⇒
    • [~if_cluster_extension_false(options)](#module_Templating API_ C formatting helpers..if_cluster_extension_false) ⇒
    • [~attribute_extension(options)](#module_Templating API_ C formatting helpers..attribute_extension) ⇒
    • [~command_extension(options)](#module_Templating API_ C formatting helpers..command_extension) ⇒
    • [~event_extension(options)](#module_Templating API_ C formatting helpers..event_extension) ⇒

Templating API: C formatting helpers~asOffset(hex)

Given a hex number, it prints the offset, which is the index of the first non-zero bit.

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)

Param Type
hex *

Templating API: C formatting helpers~asDelimitedMacro(label)

Takes a label, and delimits is on camelcasing. For example: VerySimpleLabel will turn into VERY_SIMPLE_LABEL

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)

Param Type
label *

Templating API: C formatting helpers~asHex(label) ⇒

Formats label as a C hex constant. If value starts as 0x or 0X it is already treated as hex, otherwise it is assumed decimal and converted to hex.

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: Label formatted as C hex constant.

Param Type
label *

Templating API: C formatting helpers~asUnderlyingTypeHelper(dataType, context, packageIds) ⇒

This function is a helper function for asUnderlyingType and assists in returning the correct C type for the given data type

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: The appropriate C type for the given data type

Param Type
dataType *
context *
packageIds *

Templating API: C formatting helpers~asUnderlyingType(value) ⇒

Converts the actual zcl type into an underlying usable C type.

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: The appropriate C Type

Param Type
value *

Templating API: C formatting helpers~asType(label) ⇒

Formats label as a C type.

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: Label formatted as C type.

Param Type
label *

Templating API: C formatting helpers~asSymbol(label) ⇒

Formats label as a C symbol.

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: Label formatted as C symbol.

Param Type
label *

Templating API: C formatting helpers~formatValue(value, length) ⇒

Formats the default value into an attribute of a given length

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: Formatted value

Param Type
value *
length *

Templating API: C formatting helpers~asBytes(value)

Given a default value of attribute, this method converts it into bytes

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)

Param Type
value *

Templating API: C formatting helpers~asCamelCased(str) ⇒

Given a string convert it into a camelCased string

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: a spaced out string in lowercase

Param Type
str *

Templating API: C formatting helpers~cleanseLabel(label)

returns a string after converting ':' and '-' into '_'

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)

Param Type
label *

Templating API: C formatting helpers~asUnderscoreLowercase(str) ⇒

Given a camel case string, convert it into one with underscore and lowercase

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: String in lowercase with underscores

Param Type
str *

Templating API: C formatting helpers~cleanseLabelAsKebabCase(label)

returns a string after converting ':', ' ' and camel case into '-'

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)

Param Type
label *

Templating API: C formatting helpers~asSpacedLowercase(str) ⇒

Given a camel case string convert it into one with space and lowercase

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: a spaced out string in lowercase

Param Type
str *

Templating API: C formatting helpers~asUnderscoreUppercase(str) ⇒

Given a camel case string convert it into one with underscore and uppercase

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: String in uppercase with underscores

Param Type
str *

Templating API: C formatting helpers~asCliType(size, isSigned) ⇒

Returns the cli type representation.

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: the type representation required for CLI.

Param
size
isSigned

Templating API: C formatting helpers~as_zcl_cli_type(str, optional, isSigned)

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)

Param Description
str
optional
isSigned Return the data type of zcl cli

Templating API: C formatting helpers~dataTypeForBitmap(db, bitmap_name, packageIds)

Returns the type of bitmap based on the bitmap's name

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)

Param Type
db *
bitmap_name *
packageIds *

Templating API: C formatting helpers~dataTypeForEnum(db, enum_name, packageIds)

Returns the type of enum

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)

Param Type
db *
enum_name *
packageIds *

Templating API: C formatting helpers~addOne(number)

Returns the number by adding 1 to it.

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)

Param Type
number *

Templating API: C formatting helpers~is_number_greater_than(num1, num2) ⇒

Return true if number1 is greater than number2

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: true if num1 is greater than num2 else returns false

Param
num1
num2

Templating API: C formatting helpers~cluster_extension(options) ⇒

When inside a context that contains 'code', this helper will output the value of the cluster extension specified by property="propName" attribute.

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: Value of the cluster extension property.

Param Type
options *

Templating API: C formatting helpers~device_type_extension(options) ⇒

When inside a context that contains 'code', this helper will output the value of the cluster extension specified by property="propName" attribute.

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: Value of the cluster extension property.

Param Type
options *

Templating API: C formatting helpers~attribute_type_extension(options) ⇒

When inside a context that contains 'type', this helper will output the value of the attribute type extension specified by property="propName" attribute.

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: Value of the attribute type extension property.

Param Type
options *

Templating API: C formatting helpers~subentityExtension(context, prop, entityType) ⇒

Get extension values for the given information.

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: extension default value

Param Type
context *
prop *
entityType *

Templating API: C formatting helpers~if_command_extension_true(options) ⇒

If helper for command extensions(true condition).

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: content like an if handlebar helper

Param Type
options *

Templating API: C formatting helpers~if_command_extension_false(options) ⇒

If helper for command extensions(false condition).

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: content like an if handlebar helper

Param Type
options *

Templating API: C formatting helpers~if_cluster_extension_true(options) ⇒

If helper for cluster extensions(true condition).

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: content like an if handlebar helper

Param Type
options *

Templating API: C formatting helpers~if_cluster_extension_false(options) ⇒

If helper for cluster extensions(false condition).

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: content like an if handlebar helper

Param Type
options *

Templating API: C formatting helpers~attribute_extension(options) ⇒

When inside a context that contains 'code' and parent 'code', this helper will output the value of the attribute extension specified by property="propName" attribute.

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: Value of the attribute extension property.

Param Type
options *

Templating API: C formatting helpers~command_extension(options) ⇒

When inside a context that contains 'code' and parent 'code', this helper will output the value of the command extension specified by property="propName" attribute.

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: Value of the command extension property.

Param Type
options *

Templating API: C formatting helpers~event_extension(options) ⇒

When inside a context that contains 'code' and parent 'code', this helper will output the value of the command extension specified by property="propName" attribute.

Kind: inner method of [Templating API: C formatting helpers](#module_Templating API_ C formatting helpers)
Returns: Value of the command extension property.

Param Type
options *

Templating API: user-data specific helpers

This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}

  • [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
    • [~user_endpoints(options)](#module_Templating API_ user-data specific helpers..user_endpoints)
    • [~user_device_types(options)](#module_Templating API_ user-data specific helpers..user_device_types)
    • [~user_endpoint_types(options)](#module_Templating API_ user-data specific helpers..user_endpoint_types)
    • [~user_clusters(options)](#module_Templating API_ user-data specific helpers..user_clusters)
    • [~user_cluster_attributes(options)](#module_Templating API_ user-data specific helpers..user_cluster_attributes) ⇒
    • [~user_cluster_commands(options)](#module_Templating API_ user-data specific helpers..user_cluster_commands) ⇒
    • [~user_cluster_events(options)](#module_Templating API_ user-data specific helpers..user_cluster_events) ⇒
    • [~user_endpoint_type_count()](#module_Templating API_ user-data specific helpers..user_endpoint_type_count) ⇒
    • [~user_endpoint_count_by_cluster(clusterTypeId)](#module_Templating API_ user-data specific helpers..user_endpoint_count_by_cluster) ⇒
    • [~user_all_attributes(options)](#module_Templating API_ user-data specific helpers..user_all_attributes) ⇒
    • [~all_user_cluster_commands(options)](#module_Templating API_ user-data specific helpers..all_user_cluster_commands) ⇒
    • [~all_user_cluster_command_util(name, side, options, currentContext, isManufacturingSpecific, isIrrespectiveOfManufacturingSpecification)](#module_Templating API_ user-data specific helpers..all_user_cluster_command_util)
    • [~all_user_cluster_attribute_util(name, side, options, currentContext, isManufacturingSpecific, isIrrespectiveOfManufacturingSpecification)](#module_Templating API_ user-data specific helpers..all_user_cluster_attribute_util) ⇒
    • [~all_user_cluster_manufacturer_specific_commands(options)](#module_Templating API_ user-data specific helpers..all_user_cluster_manufacturer_specific_commands) ⇒
    • [~all_user_cluster_non_manufacturer_specific_commands(options)](#module_Templating API_ user-data specific helpers..all_user_cluster_non_manufacturer_specific_commands) ⇒
    • [~all_user_cluster_manufacturer_specific_attributes(options)](#module_Templating API_ user-data specific helpers..all_user_cluster_manufacturer_specific_attributes) ⇒
    • [~all_user_cluster_non_manufacturer_specific_attributes(options)](#module_Templating API_ user-data specific helpers..all_user_cluster_non_manufacturer_specific_attributes) ⇒
    • [~all_commands_for_user_enabled_clusters(options)](#module_Templating API_ user-data specific helpers..all_commands_for_user_enabled_clusters) ⇒
    • [~all_cli_commands_for_user_enabled_clusters(options)](#module_Templating API_ user-data specific helpers..all_cli_commands_for_user_enabled_clusters) ⇒
    • [~all_user_clusters(options)](#module_Templating API_ user-data specific helpers..all_user_clusters) ⇒
    • [~all_user_clusters_irrespective_of_side(options)](#module_Templating API_ user-data specific helpers..all_user_clusters_irrespective_of_side) ⇒
    • [~all_user_clusters_names(options)](#module_Templating API_ user-data specific helpers..all_user_clusters_names) ⇒
    • [~user_cluster_command_count_with_cli()](#module_Templating API_ user-data specific helpers..user_cluster_command_count_with_cli)
    • [~user_cluster_commands_with_cli()](#module_Templating API_ user-data specific helpers..user_cluster_commands_with_cli)
    • [~user_cluster_commands_all_endpoints(options)](#module_Templating API_ user-data specific helpers..user_cluster_commands_all_endpoints)
    • [~user_cluster_has_enabled_command(name, side)](#module_Templating API_ user-data specific helpers..user_cluster_has_enabled_command) ⇒
    • [~all_user_cluster_commands_irrespective_of_manufaturing_specification(options)](#module_Templating API_ user-data specific helpers..all_user_cluster_commands_irrespective_of_manufaturing_specification) ⇒
    • [~enabled_attributes_for_cluster_and_side(name, side, options)](#module_Templating API_ user-data specific helpers..enabled_attributes_for_cluster_and_side) ⇒
    • [~user_session_key(options)](#module_Templating API_ user-data specific helpers..user_session_key) ⇒
    • [~if_command_discovery_enabled()](#module_Templating API_ user-data specific helpers..if_command_discovery_enabled)
    • [~user_manufacturer_code(options)](#module_Templating API_ user-data specific helpers..user_manufacturer_code) ⇒
    • [~user_default_response_policy(options)](#module_Templating API_ user-data specific helpers..user_default_response_policy) ⇒
    • [~is_command_default_response_enabled(command, options)](#module_Templating API_ user-data specific helpers..is_command_default_response_enabled) ⇒
    • [~is_command_default_response_disabled(command, options)](#module_Templating API_ user-data specific helpers..is_command_default_response_disabled) ⇒
    • [~endpoint_type_identifier(endpointTypeId)](#module_Templating API_ user-data specific helpers..endpoint_type_identifier) ⇒
    • [~endpoint_type_index(endpointTypeId)](#module_Templating API_ user-data specific helpers..endpoint_type_index) ⇒
    • [~all_user_cluster_attributes_for_generated_defaults(name, side, options)](#module_Templating API_ user-data specific helpers..all_user_cluster_attributes_for_generated_defaults) ⇒
    • [~all_user_cluster_generated_attributes(options)](#module_Templating API_ user-data specific helpers..all_user_cluster_generated_attributes) ⇒
    • [~all_user_reportable_attributes(options)](#module_Templating API_ user-data specific helpers..all_user_reportable_attributes) ⇒
    • [~all_user_cluster_generated_commands(options)](#module_Templating API_ user-data specific helpers..all_user_cluster_generated_commands) ⇒
    • [~all_user_clusters_with_incoming_or_outgoing_commands(options, is_incoming)](#module_Templating API_ user-data specific helpers..all_user_clusters_with_incoming_or_outgoing_commands) ⇒
    • [~all_user_clusters_with_incoming_commands(options)](#module_Templating API_ user-data specific helpers..all_user_clusters_with_incoming_commands) ⇒
    • [~all_user_clusters_with_outgoing_commands(options)](#module_Templating API_ user-data specific helpers..all_user_clusters_with_outgoing_commands) ⇒
    • [~manufacturing_clusters_with_incoming_commands(clusterCode, options)](#module_Templating API_ user-data specific helpers..manufacturing_clusters_with_incoming_commands) ⇒
    • [~all_user_clusters_with_incoming_commands_combined(options)](#module_Templating API_ user-data specific helpers..all_user_clusters_with_incoming_commands_combined) ⇒
    • [~all_incoming_commands_for_cluster_combined(clusterName, clientSide, serverSide, options)](#module_Templating API_ user-data specific helpers..all_incoming_commands_for_cluster_combined) ⇒
    • [~all_user_incoming_commands_for_all_clusters(options)](#module_Templating API_ user-data specific helpers..all_user_incoming_commands_for_all_clusters) ⇒
    • [~all_incoming_or_outgoing_commands_for_cluster(clusterName, clusterSide, isIncoming, options)](#module_Templating API_ user-data specific helpers..all_incoming_or_outgoing_commands_for_cluster) ⇒
    • [~all_incoming_commands_for_cluster(clusterName, options)](#module_Templating API_ user-data specific helpers..all_incoming_commands_for_cluster) ⇒
    • [~all_outgoing_commands_for_cluster(clusterName, options)](#module_Templating API_ user-data specific helpers..all_outgoing_commands_for_cluster) ⇒
    • [~generated_clustes_details(options)](#module_Templating API_ user-data specific helpers..generated_clustes_details) ⇒
    • [~generated_endpoint_type_details(options)](#module_Templating API_ user-data specific helpers..generated_endpoint_type_details) ⇒
    • [~all_user_cluster_attributes_min_max_defaults(name, side, options)](#module_Templating API_ user-data specific helpers..all_user_cluster_attributes_min_max_defaults) ⇒
    • [~checkAttributeMatch(clusterName, attributeName, attributeSide, attributeValue, attributeValueType, endpointAttributes)](#module_Templating API_ user-data specific helpers..checkAttributeMatch) ⇒
    • [~generated_defaults_index(clusterName, attributeName, attributeValueType, attributeValue, prefixReturn, postFixReturn)](#module_Templating API_ user-data specific helpers..generated_defaults_index) ⇒
    • [~generated_default_index(clusterName, attributeName, attributeSide, attributeValueType, attributeValue, prefixReturn, postFixReturn)](#module_Templating API_ user-data specific helpers..generated_default_index) ⇒
    • [~generated_attributes_min_max_index(name, side, options)](#module_Templating API_ user-data specific helpers..generated_attributes_min_max_index) ⇒
    • [~generated_attribute_min_max_index(clusterName, attributeName, attributeSide, options)](#module_Templating API_ user-data specific helpers..generated_attribute_min_max_index) ⇒
    • [~if_enabled_clusters(options)](#module_Templating API_ user-data specific helpers..if_enabled_clusters) ⇒
    • [~if_multi_protocol_attributes_enabled(options)](#module_Templating API_ user-data specific helpers..if_multi_protocol_attributes_enabled) ⇒
    • [~all_multi_protocol_attributes(options)](#module_Templating API_ user-data specific helpers..all_multi_protocol_attributes) ⇒

Templating API: user-data specific helpers~user_endpoints(options)

Creates block iterator over the endpoints.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)

Param Type
options *

Templating API: user-data specific helpers~user_device_types(options)

Creates device type iterator over an endpoint type id. This works inside user_endpoints or user_endpoint_types.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)

Param Type
options *

Templating API: user-data specific helpers~user_endpoint_types(options)

Creates block iterator helper over the endpoint types.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)

Param Type
options *

Templating API: user-data specific helpers~user_clusters(options)

Creates cluster iterator over the endpoint types. This works ony inside user_endpoint_types.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)

Param Type
options *

Templating API: user-data specific helpers~user_cluster_attributes(options) ⇒

Creates endpoint type cluster attribute iterator. This works only inside user_clusters.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: Promise of the resolved blocks iterating over cluster attributes.

Param Type
options *

Templating API: user-data specific helpers~user_cluster_commands(options) ⇒

Creates endpoint type cluster command iterator. This works only inside user_clusters.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: Promise of the resolved blocks iterating over cluster commands.

Param Type
options *

Templating API: user-data specific helpers~user_cluster_events(options) ⇒

Creates endpoint type cluster event iterator. This works only inside user_clusters.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: Promise of the resolved blocks iterating over cluster events.

Param Type
options *

Templating API: user-data specific helpers~user_endpoint_type_count() ⇒

Get count of total endpoint types.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: count of total endpoint types

Templating API: user-data specific helpers~user_endpoint_count_by_cluster(clusterTypeId) ⇒

Retrieve the number of endpoints which possess the specified cluster type

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: Promise of the number of endpoint

Param Type
clusterTypeId *

Templating API: user-data specific helpers~user_all_attributes(options) ⇒

Iterates over all attributes required by the user configuration.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: Promise of the resolved blocks iterating over cluster commands.

Param Type
options *

Templating API: user-data specific helpers~all_user_cluster_commands(options) ⇒

Creates endpoint type cluster command iterator. This fetches all commands which have been enabled on added endpoints

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: Promise of the resolved blocks iterating over cluster commands.

Param Type
options *

Templating API: user-data specific helpers~all_user_cluster_command_util(name, side, options, currentContext, isManufacturingSpecific, isIrrespectiveOfManufacturingSpecification)

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)

Param Default Description
name
side
options
currentContext
isManufacturingSpecific
isIrrespectiveOfManufacturingSpecification false Returns: Promise of the resolved blocks iterating over manufacturing specific, non-manufacturing specific or both of the cluster commands.

Templating API: user-data specific helpers~all_user_cluster_attribute_util(name, side, options, currentContext, isManufacturingSpecific, isIrrespectiveOfManufacturingSpecification) ⇒

Get attribute details based on given arguments.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: Attribute details

Param Type Default
name *
side *
options *
currentContext *
isManufacturingSpecific *
isIrrespectiveOfManufacturingSpecification * false

Templating API: user-data specific helpers~all_user_cluster_manufacturer_specific_commands(options) ⇒

Creates endpoint type cluster command iterator. This fetches all manufacturing specific commands which have been enabled on added endpoints

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: Promise of the resolved blocks iterating over manufacturing specific cluster commands.

Param
options

Templating API: user-data specific helpers~all_user_cluster_non_manufacturer_specific_commands(options) ⇒

Creates endpoint type cluster command iterator. This fetches all non-manufacturing specific commands which have been enabled on added endpoints

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: Promise of the resolved blocks iterating over non-manufacturing specific cluster commands.

Param
options

Templating API: user-data specific helpers~all_user_cluster_manufacturer_specific_attributes(options) ⇒

Creates endpoint type cluster command iterator. This fetches all manufacturing specific commands which have been enabled on added endpoints

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: Promise of the resolved blocks iterating over manufacturing specific cluster commands.

Param
options

Templating API: user-data specific helpers~all_user_cluster_non_manufacturer_specific_attributes(options) ⇒

Creates endpoint type cluster command iterator. This fetches all non-manufacturing specific commands which have been enabled on added endpoints

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: Promise of the resolved blocks iterating over non-manufacturing specific cluster commands.

Param
options

Templating API: user-data specific helpers~all_commands_for_user_enabled_clusters(options) ⇒

Creates endpoint type cluster command iterator. This fetches all commands which have been enabled on added endpoints

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: Promise of the resolved blocks iterating over cluster commands.

Param Type
options *

Templating API: user-data specific helpers~all_cli_commands_for_user_enabled_clusters(options) ⇒

This helper returns all commands which have cli within the list of enabled clusters.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: all commands with cli from the list of enabled clusters

Param
options

Templating API: user-data specific helpers~all_user_clusters(options) ⇒

Creates cluster iterator for all endpoints.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: Promise of the resolved blocks iterating over cluster commands.

Param Type
options *

Templating API: user-data specific helpers~all_user_clusters_irrespective_of_side(options) ⇒

Creates cluster command iterator for all endpoints.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: Promise of the resolved blocks iterating over cluster commands.

Param Type
options *

Templating API: user-data specific helpers~all_user_clusters_names(options) ⇒

Creates cluster command iterator for all endpoints whitout any duplicates cause by cluster side

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: Promise of the resolved blocks iterating over cluster commands.

Param Type
options *

Templating API: user-data specific helpers~user_cluster_command_count_with_cli()

Get the count of the number of clusters commands with cli for a cluster. This is used under a cluster block helper

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)

Templating API: user-data specific helpers~user_cluster_commands_with_cli()

This helper works within the the cluster block helpers. It is used to get all commands of the cluster which have cli associated with them.

param options Returns: all commands with cli for a cluster

Example: {{#all_user_clusters_irrespective_of_side}} {{#user_cluster_commands_with_cli}} {{/user_cluster_commands_with_cli}} {{/all_user_clusters_irrespective_of_side}}

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)

Templating API: user-data specific helpers~user_cluster_commands_all_endpoints(options)

Creates endpoint type cluster command iterator. This works only inside cluster block helpers.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)

Param Description
options Returns: Promise of the resolved blocks iterating over cluster commands.

Templating API: user-data specific helpers~user_cluster_has_enabled_command(name, side) ⇒

Check if the cluster (name) has any enabled commands. This works only inside cluster block helpers.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: True if cluster has enabled commands otherwise false

Param Type Description
name * : Cluster name
side * : Cluster side

Templating API: user-data specific helpers~all_user_cluster_commands_irrespective_of_manufaturing_specification(options) ⇒

Creates endpoint type cluster command iterator. This fetches all manufacturing and non-manufaturing specific commands which have been enabled on added endpoints

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: Promise of the resolved blocks iterating over manufacturing specific and non-manufacturing specific cluster commands.

Param
options

Templating API: user-data specific helpers~enabled_attributes_for_cluster_and_side(name, side, options) ⇒

Creates endpoint type cluster attribute iterator. This fetches all manufacturer-specific and standard attributes which have been enabled on added endpoints based on the name and side of the cluster. When side is not mentioned then client and server attributes are returned. Available Options:

  • removeKeys: Removes one or more keys from the map(for eg keys in db-mapping.js) for eg:(#enabled_attributes_for_cluster_and_side [cluster-name], [cluster-side], removeKeys='isOptional, isNullable') will remove 'isOptional' and 'isNullable' from the results

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: Promise of the resolved blocks iterating over manufacturing specific and standard cluster attributes.

Param
name
side
options

Templating API: user-data specific helpers~user_session_key(options) ⇒

Helper that resolves into a user session key value.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: Promise of value of the session key or undefined.

Param Type
options *

Templating API: user-data specific helpers~if_command_discovery_enabled()

If helper that checks if command discovery is enabled

example: {{#if_command_discovery_enabled}} command discovery is enabled {{else}} command discovery is not enabled {{/if_command_discovery_enabled}}

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)

Templating API: user-data specific helpers~user_manufacturer_code(options) ⇒

Get Session's manufacturer code.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: session's manufacturer code

Param Type
options *

Templating API: user-data specific helpers~user_default_response_policy(options) ⇒

Get user's default response policy selected.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: user's default response policy selected

Param Type
options *

Templating API: user-data specific helpers~is_command_default_response_enabled(command, options) ⇒

An if helper to check if default response for a command is enabled or not.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: true if the the default response policy is either always or when the policy is not never and the command has the disable default response policy set to false(not true)

Param Type
command *
options *

Templating API: user-data specific helpers~is_command_default_response_disabled(command, options) ⇒

An if helper to check if default response for a command is disabled or not.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: true if the the default response policy is either never or when the policy is not always and the command has the disable default response policy set to true(for eg disableDefaultResponse="true" in xml).

Param Type
command *
options *

Templating API: user-data specific helpers~endpoint_type_identifier(endpointTypeId) ⇒

Get endpoint identifier from the given endpoint type ID.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: the endpoint type identifier for an endpoint type

Param Type
endpointTypeId *

Templating API: user-data specific helpers~endpoint_type_index(endpointTypeId) ⇒

Get the index of the endpoint whose endpointTypeId is endpointTypeId Will return -1 if the given endpoint type is not present.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: integer

Param Type
endpointTypeId *

Templating API: user-data specific helpers~all_user_cluster_attributes_for_generated_defaults(name, side, options) ⇒

Default values for the attributes longer than a pointer. All attribute values with size greater than 2 bytes. Excluding 0 values and externally saved values

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: Attribute values greater than 2 bytes and not 0 nor externally saved.

Param
name
side
options

Templating API: user-data specific helpers~all_user_cluster_generated_attributes(options) ⇒

Entails the list of all attributes which have been enabled. Given the cluster is enabled as well. The helper retrieves the attributes across all endpoints.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: enabled attributes

Param
options

Templating API: user-data specific helpers~all_user_reportable_attributes(options) ⇒

Entails the list of reportable attributes which have been enabled. Given the cluster is enabled as well. The helper retrieves the reportable attributes per endpoint per cluster.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: Reportable attributes

Param
options

Templating API: user-data specific helpers~all_user_cluster_generated_commands(options) ⇒

All available cluster commands across all endpoints and clusters.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: All available cluster commands across all endpoints and clusters

Param
options

Templating API: user-data specific helpers~all_user_clusters_with_incoming_or_outgoing_commands(options, is_incoming) ⇒

Util function for all clusters with side that have available incoming or outgiong commands across all endpoints.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: All clusters with side that have available incoming or outgiong commands across all endpoints.

Param Description
options
is_incoming boolean to check if commands are incoming or outgoing

Templating API: user-data specific helpers~all_user_clusters_with_incoming_commands(options) ⇒

All clusters with side that have available incoming commands

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: All clusters with side that have available incoming commands across all endpoints.

Param
options

Templating API: user-data specific helpers~all_user_clusters_with_outgoing_commands(options) ⇒

All clusters with side that have available outgoing commands

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: All clusters with side that have available outgoing commands across all endpoints.

Param
options

Templating API: user-data specific helpers~manufacturing_clusters_with_incoming_commands(clusterCode, options) ⇒

Provide all manufacturing specific clusters that have incoming commands with the given cluster code.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: Details of manufacturing specific clusters that have incoming commands with the given cluster code

Param
clusterCode
options

Templating API: user-data specific helpers~all_user_clusters_with_incoming_commands_combined(options) ⇒

All clusters that have available incoming commands. If there is a client and server enabled on the endpoint, this combines them into a single entry.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: All clusters that have available incoming commands across all endpoints.

Param
options

Templating API: user-data specific helpers~all_incoming_commands_for_cluster_combined(clusterName, clientSide, serverSide, options) ⇒

All commands that need to be parsed for a given cluster. This takes in booleans for if the client and or server are included.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: all commands that need to be parsed for a given cluster

Param
clusterName
clientSide
serverSide
options

Templating API: user-data specific helpers~all_user_incoming_commands_for_all_clusters(options) ⇒

Get all incoming commands in the user configuration.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: all incoming commands enabled by the user.

Param Type
options *

Templating API: user-data specific helpers~all_incoming_or_outgoing_commands_for_cluster(clusterName, clusterSide, isIncoming, options) ⇒

A util function for all incoming or outgoing commands that need to be parsed for a given cluster

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: All incoming or outgoing commands that need to be parsed for a given cluster

Param
clusterName
clusterSide
isIncoming
options

Templating API: user-data specific helpers~all_incoming_commands_for_cluster(clusterName, options) ⇒

All incoming commands that need to be parsed for a given cluster

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: all incoming commands that need to be parsed for a given cluster

Param
clusterName
options

Templating API: user-data specific helpers~all_outgoing_commands_for_cluster(clusterName, options) ⇒

All outgoing commands that need to be parsed for a given cluster

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: all outgoing commands that need to be parsed for a given cluster

Param
clusterName
options

Templating API: user-data specific helpers~generated_clustes_details(options) ⇒

Entails the Cluster details per endpoint

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: Cluster Details per endpoint with attribute summaries within the clusters

Param Type
options *

Templating API: user-data specific helpers~generated_endpoint_type_details(options) ⇒

Entails Endpoint type details along with their cluster summaries

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: Endpoint type details along with their cluster summaries

Param
options

Templating API: user-data specific helpers~all_user_cluster_attributes_min_max_defaults(name, side, options) ⇒

Returns attributes inside an endpoint type that either have a default or a bounded attribute.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: endpoints with bounds or defaults

Param
name
side
options

Templating API: user-data specific helpers~checkAttributeMatch(clusterName, attributeName, attributeSide, attributeValue, attributeValueType, endpointAttributes) ⇒

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: arrayIndex

Param
clusterName
attributeName
attributeSide
attributeValue
attributeValueType
endpointAttributes

Templating API: user-data specific helpers~generated_defaults_index(clusterName, attributeName, attributeValueType, attributeValue, prefixReturn, postFixReturn) ⇒

Extracts the index of generated defaults array which come from all_user_cluster_attributes_for_generated_defaults

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: index of the generated default array

Param
clusterName
attributeName
attributeValueType
attributeValue
prefixReturn
postFixReturn

Templating API: user-data specific helpers~generated_default_index(clusterName, attributeName, attributeSide, attributeValueType, attributeValue, prefixReturn, postFixReturn) ⇒

Extracts the index of generated defaults array which come from all_user_cluster_attributes_for_generated_defaults

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: deafult value's index in the generated default array

Param
clusterName
attributeName
attributeSide
attributeValueType
attributeValue
prefixReturn
postFixReturn

Templating API: user-data specific helpers~generated_attributes_min_max_index(name, side, options) ⇒

Extracts the index of generated min max defaults array which come from all_user_cluster_attributes_min_max_defaults

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: index of the generated min max default array

Param
name
side
options

Templating API: user-data specific helpers~generated_attribute_min_max_index(clusterName, attributeName, attributeSide, options) ⇒

Extracts the index of generated min max defaults array which come from all_user_cluster_attributes_min_max_defaults

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: index of the generated min max default in the array

Param
clusterName
attributeName
attributeSide
options

Templating API: user-data specific helpers~if_enabled_clusters(options) ⇒

If helper that checks if there are clusters enabled Available options:

  • side: side="client/server" can be used to check if there are client or server side clusters are available

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: Promise of content.

Param Type
options *

Templating API: user-data specific helpers~if_multi_protocol_attributes_enabled(options) ⇒

Check if multi-protocol is enabled for the application.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: boolean based on existence of attribute-attribute associations.

Param Type
options *

Templating API: user-data specific helpers~all_multi_protocol_attributes(options) ⇒

Retrieve all the attribute-attribute associations for the current session.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: attribute-attribute mapping entries

Param Type
options *

Templating API: Token helpers

This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}

  • [Templating API: Token helpers](#module_Templating API_ Token helpers)
    • [~token_cluster_create(config)](#module_Templating API_ Token helpers..token_cluster_create) ⇒
    • [~tokens_context()](#module_Templating API_ Token helpers..tokens_context)
    • [~token_next()](#module_Templating API_ Token helpers..token_next)
    • [~debug_object(obj)](#module_Templating API_ Token helpers..debug_object) ⇒
    • [~token_attribute_util(context, options)](#module_Templating API_ Token helpers..token_attribute_util) ⇒
    • [~token_attributes(endpointTypeRef, options)](#module_Templating API_ Token helpers..token_attributes) ⇒
    • [~token_attribute_clusters(endpointTypeRef, options)](#module_Templating API_ Token helpers..token_attribute_clusters) ⇒
    • [~token_attribute_endpoints(options)](#module_Templating API_ Token helpers..token_attribute_endpoints) ⇒

Templating API: Token helpers~token_cluster_create(config) ⇒

Get a transformed config object.

Kind: inner method of [Templating API: Token helpers](#module_Templating API_ Token helpers)
Returns: object

Param Type
config *

Templating API: Token helpers~tokens_context()

This function builds creates a new context from the endpoint_config structure for use in the zap-tokens.h template. The endpoint_config context provides a list of endpoints, and endpointTypes, where each endpointType contains a list of clusters, and each cluster contains a list of attributes. However, the tokens template requires a list of attributes per endpoint, and per cluster, discriminating from singletons and non-singletons, so this function performs the required grouping.

While each attribute contains an isSingleton attribute, the database schema allows for the same attribute to be returned both as singleton and non-singleton in different clusters, for different endpoints. In consequence, care must be taken to remove the singletons from the cluster and endpoint attribute lists. This is done in two steps, the first loop creates a global (context) list of singletons and non-singletons, and the second loop removes the singletons from the endpoint, and clusters.

Clusters from different endpoints may have different attributes, therefore each endpoint keeps a separate list of clusters. Additionally, a context-level map of clusters is required in order to gather all attributes (singletons and non-singletons) from all endpoint clusters.

Kind: inner method of [Templating API: Token helpers](#module_Templating API_ Token helpers)

Templating API: Token helpers~token_next()

The token template assigns an unique ID to each unique attribute. These IDs span all attributes from all clusters from all endpointTypes. This helper function allows the template to increment the token ID within the tokens context.

Kind: inner method of [Templating API: Token helpers](#module_Templating API_ Token helpers)

Templating API: Token helpers~debug_object(obj) ⇒

Get JSON stringified value of the obj.

Kind: inner method of [Templating API: Token helpers](#module_Templating API_ Token helpers)
Returns: JSON string

Param Type
obj *

Templating API: Token helpers~token_attribute_util(context, options) ⇒

Util function that extracts all the token attribute information.

Kind: inner method of [Templating API: Token helpers](#module_Templating API_ Token helpers)
Returns: Information on all token attributes in the configuration.

Param Type
context *
options *

Templating API: Token helpers~token_attributes(endpointTypeRef, options) ⇒

Get information about all the token attributes in the configuration or this helper can be used within an endpoint block helper to fetch the corresponding token attributes based on endpoint type given. Available Options: isSingleton: 0/1, option can be used to filter attributes based on singleton or non-singleton(Available with endpointTypeRef only)

Kind: inner method of [Templating API: Token helpers](#module_Templating API_ Token helpers)
Returns: singleton and non-singleton token attributes along with their endpoint information. Singleton attributes are only returned once whereas non-singleton attributes are returned per endpoint. However if used within an endpoint block helper it returns token_attributes for a given endpoint type.

Param Type
endpointTypeRef *
options *

Templating API: Token helpers~token_attribute_clusters(endpointTypeRef, options) ⇒

This helper can return all token associated clusters across endpoints or this helper can be used within an endpoint block helper to fetch the corresponding token associated clusters. Available Options: isSingleton: 0/1, option can be used to filter clusters based on singleton or non-singleton attributes.

Kind: inner method of [Templating API: Token helpers](#module_Templating API_ Token helpers)
Returns: Token associated clusters for a particular endpoint type or all token associated clusters across endpoints.

Param Type
endpointTypeRef *
options *

Templating API: Token helpers~token_attribute_endpoints(options) ⇒

Get all endpoints which have token attributes in the configuration. AvailableOptions:

  • isSingleton: 0/1, option can be used to filter endpoints based on singleton or non-singleton.

Kind: inner method of [Templating API: Token helpers](#module_Templating API_ Token helpers)
Returns: all endpoints with token attributes

Param Type
options *

Templating API: toplevel utility helpers

This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}

  • [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
    • [~zap_header()](#module_Templating API_ toplevel utility helpers..zap_header) ⇒
    • [~ident()](#module_Templating API_ toplevel utility helpers..ident) ⇒
    • [~new_line(cnt)](#module_Templating API_ toplevel utility helpers..new_line) ⇒
    • [~backslash()](#module_Templating API_ toplevel utility helpers..backslash) ⇒
    • [~template_options(category, options)](#module_Templating API_ toplevel utility helpers..template_options)
    • [~first(options)](#module_Templating API_ toplevel utility helpers..first) ⇒
    • [~not_first(options)](#module_Templating API_ toplevel utility helpers..not_first) ⇒
    • [~last(options)](#module_Templating API_ toplevel utility helpers..last) ⇒
    • [~not_last(optionms)](#module_Templating API_ toplevel utility helpers..not_last) ⇒
    • [~middle(options)](#module_Templating API_ toplevel utility helpers..middle) ⇒
    • [~template_option_with_code(options, key)](#module_Templating API_ toplevel utility helpers..template_option_with_code)
    • [~fail(options)](#module_Templating API_ toplevel utility helpers..fail)
    • [~isEqual(string_a, string_b)](#module_Templating API_ toplevel utility helpers..isEqual)
    • [~is_lowercase_equal(string_a, string_b)](#module_Templating API_ toplevel utility helpers..is_lowercase_equal)
    • [~toggle(condition, trueResult, falseResult)](#module_Templating API_ toplevel utility helpers..toggle) ⇒
    • [~trim_string(str)](#module_Templating API_ toplevel utility helpers..trim_string) ⇒
    • [~asLastWord(str)](#module_Templating API_ toplevel utility helpers..asLastWord)
    • [~iterate()](#module_Templating API_ toplevel utility helpers..iterate)
    • [~addToAccumulator(accumulator, value)](#module_Templating API_ toplevel utility helpers..addToAccumulator)
    • [~iterateAccumulator(options)](#module_Templating API_ toplevel utility helpers..iterateAccumulator) ⇒
    • [~waitForSynchronousPromise(pollInterval, promise, resolve, reject)](#module_Templating API_ toplevel utility helpers..waitForSynchronousPromise)
    • [~promiseToResolveAllPreviousPromises(globalPromises)](#module_Templating API_ toplevel utility helpers..promiseToResolveAllPreviousPromises)
    • [~after(options)](#module_Templating API_ toplevel utility helpers..after) ⇒
    • [~concatenate()](#module_Templating API_ toplevel utility helpers..concatenate)
    • [~is_num_equal(numA, numB)](#module_Templating API_ toplevel utility helpers..is_num_equal) ⇒
    • [~is_defined(value)](#module_Templating API_ toplevel utility helpers..is_defined) ⇒
    • [~replace_string(mainString, replaceString, replaceWithString)](#module_Templating API_ toplevel utility helpers..replace_string) ⇒
    • [~add_prefix_to_all_strings(str, prefixStr)](#module_Templating API_ toplevel utility helpers..add_prefix_to_all_strings) ⇒
    • [~multiply()](#module_Templating API_ toplevel utility helpers..multiply) ⇒
    • [~is_string_underscored(val)](#module_Templating API_ toplevel utility helpers..is_string_underscored) ⇒
    • [~as_uppercase(val)](#module_Templating API_ toplevel utility helpers..as_uppercase) ⇒

Templating API: toplevel utility helpers~zap_header() ⇒

Produces the top-of-the-file header for a C file.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: The header content

Templating API: toplevel utility helpers~ident() ⇒

Simple helper that produces an approved size of identation.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: whitespace that is the identation.

Templating API: toplevel utility helpers~new_line(cnt) ⇒

Return new lines based on the given cnt parameter.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: new line

Param Type
cnt *

Templating API: toplevel utility helpers~backslash() ⇒

return back slash

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: string

Templating API: toplevel utility helpers~template_options(category, options)

Block helper that iterates over the package options of a given category.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)

Param Type
category *
options *

Templating API: toplevel utility helpers~first(options) ⇒

Inside an iterator, this helper allows you to specify the content that will be output only during the first element.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: content, if it's the first element inside an operator, empty otherwise.

Param Type
options *

Templating API: toplevel utility helpers~not_first(options) ⇒

Inside an iterator, this helper allows you to specify the content that will be output only if the element is not the first element.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: content, if it's the first element inside an operator, empty otherwise.

Param Type
options *

Templating API: toplevel utility helpers~last(options) ⇒

Inside an iterator, this helper allows you to specify the content that will be output only during the last element.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: content, if it's the last element inside an operator, empty otherwise.

Param Type
options *

Templating API: toplevel utility helpers~not_last(optionms) ⇒

Inside an iterator. the block is output only if this is NOT the last item. Useful for wrapping commas in the list of arguments and such.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: content, if it's not the last element inside a block, empty otherwise.

Param Type
optionms *

Templating API: toplevel utility helpers~middle(options) ⇒

Inside an iterator, this helper allows you to specify the content that will be output only during the non-first and no-last element.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: content, if it's the middle element inside an operator, empty otherwise.

Param Type
options *

Templating API: toplevel utility helpers~template_option_with_code(options, key)

This fetches a promise which returns template options if provided

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)

Param Type
options *
key *

Templating API: toplevel utility helpers~fail(options)

Forced fail halper.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)

Param Type
options *

Templating API: toplevel utility helpers~isEqual(string_a, string_b)

This returns a boolean if the 2 strings are same

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)

Param Type
string_a *
string_b *

Templating API: toplevel utility helpers~is_lowercase_equal(string_a, string_b)

This returns a boolean based on the 2 strings being equal or not given that both

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)

Param Type
string_a *
string_b *

Templating API: toplevel utility helpers~toggle(condition, trueResult, falseResult) ⇒

Return true/false result based on condition.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: boolean

Param Type
condition *
trueResult *
falseResult *

Templating API: toplevel utility helpers~trim_string(str) ⇒

Remove leading and trailing spaces from a string

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: A string with no leading and trailing spaces

Param Type
str *

Templating API: toplevel utility helpers~asLastWord(str)

Split the string based on spaces and return the last word

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)

Param Type
str *

Templating API: toplevel utility helpers~iterate()

Iteration block.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)

Templating API: toplevel utility helpers~addToAccumulator(accumulator, value)

Add to accumulator results.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)

Param Type
accumulator *
value *

Templating API: toplevel utility helpers~iterateAccumulator(options) ⇒

Get accumulated information from templates.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: accumulated details

Param Type
options *

Templating API: toplevel utility helpers~waitForSynchronousPromise(pollInterval, promise, resolve, reject)

Waits for promise to be resolved synchronously.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)

Param Type
pollInterval *
promise *
resolve *
reject *

Templating API: toplevel utility helpers~promiseToResolveAllPreviousPromises(globalPromises)

Resolves all the given globalPromises promises.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)

Param Type
globalPromises *

Templating API: toplevel utility helpers~after(options) ⇒

Resolve the after promise after all other promises in the global context have been resolved.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: Content after all other content has been resolved.

Param Type
options *

Templating API: toplevel utility helpers~concatenate()

Given: A list of strings Returns a concatenated string with spaces between each string

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)

Templating API: toplevel utility helpers~is_num_equal(numA, numB) ⇒

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: true if both numbers are equal else returns false

Param
numA
numB

Templating API: toplevel utility helpers~is_defined(value) ⇒

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: true or false based on whether the value is undefined or not

Param
value

Templating API: toplevel utility helpers~replace_string(mainString, replaceString, replaceWithString) ⇒

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: A string replaced with another string in the mainString

Param
mainString
replaceString
replaceWithString

Templating API: toplevel utility helpers~add_prefix_to_all_strings(str, prefixStr) ⇒

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: A resultant string with all string values prefixed with prefixStr

Param
str
prefixStr

Templating API: toplevel utility helpers~multiply() ⇒

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: A number which is result of multiplying all the arguments given

Templating API: toplevel utility helpers~is_string_underscored(val) ⇒

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: true if a string has an underscore in it

Param Type
val *

Templating API: toplevel utility helpers~as_uppercase(val) ⇒

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: val in uppercase

Param Type
val *

Templating API: static zcl helpers

This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}

  • [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
    • [~zcl_bitmaps(options)](#module_Templating API_ static zcl helpers..zcl_bitmaps) ⇒
    • [~zcl_bitmap_items(options)](#module_Templating API_ static zcl helpers..zcl_bitmap_items)
    • [~zcl_enums(options)](#module_Templating API_ static zcl helpers..zcl_enums) ⇒
    • [~zcl_structs(options)](#module_Templating API_ static zcl helpers..zcl_structs) ⇒
    • [~zcl_enum_items(options)](#module_Templating API_ static zcl helpers..zcl_enum_items)
    • [~first_unused_enum_value(options)](#module_Templating API_ static zcl helpers..first_unused_enum_value) ⇒
    • [~zcl_struct_items(options)](#module_Templating API_ static zcl helpers..zcl_struct_items) ⇒
    • [~zcl_struct_items_by_struct_name(name, options)](#module_Templating API_ static zcl helpers..zcl_struct_items_by_struct_name) ⇒
    • [~zcl_struct_items_by_struct_and_cluster_name(name, clusterName, options)](#module_Templating API_ static zcl helpers..zcl_struct_items_by_struct_and_cluster_name) ⇒
    • [~zcl_device_types(options)](#module_Templating API_ static zcl helpers..zcl_device_types) ⇒
    • [~zcl_device_type_clusters(options)](#module_Templating API_ static zcl helpers..zcl_device_type_clusters) ⇒
    • [~zcl_device_type_cluster_commands(options)](#module_Templating API_ static zcl helpers..zcl_device_type_cluster_commands) ⇒
    • [~zcl_device_type_cluster_attributes(options)](#module_Templating API_ static zcl helpers..zcl_device_type_cluster_attributes) ⇒
    • [~zcl_clusters(options)](#module_Templating API_ static zcl helpers..zcl_clusters) ⇒
    • [~zcl_commands(options)](#module_Templating API_ static zcl helpers..zcl_commands) ⇒
    • [~zcl_command_responses(options)](#module_Templating API_ static zcl helpers..zcl_command_responses) ⇒
    • [~zcl_commands_with_cluster_info(options)](#module_Templating API_ static zcl helpers..zcl_commands_with_cluster_info) ⇒
    • [~zcl_commands_with_arguments(options)](#module_Templating API_ static zcl helpers..zcl_commands_with_arguments)
    • [~zcl_commands_source_client(options)](#module_Templating API_ static zcl helpers..zcl_commands_source_client) ⇒
    • [~zcl_commands_source_server(options)](#module_Templating API_ static zcl helpers..zcl_commands_source_server) ⇒
    • [~zcl_events(options)](#module_Templating API_ static zcl helpers..zcl_events) ⇒
    • [~zcl_command_tree(options)](#module_Templating API_ static zcl helpers..zcl_command_tree) ⇒
    • [~zcl_global_commands(options)](#module_Templating API_ static zcl helpers..zcl_global_commands) ⇒
    • [~zcl_attributes(options)](#module_Templating API_ static zcl helpers..zcl_attributes) ⇒
    • [~zcl_attributes_client(options)](#module_Templating API_ static zcl helpers..zcl_attributes_client) ⇒
    • [~zcl_attributes_server(options)](#module_Templating API_ static zcl helpers..zcl_attributes_server) ⇒
    • [~zcl_atomics(options)](#module_Templating API_ static zcl helpers..zcl_atomics) ⇒
    • [~zcl_cluster_largest_label_length()](#module_Templating API_ static zcl helpers..zcl_cluster_largest_label_length) ⇒
    • [~largestLabelLength(An)](#module_Templating API_ static zcl helpers..largestLabelLength) ⇒
    • [~zcl_command_arguments_count(commandId)](#module_Templating API_ static zcl helpers..zcl_command_arguments_count) ⇒
    • [~ifCommandArgumentsHaveFixedLengthWithCurrentContext(commandId, fixedLengthReturn, notFixedLengthReturn, currentContext)](#module_Templating API_ static zcl helpers..ifCommandArgumentsHaveFixedLengthWithCurrentContext)
    • [~if_command_arguments_have_fixed_length(commandId, fixedLengthReturn, notFixedLengthReturn)](#module_Templating API_ static zcl helpers..if_command_arguments_have_fixed_length)
    • [~as_underlying_zcl_type_command_is_not_fixed_length_but_command_argument_is_always_present(type, command, commandArg, appendString, options)](#module_Templating API_ static zcl helpers..as_underlying_zcl_type_command_is_not_fixed_length_but_command_argument_is_always_present) ⇒
    • [~as_underlying_zcl_type_if_command_is_not_fixed_length(type, commandId, appendString, options)](#module_Templating API_ static zcl helpers..as_underlying_zcl_type_if_command_is_not_fixed_length)
    • [~command_arguments_total_length(commandId)](#module_Templating API_ static zcl helpers..command_arguments_total_length)
    • [~zcl_command_arguments(options)](#module_Templating API_ static zcl helpers..zcl_command_arguments) ⇒
    • [~zcl_event_fields(options)](#module_Templating API_ static zcl helpers..zcl_event_fields)
    • [~zcl_command_argument_data_type(typeName, options)](#module_Templating API_ static zcl helpers..zcl_command_argument_data_type)
    • [~asUnderlyingZclType(typeName, options)](#module_Templating API_ static zcl helpers..asUnderlyingZclType)
    • [~zcl_string_type_return(type, options)](#module_Templating API_ static zcl helpers..zcl_string_type_return)
    • [~is_zcl_string(type)](#module_Templating API_ static zcl helpers..is_zcl_string)
    • [~if_is_number(type)](#module_Templating API_ static zcl helpers..if_is_number) ⇒
    • [~if_is_string(type)](#module_Templating API_ static zcl helpers..if_is_string) ⇒
    • [~if_is_char_string(type)](#module_Templating API_ static zcl helpers..if_is_char_string) ⇒
    • [~if_is_octet_string(type)](#module_Templating API_ static zcl helpers..if_is_octet_string) ⇒
    • [~if_is_short_string(type)](#module_Templating API_ static zcl helpers..if_is_short_string) ⇒
    • [~if_is_long_string(type)](#module_Templating API_ static zcl helpers..if_is_long_string) ⇒
    • [~if_is_atomic(type:)](#module_Templating API_ static zcl helpers..if_is_atomic) ⇒
    • [~if_is_bitmap(type)](#module_Templating API_ static zcl helpers..if_is_bitmap) ⇒
    • [~if_is_enum(type)](#module_Templating API_ static zcl helpers..if_is_enum) ⇒
    • [~if_is_struct(type)](#module_Templating API_ static zcl helpers..if_is_struct) ⇒
    • [~isClient(side)](#module_Templating API_ static zcl helpers..isClient) ⇒
    • [~isServer(side)](#module_Templating API_ static zcl helpers..isServer) ⇒
    • [~isStrEqual(str1, str2)](#module_Templating API_ static zcl helpers..isStrEqual) ⇒
    • [~isLastElement(index, count)](#module_Templating API_ static zcl helpers..isLastElement) ⇒
    • [~isFirstElement(index, count)](#module_Templating API_ static zcl helpers..isFirstElement) ⇒
    • [~isEnabled(enable)](#module_Templating API_ static zcl helpers..isEnabled) ⇒
    • [~isCommandAvailable(clusterSide, incoming, outgoing, source, name)](#module_Templating API_ static zcl helpers..isCommandAvailable) ⇒
    • [~as_underlying_zcl_type_command_argument_always_present(type:, commandId:, appendString:, introducedInRef:, removedInRef:, presentIf:, options:)](#module_Templating API_ static zcl helpers..as_underlying_zcl_type_command_argument_always_present) ⇒
    • [~if_command_argument_always_present(commandId, introducedInRef, removedInRef, presentIf, argumentPresentReturn, argumentNotPresentReturn)](#module_Templating API_ static zcl helpers..if_command_argument_always_present) ⇒
    • [~as_underlying_zcl_type_command_argument_not_always_present_no_presentif(type:, commandId:, appendString:, introducedInRef:, removedInRef:, presentIf:, options:)](#module_Templating API_ static zcl helpers..as_underlying_zcl_type_command_argument_not_always_present_no_presentif) ⇒
    • [~as_underlying_zcl_type_ca_not_always_present_no_presentif(commandArg, appendString, options)](#module_Templating API_ static zcl helpers..as_underlying_zcl_type_ca_not_always_present_no_presentif) ⇒
    • [~if_command_argument_not_always_present_no_presentif(commandId, introducedInRef, removedInRef, presentIf, argumentNotInAllVersionsReturn, argumentInAllVersionsReturn)](#module_Templating API_ static zcl helpers..if_command_argument_not_always_present_no_presentif) ⇒
    • [~as_underlying_zcl_type_command_argument_not_always_present_with_presentif(type:, commandId:, appendString:, introducedInRef:, removedInRef:, presentIf:, options:)](#module_Templating API_ static zcl helpers..as_underlying_zcl_type_command_argument_not_always_present_with_presentif) ⇒
    • [~as_underlying_zcl_type_ca_not_always_present_with_presentif(commandArg, appendString, options)](#module_Templating API_ static zcl helpers..as_underlying_zcl_type_ca_not_always_present_with_presentif) ⇒
    • [~if_command_argument_not_always_present_with_presentif(commandId, introducedInRef, removedInRef, presentIf, argumentNotInAllVersionsPresentIfReturn, argumentInAllVersionsReturn)](#module_Templating API_ static zcl helpers..if_command_argument_not_always_present_with_presentif) ⇒
    • [~as_underlying_zcl_type_command_argument_always_present_with_presentif(type:, commandId:, appendString:, introducedInRef:, removedInRef:, presentIf:, options:)](#module_Templating API_ static zcl helpers..as_underlying_zcl_type_command_argument_always_present_with_presentif) ⇒
    • [~as_underlying_zcl_type_ca_always_present_with_presentif(commandArg, appendString, options)](#module_Templating API_ static zcl helpers..as_underlying_zcl_type_ca_always_present_with_presentif) ⇒
    • [~if_command_argument_always_present_with_presentif(commandId, introducedInRef, removedInRef, presentIf, argumentNotInAllVersionsPresentIfReturn, argumentInAllVersionsReturn)](#module_Templating API_ static zcl helpers..if_command_argument_always_present_with_presentif) ⇒
    • [~if_manufacturing_specific_cluster(clusterId, manufacturer_specific_return, null_manufacturer_specific_return)](#module_Templating API_ static zcl helpers..if_manufacturing_specific_cluster) ⇒
    • [~if_mfg_specific_cluster(clusterId, options)](#module_Templating API_ static zcl helpers..if_mfg_specific_cluster) ⇒
    • [~as_generated_default_macro(value, attributeSize, options)](#module_Templating API_ static zcl helpers..as_generated_default_macro) ⇒
    • [~attribute_mask(writable, storageOption, minMax, mfgSpecific, clusterCode, client, isSingleton, prefixString, postfixString)](#module_Templating API_ static zcl helpers..attribute_mask) ⇒
    • [~command_mask(commmandSource, clusterSide, isIncomingEnabled, isOutgoingEnabled, manufacturingCode, prefixForMask)](#module_Templating API_ static zcl helpers..command_mask) ⇒
    • [~command_mask_sub_helper(commandMask, str)](#module_Templating API_ static zcl helpers..command_mask_sub_helper) ⇒
    • [~format_zcl_string_as_characters_for_generated_defaults(stringVal, sizeOfString)](#module_Templating API_ static zcl helpers..format_zcl_string_as_characters_for_generated_defaults) ⇒
    • [~as_type_min_value(type, options)](#module_Templating API_ static zcl helpers..as_type_min_value) ⇒
    • [~as_type_max_value(type, options)](#module_Templating API_ static zcl helpers..as_type_max_value) ⇒
    • [~structs_with_clusters(options)](#module_Templating API_ static zcl helpers..structs_with_clusters)
    • [~as_zcl_type_size(type, options)](#module_Templating API_ static zcl helpers..as_zcl_type_size) ⇒
    • [~if_compare(leftValue, rightValue, options)](#module_Templating API_ static zcl helpers..if_compare) ⇒ Object
    • [~if_is_data_type_signed(type, clusterId, options)](#module_Templating API_ static zcl helpers..if_is_data_type_signed) ⇒
    • [~as_zcl_data_type_size(type, clusterId, options)](#module_Templating API_ static zcl helpers..as_zcl_data_type_size) ⇒

Templating API: static zcl helpers~zcl_bitmaps(options) ⇒

Block helper iterating over all bitmaps.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
options *

Templating API: static zcl helpers~zcl_bitmap_items(options)

Iterates over enum items. Valid only inside zcl_enums.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)

Param Type
options *

Templating API: static zcl helpers~zcl_enums(options) ⇒

Block helper iterating over all enums. If existing independently, it iterates over ALL the enums. Within a context of a cluster, it iterates only over the enums belonging to a cluster.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
options *

Templating API: static zcl helpers~zcl_structs(options) ⇒

Block helper iterating over all structs. If existing independently, it iterates over ALL the structs. Within a context of a cluster, it iterates only over the structs belonging to a cluster.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
options *

Templating API: static zcl helpers~zcl_enum_items(options)

Iterates over enum items. Valid only inside zcl_enums.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)

Param Type
options *

Templating API: static zcl helpers~first_unused_enum_value(options) ⇒

This helper prints out the first unused enum value. It supports mode="next_larger" and mode="first_unused" (which is the default).

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: the unused enum value

Param Type
options *

Templating API: static zcl helpers~zcl_struct_items(options) ⇒

Block helper iterating over all struct items. Valid only inside zcl_structs.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
options *

Templating API: static zcl helpers~zcl_struct_items_by_struct_name(name, options) ⇒

Block helper iterating over all struct items given the struct name.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param
name
options

Templating API: static zcl helpers~zcl_struct_items_by_struct_and_cluster_name(name, clusterName, options) ⇒

Block helper iterating over all struct items given the struct name and cluster name. The items iterated will be those that correspond to that struct name being used within the given cluster. That means the struct name must be either a global struct (in which case the cluster name is just ignored), or a struct associated with the given cluster.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param
name
clusterName
options

Templating API: static zcl helpers~zcl_device_types(options) ⇒

Block helper iterating over all deviceTypes.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
options *

Templating API: static zcl helpers~zcl_device_type_clusters(options) ⇒

Block helper for use inside zcl_device_types

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: blocks for clusters

Param Type
options *

Templating API: static zcl helpers~zcl_device_type_cluster_commands(options) ⇒

Block helper for use inside zcl_device_type_clusters

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: blocks for commands

Param Type
options *

Templating API: static zcl helpers~zcl_device_type_cluster_attributes(options) ⇒

Block helper for use inside zcl_device_type_clusters

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: blocks for attributes

Param Type
options *

Templating API: static zcl helpers~zcl_clusters(options) ⇒

Block helper iterating over all clusters.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
options *

Templating API: static zcl helpers~zcl_commands(options) ⇒

Block helper iterating over all commands. There are two modes of this helper: when used in a global context, it iterates over ALL commands in the database. when used inside a zcl_cluster block helper, it iterates only over the commands for that cluster.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
options *

Templating API: static zcl helpers~zcl_command_responses(options) ⇒

Returns all commands which are command responses. For eg, If the xml has the following: then newCmdResponse will be included in the list of commands returned here.

There are two modes of this helper:

  • when used in a global context, it iterates over ALL command responses in the database.
  • when used inside a zcl_cluster block helper, it iterates only over the commands responses for that cluster.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: all command responses

Param Type
options *

Templating API: static zcl helpers~zcl_commands_with_cluster_info(options) ⇒

Block helper iterating over all commands with cluster information. Note: Similar to zcl_commands but has cluster information as well.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
options *

Templating API: static zcl helpers~zcl_commands_with_arguments(options)

Helper that retrieves all commands that contain arguments.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)

Param Type
options *

Templating API: static zcl helpers~zcl_commands_source_client(options) ⇒

Block helper iterating over all client commands. There are two modes of this helper: when used in a global context, it iterates over ALL client commands in the database. when used inside a zcl_cluster block helper, it iterates only over the commands for that client cluster.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
options *

Templating API: static zcl helpers~zcl_commands_source_server(options) ⇒

Block helper iterating over all server commands. There are two modes of this helper: when used in a global context, it iterates over ALL server commands in the database. when used inside a zcl_cluster block helper, it iterates only over the commands for that server cluster.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
options *

Templating API: static zcl helpers~zcl_events(options) ⇒

Block helper iterating over all events. There are two modes of this helper: when used in a global context, it iterates over ALL events in the database. when used inside a zcl_cluster block helper, it iterates only over the events for that cluster.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
options *

Templating API: static zcl helpers~zcl_command_tree(options) ⇒

Block helper iterating over all commands, including their arguments and clusters.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
options *

Templating API: static zcl helpers~zcl_global_commands(options) ⇒

Helper to iterate over all global commands.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of global command iteration.

Param Type
options *

Templating API: static zcl helpers~zcl_attributes(options) ⇒

Iterator over the attributes. If it is used at toplevel, if iterates over all the attributes in the database. If used within zcl_cluster context, it iterates over all the attributes that belong to that cluster.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of attribute iteration.

Param Type
options *

Templating API: static zcl helpers~zcl_attributes_client(options) ⇒

Iterator over the client attributes. If it is used at toplevel, if iterates over all the client attributes in the database. If used within zcl_cluster context, it iterates over all the client attributes that belong to that cluster.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of attribute iteration.

Param Type
options *

Templating API: static zcl helpers~zcl_attributes_server(options) ⇒

Iterator over the server attributes. If it is used at toplevel, if iterates over all the server attributes in the database. If used within zcl_cluster context, it iterates over all the server attributes that belong to that cluster. Available Options:

  • removeKeys: Removes one or more keys from the map(for eg keys in db-mapping.js) for eg: (#zcl_attributes_server removeKeys='isOptional, isNullable') will remove 'isOptional' from the results

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of attribute iteration.

Param Type
options *

Templating API: static zcl helpers~zcl_atomics(options) ⇒

Block helper iterating over all atomic types.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
options *

Templating API: static zcl helpers~zcl_cluster_largest_label_length() ⇒

Given: N/A

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: the length of largest cluster name in a list of clusters

Templating API: static zcl helpers~largestLabelLength(An) ⇒

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: the length of largest object name in an array. Helper for zcl_cluster_largest_label_length

Param Type Description
An * Array

Templating API: static zcl helpers~zcl_command_arguments_count(commandId) ⇒

Helper to extract the number of command arguments in a command

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Number of command arguments as an integer

Param Type
commandId *

Templating API: static zcl helpers~ifCommandArgumentsHaveFixedLengthWithCurrentContext(commandId, fixedLengthReturn, notFixedLengthReturn, currentContext)

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)

Param Description
commandId
fixedLengthReturn
notFixedLengthReturn
currentContext Returns fixedLengthReturn or notFixedLengthReturn based on whether the command is fixed length or not

Templating API: static zcl helpers~if_command_arguments_have_fixed_length(commandId, fixedLengthReturn, notFixedLengthReturn)

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)

Param Description
commandId
fixedLengthReturn
notFixedLengthReturn Returns fixedLengthReturn or notFixedLengthReturn based on whether the command is fixed length or not. Does not check if command arguments are always present or not.

Templating API: static zcl helpers~as_underlying_zcl_type_command_is_not_fixed_length_but_command_argument_is_always_present(type, command, commandArg, appendString, options) ⇒

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: the underlying zcl type of a command argument if the argument is not fixed length but is always present. If the condition is not met then returns an empty string.

Param
type
command
commandArg
appendString
options

Templating API: static zcl helpers~as_underlying_zcl_type_if_command_is_not_fixed_length(type, commandId, appendString, options)

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)

Param Description
type
commandId
appendString
options Returns: Given the commandId and the type of one of its arguments, based on whether the command is fixed length or not either return nothing or return the underlying zcl type appended with the appendString.

Templating API: static zcl helpers~command_arguments_total_length(commandId)

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)

Param Description
commandId Returns the size of the command by calculating the sum total of the command arguments Note: This helper should be called on fixed length commands only. It should not be called with commands which do not have a fixed length.

Templating API: static zcl helpers~zcl_command_arguments(options) ⇒

Block helper iterating over command arguments within a command or a command tree.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of command argument iteration.

Param Type
options *

Templating API: static zcl helpers~zcl_event_fields(options)

Block helper iterating over the event fields inside an event.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)

Param Type
options *

Templating API: static zcl helpers~zcl_command_argument_data_type(typeName, options)

Helper that deals with the type of the argument.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)

Param Type
typeName *
options *

Templating API: static zcl helpers~asUnderlyingZclType(typeName, options)

Helper that deals with the type of the argument.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)

Param Type Description
typeName *
options * Note: If the options has zclCharFormatter set to true then the function will return the user defined data associated with the zcl data type and not the actual data type. example: {{asUnderlyingZclType [array type] array="b" one_byte="u" two_byte="v" three_byte="x" four_byte="w" short_string="s" long_string="l" default="b" zclCharFormatter="true"}} For the above if asUnderlyingZclType was given [array type] then the above will return 'b'

Templating API: static zcl helpers~zcl_string_type_return(type, options)

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)

Param Description
type
options Returns the data mentioned in the helper options based on whether the type is short string, long string or not a string Example: {{zcl_string_type_return type short_string="short string output" long_string="short string output" default="Output when not a string")

Templating API: static zcl helpers~is_zcl_string(type)

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)

Param Description
type Return: true or false based on whether the type is a string or not.

Templating API: static zcl helpers~if_is_number(type) ⇒

If helper that checks if a type is a string

example: {{#if_is_number type}} type is number {{else}} type is not number {{/if_is_number}}

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
type *

Templating API: static zcl helpers~if_is_string(type) ⇒

If helper that checks if a type is a string

example: {{#if_is_string type}} type is string {{else}} type is not string {{/if_is_string}}

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
type *

Templating API: static zcl helpers~if_is_char_string(type) ⇒

If helper that checks if a string type is present in the list of char strings i.e. characterStringTypes

example: {{#if_is_char_string type}} type is char string {{else}} type is not char string {{/if_is_char_string}}

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
type *

Templating API: static zcl helpers~if_is_octet_string(type) ⇒

If helper that checks if a string type is present in the list of octet strings i.e. octetStringTypes

example: {{#if_is_octet_string type}} type is octet string {{else}} type is not octet string {{/if_is_octet_string}}

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
type *

Templating API: static zcl helpers~if_is_short_string(type) ⇒

If helper that checks if a string type is present in the list of short strings i.e. stringShortTypes

example: {{#if_is_short_string type}} type is short string {{else}} type is not short string {{/if_is_short_string}}

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
type *

Templating API: static zcl helpers~if_is_long_string(type) ⇒

If helper that checks if a string type is present in the list of long strings i.e. stringLongTypes

example: {{#if_is_long_string type}} type is long string {{else}} type is not long string {{/if_is_long_string}}

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
type *

Templating API: static zcl helpers~if_is_atomic(type:) ⇒

If helper that checks if a type is an atomic

example: {{#if_is_atomic type}} type is atomic {{else}} type is not atomic {{/if_is_atomic}}

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type Description
type: * string

Templating API: static zcl helpers~if_is_bitmap(type) ⇒

If helper that checks if a type is a bitmap

example: {{#if_is_bitmap type}} type is bitmap {{else}} type is not bitmap {{/if_is_bitmap}}

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
type *

Templating API: static zcl helpers~if_is_enum(type) ⇒

If helper that checks if a type is an enum

  • example: {{#if_is_enum type}} type is enum {{else}} type is not enum {{/if_is_enum}}

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
type *

Templating API: static zcl helpers~if_is_struct(type) ⇒

If helper that checks if a type is an struct

  • example: {{#if_is_struct type}} type is struct {{else}} type is not struct {{/if_is_struct}}

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param
type

Templating API: static zcl helpers~isClient(side) ⇒

Checks if the side is client or not

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: boolean

Param Type
side *

Templating API: static zcl helpers~isServer(side) ⇒

Checks if the side is server or not

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: boolean

Param Type
side *

Templating API: static zcl helpers~isStrEqual(str1, str2) ⇒

Compares 2 strings.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: boolean

Param Type
str1 *
str2 *

Templating API: static zcl helpers~isLastElement(index, count) ⇒

Returns boolean based on whether the element is the last element.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: boolean

Param Type
index *
count *

Templating API: static zcl helpers~isFirstElement(index, count) ⇒

Returns boolean based on whether the element is the first element.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: boolean

Param Type
index *
count *

Templating API: static zcl helpers~isEnabled(enable) ⇒

Check if enable is 1.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: boolean

Param Type
enable *

Templating API: static zcl helpers~isCommandAvailable(clusterSide, incoming, outgoing, source, name) ⇒

Returns boolean based on command being available or not.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: boolean

Param Type
clusterSide *
incoming *
outgoing *
source *
name *

Templating API: static zcl helpers~as_underlying_zcl_type_command_argument_always_present(type:, commandId:, appendString:, introducedInRef:, removedInRef:, presentIf:, options:) ⇒

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: A string as an underlying zcl type if the command is not fixed length and the command argument is always present in all zcl specifications.

Param Description
type: type of argument
commandId: command id
appendString: append the string to the argument
introducedInRef: If the command argument is not present in all zcl specifications and was introduced in a certain specification version then this will not be null
removedInRef: If the command argument is not present in all zcl specifications and was removed in a certain specification version then this will not be null
presentIf: If the command argument is present conditionally then this will be a condition and not null
options: options which can be passed to zclUtil.asUnderlyingZclTypeWithPackageId for determining the underlying zcl type for the provided argument type

Templating API: static zcl helpers~if_command_argument_always_present(commandId, introducedInRef, removedInRef, presentIf, argumentPresentReturn, argumentNotPresentReturn) ⇒

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: argumentPresentReturn if the command is not fixed length and command argument is always present without conditions(introducedInRef, removedInRef, presentIf) else returns argumentNotPresentReturn

Param
commandId
introducedInRef
removedInRef
presentIf
argumentPresentReturn
argumentNotPresentReturn

Templating API: static zcl helpers~as_underlying_zcl_type_command_argument_not_always_present_no_presentif(type:, commandId:, appendString:, introducedInRef:, removedInRef:, presentIf:, options:) ⇒

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: A string as an underlying zcl type if the command is not fixed length, the command argument is not always present in all zcl specifications and there is no present if conditionality on the command argument.

Param Description
type: type of argument
commandId: command id
appendString: append the string to the argument
introducedInRef: If the command argument is not present in all zcl specifications and was introduced in a certain specification version then this will not be null
removedInRef: If the command argument is not present in all zcl specifications and was removed in a certain specification version then this will not be null
presentIf: If the command argument is present conditionally then this will be a condition and not null
options: options which can be passed to zclUtil.asUnderlyingZclTypeWithPackageId for determining the underlying zcl type for the provided argument type

Templating API: static zcl helpers~as_underlying_zcl_type_ca_not_always_present_no_presentif(commandArg, appendString, options) ⇒

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: A string as an underlying zcl type if the command is not fixed length, the command argument is not always present in all zcl specifications and there is no present if conditionality on the command argument.

Param Description
commandArg command argument
appendString append the string to the argument
options options which can be passed to zclUtil.asUnderlyingZclTypeWithPackageId for determining the underlying zcl type for the provided argument type

Templating API: static zcl helpers~if_command_argument_not_always_present_no_presentif(commandId, introducedInRef, removedInRef, presentIf, argumentNotInAllVersionsReturn, argumentInAllVersionsReturn) ⇒

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: argumentNotInAllVersionsReturn if the command is not fixed length and command argument is present with conditions introducedInRef or removedInRef but no presentIf conditions else returns argumentNotPresentReturn

Param
commandId
introducedInRef
removedInRef
presentIf
argumentNotInAllVersionsReturn
argumentInAllVersionsReturn

Templating API: static zcl helpers~as_underlying_zcl_type_command_argument_not_always_present_with_presentif(type:, commandId:, appendString:, introducedInRef:, removedInRef:, presentIf:, options:) ⇒

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: A string as an underlying zcl type if the command is not fixed length, the command argument is not always present in all zcl specifications and there is a present if conditionality on the command argument.

Param Description
type: type of argument
commandId: command id
appendString: append the string to the argument
introducedInRef: If the command argument is not present in all zcl specifications and was introduced in a certain specification version then this will not be null
removedInRef: If the command argument is not present in all zcl specifications and was removed in a certain specification version then this will not be null
presentIf: If the command argument is present conditionally then this will be a condition and not null
options: options which can be passed to zclUtil.asUnderlyingZclTypeWithPackageId for determining the underlying zcl type for the provided argument type

Templating API: static zcl helpers~as_underlying_zcl_type_ca_not_always_present_with_presentif(commandArg, appendString, options) ⇒

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: A string as an underlying zcl type if the command is not fixed length, the command argument is not always present in all zcl specifications but there is a present if conditionality on the command argument.

Param Description
commandArg command argument
appendString append the string to the argument
options options which can be passed to zclUtil.asUnderlyingZclTypeWithPackageId for determining the underlying zcl type for the provided argument type

Templating API: static zcl helpers~if_command_argument_not_always_present_with_presentif(commandId, introducedInRef, removedInRef, presentIf, argumentNotInAllVersionsPresentIfReturn, argumentInAllVersionsReturn) ⇒

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: argumentNotInAllVersionsReturn if the command is not fixed length, command argument is present with conditions introducedInRef or removedInRef and presentIf conditions exist as well else returns argumentNotPresentReturn

Param
commandId
introducedInRef
removedInRef
presentIf
argumentNotInAllVersionsPresentIfReturn
argumentInAllVersionsReturn

Templating API: static zcl helpers~as_underlying_zcl_type_command_argument_always_present_with_presentif(type:, commandId:, appendString:, introducedInRef:, removedInRef:, presentIf:, options:) ⇒

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: A string as an underlying zcl type if the command is not fixed length, the command argument is always present in all zcl specifications and there is a present if conditionality on the command argument.

Param Description
type: type of argument
commandId: command id
appendString: append the string to the argument
introducedInRef: If the command argument is not present in all zcl specifications and was introduced in a certain specification version then this will not be null
removedInRef: If the command argument is not present in all zcl specifications and was removed in a certain specification version then this will not be null
presentIf: If the command argument is present conditionally then this will be a condition and not null
options: options which can be passed to zclUtil.asUnderlyingZclTypeWithPackageId for determining the underlying zcl type for the provided argument type

Templating API: static zcl helpers~as_underlying_zcl_type_ca_always_present_with_presentif(commandArg, appendString, options) ⇒

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: A string as an underlying zcl type if the command is not fixed length, the command argument is always present in all zcl specifications but there is a present if conditionality on the command argument.

Param Description
commandArg command argument
appendString append the string to the argument
options options which can be passed to zclUtil.asUnderlyingZclTypeWithPackageId for determining the underlying zcl type for the provided argument type

Templating API: static zcl helpers~if_command_argument_always_present_with_presentif(commandId, introducedInRef, removedInRef, presentIf, argumentNotInAllVersionsPresentIfReturn, argumentInAllVersionsReturn) ⇒

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: argumentInAllVersionsPresentIfReturn if the command is not fixed length, command argument is always present and presentIf conditions exist else returns argumentNotPresentReturn

Param
commandId
introducedInRef
removedInRef
presentIf
argumentNotInAllVersionsPresentIfReturn
argumentInAllVersionsReturn

Templating API: static zcl helpers~if_manufacturing_specific_cluster(clusterId, manufacturer_specific_return, null_manufacturer_specific_return) ⇒

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: manufacturer_specific_return if the cluster is manufacturer specific or returns null_manufacturer_specific_return if cluster is not manufacturer specific.

Param Type
clusterId *
manufacturer_specific_return *
null_manufacturer_specific_return *

Templating API: static zcl helpers~if_mfg_specific_cluster(clusterId, options) ⇒

If helper which checks if cluster is manufacturing specific or not example: {{#if_mfg_specific_cluster clusterId}} cluster is manufacturing specific {{else}} cluster is not manufacturing specific {{/if_mfg_specific_cluster}}

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Returns content in the handlebar template based on whether the command is manufacturing specific or not.

Param
clusterId
options

Templating API: static zcl helpers~as_generated_default_macro(value, attributeSize, options) ⇒

Given the value and size of an attribute along with endian as an option. This helper returns the attribute value as big/little endian. Example: {{as_generated_default_macro 0x00003840 4 endian="big"}} will return: 0x00, 0x00, 0x38, 0x40,

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Formatted attribute value based on given arguments Available options:

  • endian: Specify 'big' or 'little' endian format
  • isCommaTerminated: '0' or '1' for output to have a ',' at the end
Param
value
attributeSize
options

Templating API: static zcl helpers~attribute_mask(writable, storageOption, minMax, mfgSpecific, clusterCode, client, isSingleton, prefixString, postfixString) ⇒

Given the attributes of a zcl attribute. Creates an attribute mask based on the given options Available options: isClusterCodeMfgSpecific: 0/1, This is to determine if cluster code needs to be used to determine if a cluster is mfg specific or not.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: attribute mask based on given values

Param
writable
storageOption
minMax
mfgSpecific
clusterCode
client
isSingleton
prefixString
postfixString

Templating API: static zcl helpers~command_mask(commmandSource, clusterSide, isIncomingEnabled, isOutgoingEnabled, manufacturingCode, prefixForMask) ⇒

Given the attributes of a zcl command. Creates a command mask based on the given options

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: command mask based on given values

Param
commmandSource
clusterSide
isIncomingEnabled
isOutgoingEnabled
manufacturingCode
prefixForMask

Templating API: static zcl helpers~command_mask_sub_helper(commandMask, str) ⇒

A Sub helper api for command_mask to reduce code redundancy

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: command mask addition based on the arguments

Param
commandMask
str

Templating API: static zcl helpers~format_zcl_string_as_characters_for_generated_defaults(stringVal, sizeOfString) ⇒

This may be used within all_user_cluster_attributes_for_generated_defaults for example: {{format_zcl_string_as_characters_for_generated_defaults 'abc' 5}} will return as follows: 3, 'a', 'b', 'c' 0, 0

Available Options:

  • isOctet: 0/1 can be used to return results correctly for octet strings
  • isCommaTerminated: 0/1 can be used to return result with/without ',' at the end

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Formatted string for generated defaults starting with the lenth of a string then each character and then filler for the size allocated for the string. Long strings prefixed by 2 byte length field.

Param
stringVal
sizeOfString

Templating API: static zcl helpers~as_type_min_value(type, options) ⇒

Given a zcl data type return the min allowed value for that zcl data type based on the language specified in the options

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: max allowed value for the given zcl data type Available Options:

  • language: determines the output of the helper based on language for eg: (as_type_min_value language='c++') will give the output specific to the c++ language. Note: If language is not specified then helper throws an error.
Param Type
type *
options *

Templating API: static zcl helpers~as_type_max_value(type, options) ⇒

Given a zcl data type return the max allowed value for that zcl data type based on the language specified in the options

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: max allowed value for the given zcl data type Available Options:

  • language: determines the output of the helper based on language for eg: (as_type_max_value language='c++') will give the output specific to the c++ language. Note: If language is not specified then the helper returns size of type in bits.
Param Type
type *
options *

Templating API: static zcl helpers~structs_with_clusters(options)

Returns all structs which have clusters associated with them

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)

Param Type Description
options * Available Options: - groupByStructName: Can group the query results based on struct name for structs which are present in more than one cluster eg Usage: {{#structs_with_clusters groupByStructName=1}}{{/structs_with_clusters}}

Templating API: static zcl helpers~as_zcl_type_size(type, options) ⇒

Returns the size of the zcl type if possible else returns -1

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: size of zcl type

Param Type
type *
options *

Templating API: static zcl helpers~if_compare(leftValue, rightValue, options) ⇒ Object

An if helper for comparisons

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Object - Promise of content example: checking if (4 < 5) (if_compare 4 5 operator='<') Content when comparison returns true

Content when comparison returns false (/if_compare)

Param Type
leftValue *
rightValue *
options *

Templating API: static zcl helpers~if_is_data_type_signed(type, clusterId, options) ⇒

Check if the given type is signed or not based on the type name and cluster id. Note: This helper needs to be used under a block helper which has a reference to clusterId.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content

Param Type
type *
clusterId *
options *

Templating API: static zcl helpers~as_zcl_data_type_size(type, clusterId, options) ⇒

Fetches the size of the data type based on type name and cluster id given Note:

  • Size is zero for structs
  • This helper needs to be used under a block helper which has a reference to clusterId. Available Options:
  • roundUpToPowerOfTwo: Rounds the size up to the nearest power of 2
  • sizeIn: By default size is returned in bytes but it can be returned in bits by mentioning sizeIn="bits"

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: size of the data type

Param Type
type *
clusterId *
options *

Templating API: Zigbee Specific helpers

This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}

  • [Templating API: Zigbee Specific helpers](#module_Templating API_ Zigbee Specific helpers)
    • [~get_cli_size(size, type, allowZclTypes)](#module_Templating API_ Zigbee Specific helpers..get_cli_size) ⇒
    • [~zcl_command_argument_type_to_cli_data_type_util(type, cliPrefix, context, options)](#module_Templating API_ Zigbee Specific helpers..zcl_command_argument_type_to_cli_data_type_util) ⇒
    • [~zcl_command_argument_type_to_cli_data_type(typeName, options)](#module_Templating API_ Zigbee Specific helpers..zcl_command_argument_type_to_cli_data_type)
    • [~zcl_command_argument_type_to_zcl_cli_data_type(typeName, options)](#module_Templating API_ Zigbee Specific helpers..zcl_command_argument_type_to_zcl_cli_data_type)

Templating API: Zigbee Specific helpers~get_cli_size(size, type, allowZclTypes) ⇒

Kind: inner method of [Templating API: Zigbee Specific helpers](#module_Templating API_ Zigbee Specific helpers)
Returns: The size in bits for a cli type based on allowZclTypes

Param Type
size *
type *
allowZclTypes *

Templating API: Zigbee Specific helpers~zcl_command_argument_type_to_cli_data_type_util(type, cliPrefix, context, options) ⇒

Kind: inner method of [Templating API: Zigbee Specific helpers](#module_Templating API_ Zigbee Specific helpers)
Returns: the zcl cli data type string with the cli prefix given Additional Options:

  • isOptional option can be passed along with the command argument to return optional command argument extension accordingly eg: #zcl_command_arguments zcl_command_argument_type_to_zcl_cli_data_type type isOptional=isOptional /zcl_command_arguments
Param Type
type *
cliPrefix *
context *
options *

Templating API: Zigbee Specific helpers~zcl_command_argument_type_to_cli_data_type(typeName, options)

Helper that deals with the type of the argument.

Kind: inner method of [Templating API: Zigbee Specific helpers](#module_Templating API_ Zigbee Specific helpers)

Param Type
typeName *
options *

Templating API: Zigbee Specific helpers~zcl_command_argument_type_to_zcl_cli_data_type(typeName, options)

Helper that deals with the type of the argument.

Kind: inner method of [Templating API: Zigbee Specific helpers](#module_Templating API_ Zigbee Specific helpers)

Param Type
typeName *
options *