Modules

Members

Constants

Functions

DB API: External URLs.

This module provides common external URLs.

DB API: DB types and enums.

This module provides mappings between database columns and JS keys.

JS API: low level database access

This module provides generic DB functions for performing SQL queries.

  • [JS API: low level database access](#moduleJS API low level database access)
    • [~dbBeginTransaction(db)](#moduleJS API low level database access..dbBeginTransaction) ⇒
    • [~dbCommit(db)](#moduleJS API low level database access..dbCommit) ⇒
    • [~isTransactionActive()](#moduleJS API low level database access..isTransactionActive) ⇒
    • [~dbRollback(db)](#moduleJS API low level database access..dbRollback) ⇒
    • [~dbRemove(db, query, args)](#moduleJS API low level database access..dbRemove) ⇒
    • [~dbUpdate(db, query, args)](#moduleJS API low level database access..dbUpdate) ⇒
    • [~dbInsert(db, query, args)](#moduleJS API low level database access..dbInsert) ⇒
    • [~dbAll(db, query, args)](#moduleJS API low level database access..dbAll) ⇒
    • [~dbGet(db, query, args)](#moduleJS API low level database access..dbGet) ⇒
    • [~dbMultiSelect(db, sql, arrayOfArrays)](#moduleJS API low level database access..dbMultiSelect)
    • [~dbMultiInsert(db, sql, arrayOfArrays)](#moduleJS API low level database access..dbMultiInsert) ⇒
    • [~closeDatabase(database)](#moduleJS API low level database access..closeDatabase) ⇒
    • [~closeDatabaseSync(database)](#moduleJS API low level database access..closeDatabaseSync)
    • [~initRamDatabase()](#moduleJS API low level database access..initRamDatabase) ⇒
    • [~initDatabase(sqlitePath)](#moduleJS API low level database access..initDatabase) ⇒
    • [~insertOrReplaceSetting(db, version)](#moduleJS API low level database access..insertOrReplaceSetting) ⇒
    • [~updateSetting(db, rows)](#moduleJS API low level database access..updateSetting) ⇒
    • [~selectSettings(db)](#moduleJS API low level database access..selectSettings) ⇒
    • [~loadSchema(db, schemaPath, zapVersion)](#moduleJS API low level database access..loadSchema) ⇒
    • [~initDatabaseAndLoadSchema(sqliteFile, schemaFile, zapVersion)](#moduleJS API low level database access..initDatabaseAndLoadSchema) ⇒
    • [~toDbBool(value)](#moduleJS API low level database access..toDbBool) ⇒
    • [~fromDbBool(value)](#moduleJS API low level database access..fromDbBool) ⇒
    • [~toInClause(value)](#moduleJS API low level database access..toInClause) ⇒

JS API: low level database access~dbBeginTransaction(db) ⇒

Returns a promise to begin a transaction. The beginning of the transaction will be delayed for up to 5 seconds, checking every 1/10th of a second of previous transaction is already finished.

After 5 seconds, the code gives up and rejects the promise.

This is to allow simultaneous calls to this function, even though SQLite does not allow for simultaneous transactions.

So use transactions responsibly.

Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: A promise that resolves without an argument and rejects with an error from BEGIN TRANSACTION query.

ParamType
db*

JS API: low level database access~dbCommit(db) ⇒

Returns a promise to execute a commit.

Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: A promise that resolves without an argument or rejects with an error from COMMIT query.

ParamType
db*

JS API: low level database access~isTransactionActive() ⇒

Not an async function, simply returns a boolean value whether there is a currently active transaction.

Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: true if transaction is active, false if not.

JS API: low level database access~dbRollback(db) ⇒

Returns a promise to execute a rollback of a transaction.

Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: A promise that resolves without an argument or rejects with an error from ROLLBACK query.

ParamType
db*

JS API: low level database access~dbRemove(db, query, args) ⇒

Returns a promise to execute a DELETE FROM query.

Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: A promise that resolve with the number of delete rows, or rejects with an error from query.

ParamType
db*
query*
args*

JS API: low level database access~dbUpdate(db, query, args) ⇒

Returns a promise to execute an update query.

Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: A promise that resolves with a number of changed rows, or rejects with an error from the query.

ParamType
db*
query*
args*

JS API: low level database access~dbInsert(db, query, args) ⇒

Returns a promise to execute an insert query.

Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: A promise that resolves with the rowid from the inserted row, or rejects with an error from the query.

ParamType
db*
query*
args*

JS API: low level database access~dbAll(db, query, args) ⇒

Returns a promise to execute a query to perform a select that returns all rows that match a query.

Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: A promise that resolves with the rows that got retrieved from the database, or rejects with an error from the query.

ParamType
db*
query*
args*

JS API: low level database access~dbGet(db, query, args) ⇒

Returns a promise to execute a query to perform a select that returns first row that matches a query.

Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: A promise that resolves with a single row that got retrieved from the database, or rejects with an error from the query.

ParamType
db*
query*
args*

JS API: low level database access~dbMultiSelect(db, sql, arrayOfArrays)

Returns a promise to perform a prepared statement, using data from array for SQL parameters. It resolves with an array of rows, containing the data, or rejects with an error.

Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)

ParamType
db*
sql*
arrayOfArrays*

JS API: low level database access~dbMultiInsert(db, sql, arrayOfArrays) ⇒

Returns a promise to perfom a prepared statement, using data from array for SQL parameters. It resolves with an array of rowids, or rejects with an error.

Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: A promise that resolves with the array of rowids for the rows that got inserted, or rejects with an error from the query.

ParamType
db*
sql*
arrayOfArrays*

JS API: low level database access~closeDatabase(database) ⇒

Returns a promise that will resolve when the database in question is closed. Rejects with an error if closing fails.

Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: A promise that resolves without an argument or rejects with error from the database closing.

ParamType
database*

JS API: low level database access~closeDatabaseSync(database)

Imediatelly closes the database.

Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)

ParamType
database*

JS API: low level database access~initRamDatabase() ⇒

Create in-memory database.

Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: Promise that resolve with the Db.

JS API: low level database access~initDatabase(sqlitePath) ⇒

Returns a promise to initialize a database.

Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: A promise that resolves with the database object that got created, or rejects with an error if something went wrong.

ParamType
sqlitePath*

JS API: low level database access~insertOrReplaceSetting(db, version) ⇒

Returns a promise to insert or replace a setting into the database.

Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: A promise that resolves with a rowid of created setting row or rejects with error if something goes wrong.

ParamType
db*
version*

JS API: low level database access~updateSetting(db, rows) ⇒

Updates SETTING table with values selected

Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: A promise that resolves with the SETTING table being repopulated

ParamType
db*
rows*

JS API: low level database access~selectSettings(db) ⇒

Returns a promise resolving the entire SETTING table

Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: A promise resolving the entire SETTING table

ParamType
db*

JS API: low level database access~loadSchema(db, schemaPath, zapVersion) ⇒

Returns a promise to load schema into a blank database, and inserts a version to the settings table.j

Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: A promise that resolves with the same db that got passed in, or rejects with an error.

ParamType
db*
schemaPath*
zapVersion*

JS API: low level database access~initDatabaseAndLoadSchema(sqliteFile, schemaFile, zapVersion) ⇒

Init database and load the schema.

Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: Promise that resolves into the database object.

ParamType
sqliteFile*
schemaFile*
zapVersion*

JS API: low level database access~toDbBool(value) ⇒

Returns the data that should be stored into the DB column, from the passed JS boolean.

Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: Value to be stored into the database.

ParamType
value*

JS API: low level database access~fromDbBool(value) ⇒

Returns a true or false JS boolean from the value that was read in the database.

Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: value to be used in JS after reading value from database.

ParamType
value*

JS API: low level database access~toInClause(value) ⇒

Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: Given value in the form of string

ParamType
value*

DB API: zcl database access

This module provides cache for commonly used static database queries.

  • [DB API: zcl database access](#moduleDB API zcl database access)
    • [~clear()](#moduleDB API zcl database access..clear)
    • [~put(key, packageId, data)](#moduleDB API zcl database access..put) ⇒
    • [~get(key, packageId)](#moduleDB API zcl database access..get) ⇒
    • [~isCached(key, packageId)](#moduleDB API zcl database access..isCached) ⇒
    • [~cacheQuery(key, packageId)](#moduleDB API zcl database access..cacheQuery) ⇒
    • [~cacheStats()](#moduleDB API zcl database access..cacheStats)
    • [~enable()](#moduleDB API zcl database access..enable)
    • [~disable()](#moduleDB API zcl database access..disable)
    • [~selectAtomicType(db, packageId, typeName)](#moduleDB API zcl database access..selectAtomicType)
    • [~selectAtomicById(db, packageId)](#moduleDB API zcl database access..selectAtomicById)
    • [~selectAllBitmaps(db)](#moduleDB API zcl database access..selectAllBitmaps) ⇒
    • [~selectBitmapByNameAndClusterId(db, name, clusterId, packageIds)](#moduleDB API zcl database access..selectBitmapByNameAndClusterId) ⇒
    • [~selectAllEnums(db, packageId)](#moduleDB API zcl database access..selectAllEnums) ⇒
    • [~selectClusterEnums(db, packageId, clusterId)](#moduleDB API zcl database access..selectClusterEnums) ⇒
    • [~selectAllEnumItemsById(db, id)](#moduleDB API zcl database access..selectAllEnumItemsById) ⇒
    • [~selectAllEnumItems(db, packageId)](#moduleDB API zcl database access..selectAllEnumItems) ⇒
    • [~selectEnumById(db, id)](#moduleDB API zcl database access..selectEnumById) ⇒
    • [~selectEnumByName(db, name, packageIds)](#moduleDB API zcl database access..selectEnumByName) ⇒
    • [~selectEnumByNameAndClusterId(db, name, clusterId, packageIds)](#moduleDB API zcl database access..selectEnumByNameAndClusterId) ⇒
    • [~selectSessionClusterByCode(db, sessionId)](#moduleDB API zcl database access..selectSessionClusterByCode) ⇒
    • [~selectAllSessionClusters(db, sessionId)](#moduleDB API zcl database access..selectAllSessionClusters) ⇒
    • [~selectSessionAttributeByCode(db, sessionId)](#moduleDB API zcl database access..selectSessionAttributeByCode) ⇒
    • [~selectSessionCommandByCode(db, sessionId)](#moduleDB API zcl database access..selectSessionCommandByCode) ⇒
    • [~selectStructByNameAndClusterId(db, name, clusterId, packageIds)](#moduleDB API zcl database access..selectStructByNameAndClusterId) ⇒
    • [~selectStructsWithClusterAssociation(db, packageIds, groupByStructName)](#moduleDB API zcl database access..selectStructsWithClusterAssociation) ⇒
    • [~selectClusterBitmaps(db, packageId, clusterId)](#moduleDB API zcl database access..selectClusterBitmaps) ⇒
    • [~selectAllDomains(db)](#moduleDB API zcl database access..selectAllDomains) ⇒
    • [~selectAllStructsWithItemCount(db, packageIds)](#moduleDB API zcl database access..selectAllStructsWithItemCount) ⇒
    • [~selectStructClusters(db, structId)](#moduleDB API zcl database access..selectStructClusters) ⇒
    • [~selectEnumClusters(db, enumId)](#moduleDB API zcl database access..selectEnumClusters) ⇒
    • [~selectBitmapClusters(db, enumId)](#moduleDB API zcl database access..selectBitmapClusters) ⇒
    • [~selectClusterStructsWithItems(db)](#moduleDB API zcl database access..selectClusterStructsWithItems) ⇒
    • [~selectAllStructsWithItems(db)](#moduleDB API zcl database access..selectAllStructsWithItems) ⇒
    • [~selectAllStructItemsByStructName(db, name)](#moduleDB API zcl database access..selectAllStructItemsByStructName) ⇒
    • [~selectAllClusters(db)](#moduleDB API zcl database access..selectAllClusters) ⇒
    • [~selectClusterByCode(db, packageId, clusterCode, mfgCode)](#moduleDB API zcl database access..selectClusterByCode) ⇒
    • [~selectClusterById(db, clusterId, packageId)](#moduleDB API zcl database access..selectClusterById) ⇒
    • [~selectAttributesByClusterIdIncludingGlobal(db, clusterId, packageIds)](#moduleDB API zcl database access..selectAttributesByClusterIdIncludingGlobal) ⇒
    • [~selectAttributesByClusterCodeAndManufacturerCode(db, packageId, clusterCode, manufacturerCode)](#moduleDB API zcl database access..selectAttributesByClusterCodeAndManufacturerCode) ⇒
    • [~selectAttributeByAttributeIdAndClusterRef(db, attributeId, clusterRef)](#moduleDB API zcl database access..selectAttributeByAttributeIdAndClusterRef)
    • [~selectAllAttributesBySide(db, side, packageId)](#moduleDB API zcl database access..selectAllAttributesBySide) ⇒

DB API: zcl database access~clear()

Clears the entire cache.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

DB API: zcl database access~put(key, packageId, data) ⇒

Puts a data object into the cache under a given key/packageId

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Returns true on success.

ParamType
key*
packageId*
data*

DB API: zcl database access~get(key, packageId) ⇒

Returns a data object under a given key/packageId.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cached object or undefined if none is present or expired.

ParamType
key*
packageId*

DB API: zcl database access~isCached(key, packageId) ⇒

Returns true if a given key/packageId cache exists.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: true or false, depending on whether the cache is present.

ParamType
key*
packageId*

DB API: zcl database access~cacheQuery(key, packageId) ⇒

Cache input / output of provided queryFunction The queryFunction is assumed to have the following signature:

async function queryFunction(db, ...) {...}

The DB handle is ignored and the remaining arguments are used as the cache key.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: true or false, depending on whether the cache is present.

ParamType
key*
packageId*

DB API: zcl database access~cacheStats()

Returns the cache statistics.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

DB API: zcl database access~enable()

Enable the Database Query cache

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

DB API: zcl database access~disable()

Disable the database cache

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

DB API: zcl database access~selectAtomicType(db, packageId, typeName)

Locates atomic type based on a type name. Query is not case sensitive.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

ParamType
db*
packageId*
typeName*

DB API: zcl database access~selectAtomicById(db, packageId)

Retrieves atomic type by a given Id.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

ParamType
db*
packageId*

DB API: zcl database access~selectAllBitmaps(db) ⇒

Retrieves all the bitmaps in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of bitmaps.

ParamType
db*

DB API: zcl database access~selectBitmapByNameAndClusterId(db, name, clusterId, packageIds) ⇒

Select a bitmap matched by name and clusterId.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: bitmap information or undefined

ParamType
db*
name*
clusterId*
packageIds*

DB API: zcl database access~selectAllEnums(db, packageId) ⇒

Retrieves all the enums in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of enums.

ParamType
db*
packageId*

DB API: zcl database access~selectClusterEnums(db, packageId, clusterId) ⇒

Retrieves all the enums with cluster references in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of enums.

ParamType
db*
packageId*
clusterId*

DB API: zcl database access~selectAllEnumItemsById(db, id) ⇒

Returns an enum by ID.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: enum

ParamType
db*
id*

DB API: zcl database access~selectAllEnumItems(db, packageId) ⇒

Select all enum items in a package.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: list of enum items

ParamType
db*
packageId*

DB API: zcl database access~selectEnumById(db, id) ⇒

Select an enum matched by its primary key.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: an enum or underfined if not found

ParamType
db*
id*

DB API: zcl database access~selectEnumByName(db, name, packageIds) ⇒

Select an enum matched by name.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: enum or undefined

ParamType
db*
name*
packageIds*

DB API: zcl database access~selectEnumByNameAndClusterId(db, name, clusterId, packageIds) ⇒

Select an enum matched by name and clusterId.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: enum information or undefined

ParamType
db*
name*
clusterId*
packageIds*

DB API: zcl database access~selectSessionClusterByCode(db, sessionId) ⇒

Returns the cluster available to this session by the code.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: all the cluster objects for a given session.

ParamType
db*
sessionId*

DB API: zcl database access~selectAllSessionClusters(db, sessionId) ⇒

Returns all the clusters visible for a given session.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: all the cluster objects for a given session.

ParamType
db*
sessionId*

DB API: zcl database access~selectSessionAttributeByCode(db, sessionId) ⇒

Returns the attribute available to this session by the code.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the session attribute

ParamType
db*
sessionId*

DB API: zcl database access~selectSessionCommandByCode(db, sessionId) ⇒

Returns the command available to this session by the code.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the session attribute

ParamType
db*
sessionId*

DB API: zcl database access~selectStructByNameAndClusterId(db, name, clusterId, packageIds) ⇒

Select a struct matched by name and clusterId

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: struct information or undefined

ParamType
db*
name*
clusterId*
packageIds*

DB API: zcl database access~selectStructsWithClusterAssociation(db, packageIds, groupByStructName) ⇒

Get all structs which have a cluster associated with them. If a struct is present in more than one cluster then it can be grouped by struct name to avoid additional rows.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: structs which have an association with clusters

ParamType
db*
packageIds*
groupByStructName*

DB API: zcl database access~selectClusterBitmaps(db, packageId, clusterId) ⇒

Retrieves all the bitmaps that are associated with a cluster.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cluster-related bitmaps

ParamType
db*
packageId*
clusterId*

DB API: zcl database access~selectAllDomains(db) ⇒

Retrieves all the domains in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of domains.

ParamType
db*

DB API: zcl database access~selectAllStructsWithItemCount(db, packageIds) ⇒

Retrieves all the structs in the database, including the count of items.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs.

ParamType
db*
packageIds*

DB API: zcl database access~selectStructClusters(db, structId) ⇒

Returns an array of clusters that struct belongs to.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters

ParamType
db*
structId*

DB API: zcl database access~selectEnumClusters(db, enumId) ⇒

Returns an array of clusters that enum belongs to.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters

ParamType
db*
enumId*

DB API: zcl database access~selectBitmapClusters(db, enumId) ⇒

Returns an array of clusters that enum belongs to.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters

ParamType
db*
enumId*

DB API: zcl database access~selectClusterStructsWithItems(db) ⇒

Retrieves all the cluster-related structs in the database with the items.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.

ParamType
db*

DB API: zcl database access~selectAllStructsWithItems(db) ⇒

Retrieves all the structs in the database with the items.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.

ParamType
db*

DB API: zcl database access~selectAllStructItemsByStructName(db, name) ⇒

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the details of the struct items given the name of the struct

Param
db
name

DB API: zcl database access~selectAllClusters(db) ⇒

Retrieves all the clusters in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of clusters.

ParamType
db*

DB API: zcl database access~selectClusterByCode(db, packageId, clusterCode, mfgCode) ⇒

Finds cluster by code.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cluster by code in a single package id.

ParamTypeDefaultDescription
db*
packageId*Single packageId or an array of them.
clusterCode*
mfgCode*

DB API: zcl database access~selectClusterById(db, clusterId, packageId) ⇒

Returns a promise that resolves into a cluster.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into a cluster object

ParamType
db*
clusterId*
packageId*

DB API: zcl database access~selectAttributesByClusterIdIncludingGlobal(db, clusterId, packageIds) ⇒

Returns attributes for a given cluster. IMPORTANT: packageIds are needed to properly deal with the global attributes.

This method will NOT only return the attributes that link to a given cluster, but will ALSO return the attributes that have empty clusterRef (which are global attributes), and the check in that case will be made via packageId.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise of a list of attributes, including global attributes

ParamType
db*
clusterId*
packageIds*

DB API: zcl database access~selectAttributesByClusterCodeAndManufacturerCode(db, packageId, clusterCode, manufacturerCode) ⇒

Queries for attributes inside a cluster.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into attributes.

ParamType
db*
packageId*
clusterCode*
manufacturerCode*

DB API: zcl database access~selectAttributeByAttributeIdAndClusterRef(db, attributeId, clusterRef)

This async function should be used when you want to get attributes, while also resolving against any global data that may be overridden by a particular cluster.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

ParamType
db*
attributeId*
clusterRef*

DB API: zcl database access~selectAllAttributesBySide(db, side, packageId) ⇒

Query for attributes by side.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into attributes.

ParamType
db*
side*
packageId*

DB API: DB mappings between columns and JS object keys.

This module provides mappings between database columns and JS keys.

DB API: access queries.

This module provides queries related to access.

DB API: zcl database access

This module provides queries for atomic type queries.

  • [DB API: zcl database access](#moduleDB API zcl database access)
    • [~clear()](#moduleDB API zcl database access..clear)
    • [~put(key, packageId, data)](#moduleDB API zcl database access..put) ⇒
    • [~get(key, packageId)](#moduleDB API zcl database access..get) ⇒
    • [~isCached(key, packageId)](#moduleDB API zcl database access..isCached) ⇒
    • [~cacheQuery(key, packageId)](#moduleDB API zcl database access..cacheQuery) ⇒
    • [~cacheStats()](#moduleDB API zcl database access..cacheStats)
    • [~enable()](#moduleDB API zcl database access..enable)
    • [~disable()](#moduleDB API zcl database access..disable)
    • [~selectAtomicType(db, packageId, typeName)](#moduleDB API zcl database access..selectAtomicType)
    • [~selectAtomicById(db, packageId)](#moduleDB API zcl database access..selectAtomicById)
    • [~selectAllBitmaps(db)](#moduleDB API zcl database access..selectAllBitmaps) ⇒
    • [~selectBitmapByNameAndClusterId(db, name, clusterId, packageIds)](#moduleDB API zcl database access..selectBitmapByNameAndClusterId) ⇒
    • [~selectAllEnums(db, packageId)](#moduleDB API zcl database access..selectAllEnums) ⇒
    • [~selectClusterEnums(db, packageId, clusterId)](#moduleDB API zcl database access..selectClusterEnums) ⇒
    • [~selectAllEnumItemsById(db, id)](#moduleDB API zcl database access..selectAllEnumItemsById) ⇒
    • [~selectAllEnumItems(db, packageId)](#moduleDB API zcl database access..selectAllEnumItems) ⇒
    • [~selectEnumById(db, id)](#moduleDB API zcl database access..selectEnumById) ⇒
    • [~selectEnumByName(db, name, packageIds)](#moduleDB API zcl database access..selectEnumByName) ⇒
    • [~selectEnumByNameAndClusterId(db, name, clusterId, packageIds)](#moduleDB API zcl database access..selectEnumByNameAndClusterId) ⇒
    • [~selectSessionClusterByCode(db, sessionId)](#moduleDB API zcl database access..selectSessionClusterByCode) ⇒
    • [~selectAllSessionClusters(db, sessionId)](#moduleDB API zcl database access..selectAllSessionClusters) ⇒
    • [~selectSessionAttributeByCode(db, sessionId)](#moduleDB API zcl database access..selectSessionAttributeByCode) ⇒
    • [~selectSessionCommandByCode(db, sessionId)](#moduleDB API zcl database access..selectSessionCommandByCode) ⇒
    • [~selectStructByNameAndClusterId(db, name, clusterId, packageIds)](#moduleDB API zcl database access..selectStructByNameAndClusterId) ⇒
    • [~selectStructsWithClusterAssociation(db, packageIds, groupByStructName)](#moduleDB API zcl database access..selectStructsWithClusterAssociation) ⇒
    • [~selectClusterBitmaps(db, packageId, clusterId)](#moduleDB API zcl database access..selectClusterBitmaps) ⇒
    • [~selectAllDomains(db)](#moduleDB API zcl database access..selectAllDomains) ⇒
    • [~selectAllStructsWithItemCount(db, packageIds)](#moduleDB API zcl database access..selectAllStructsWithItemCount) ⇒
    • [~selectStructClusters(db, structId)](#moduleDB API zcl database access..selectStructClusters) ⇒
    • [~selectEnumClusters(db, enumId)](#moduleDB API zcl database access..selectEnumClusters) ⇒
    • [~selectBitmapClusters(db, enumId)](#moduleDB API zcl database access..selectBitmapClusters) ⇒
    • [~selectClusterStructsWithItems(db)](#moduleDB API zcl database access..selectClusterStructsWithItems) ⇒
    • [~selectAllStructsWithItems(db)](#moduleDB API zcl database access..selectAllStructsWithItems) ⇒
    • [~selectAllStructItemsByStructName(db, name)](#moduleDB API zcl database access..selectAllStructItemsByStructName) ⇒
    • [~selectAllClusters(db)](#moduleDB API zcl database access..selectAllClusters) ⇒
    • [~selectClusterByCode(db, packageId, clusterCode, mfgCode)](#moduleDB API zcl database access..selectClusterByCode) ⇒
    • [~selectClusterById(db, clusterId, packageId)](#moduleDB API zcl database access..selectClusterById) ⇒
    • [~selectAttributesByClusterIdIncludingGlobal(db, clusterId, packageIds)](#moduleDB API zcl database access..selectAttributesByClusterIdIncludingGlobal) ⇒
    • [~selectAttributesByClusterCodeAndManufacturerCode(db, packageId, clusterCode, manufacturerCode)](#moduleDB API zcl database access..selectAttributesByClusterCodeAndManufacturerCode) ⇒
    • [~selectAttributeByAttributeIdAndClusterRef(db, attributeId, clusterRef)](#moduleDB API zcl database access..selectAttributeByAttributeIdAndClusterRef)
    • [~selectAllAttributesBySide(db, side, packageId)](#moduleDB API zcl database access..selectAllAttributesBySide) ⇒

DB API: zcl database access~clear()

Clears the entire cache.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

DB API: zcl database access~put(key, packageId, data) ⇒

Puts a data object into the cache under a given key/packageId

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Returns true on success.

ParamType
key*
packageId*
data*

DB API: zcl database access~get(key, packageId) ⇒

Returns a data object under a given key/packageId.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cached object or undefined if none is present or expired.

ParamType
key*
packageId*

DB API: zcl database access~isCached(key, packageId) ⇒

Returns true if a given key/packageId cache exists.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: true or false, depending on whether the cache is present.

ParamType
key*
packageId*

DB API: zcl database access~cacheQuery(key, packageId) ⇒

Cache input / output of provided queryFunction The queryFunction is assumed to have the following signature:

async function queryFunction(db, ...) {...}

The DB handle is ignored and the remaining arguments are used as the cache key.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: true or false, depending on whether the cache is present.

ParamType
key*
packageId*

DB API: zcl database access~cacheStats()

Returns the cache statistics.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

DB API: zcl database access~enable()

Enable the Database Query cache

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

DB API: zcl database access~disable()

Disable the database cache

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

DB API: zcl database access~selectAtomicType(db, packageId, typeName)

Locates atomic type based on a type name. Query is not case sensitive.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

ParamType
db*
packageId*
typeName*

DB API: zcl database access~selectAtomicById(db, packageId)

Retrieves atomic type by a given Id.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

ParamType
db*
packageId*

DB API: zcl database access~selectAllBitmaps(db) ⇒

Retrieves all the bitmaps in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of bitmaps.

ParamType
db*

DB API: zcl database access~selectBitmapByNameAndClusterId(db, name, clusterId, packageIds) ⇒

Select a bitmap matched by name and clusterId.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: bitmap information or undefined

ParamType
db*
name*
clusterId*
packageIds*

DB API: zcl database access~selectAllEnums(db, packageId) ⇒

Retrieves all the enums in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of enums.

ParamType
db*
packageId*

DB API: zcl database access~selectClusterEnums(db, packageId, clusterId) ⇒

Retrieves all the enums with cluster references in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of enums.

ParamType
db*
packageId*
clusterId*

DB API: zcl database access~selectAllEnumItemsById(db, id) ⇒

Returns an enum by ID.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: enum

ParamType
db*
id*

DB API: zcl database access~selectAllEnumItems(db, packageId) ⇒

Select all enum items in a package.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: list of enum items

ParamType
db*
packageId*

DB API: zcl database access~selectEnumById(db, id) ⇒

Select an enum matched by its primary key.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: an enum or underfined if not found

ParamType
db*
id*

DB API: zcl database access~selectEnumByName(db, name, packageIds) ⇒

Select an enum matched by name.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: enum or undefined

ParamType
db*
name*
packageIds*

DB API: zcl database access~selectEnumByNameAndClusterId(db, name, clusterId, packageIds) ⇒

Select an enum matched by name and clusterId.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: enum information or undefined

ParamType
db*
name*
clusterId*
packageIds*

DB API: zcl database access~selectSessionClusterByCode(db, sessionId) ⇒

Returns the cluster available to this session by the code.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: all the cluster objects for a given session.

ParamType
db*
sessionId*

DB API: zcl database access~selectAllSessionClusters(db, sessionId) ⇒

Returns all the clusters visible for a given session.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: all the cluster objects for a given session.

ParamType
db*
sessionId*

DB API: zcl database access~selectSessionAttributeByCode(db, sessionId) ⇒

Returns the attribute available to this session by the code.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the session attribute

ParamType
db*
sessionId*

DB API: zcl database access~selectSessionCommandByCode(db, sessionId) ⇒

Returns the command available to this session by the code.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the session attribute

ParamType
db*
sessionId*

DB API: zcl database access~selectStructByNameAndClusterId(db, name, clusterId, packageIds) ⇒

Select a struct matched by name and clusterId

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: struct information or undefined

ParamType
db*
name*
clusterId*
packageIds*

DB API: zcl database access~selectStructsWithClusterAssociation(db, packageIds, groupByStructName) ⇒

Get all structs which have a cluster associated with them. If a struct is present in more than one cluster then it can be grouped by struct name to avoid additional rows.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: structs which have an association with clusters

ParamType
db*
packageIds*
groupByStructName*

DB API: zcl database access~selectClusterBitmaps(db, packageId, clusterId) ⇒

Retrieves all the bitmaps that are associated with a cluster.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cluster-related bitmaps

ParamType
db*
packageId*
clusterId*

DB API: zcl database access~selectAllDomains(db) ⇒

Retrieves all the domains in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of domains.

ParamType
db*

DB API: zcl database access~selectAllStructsWithItemCount(db, packageIds) ⇒

Retrieves all the structs in the database, including the count of items.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs.

ParamType
db*
packageIds*

DB API: zcl database access~selectStructClusters(db, structId) ⇒

Returns an array of clusters that struct belongs to.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters

ParamType
db*
structId*

DB API: zcl database access~selectEnumClusters(db, enumId) ⇒

Returns an array of clusters that enum belongs to.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters

ParamType
db*
enumId*

DB API: zcl database access~selectBitmapClusters(db, enumId) ⇒

Returns an array of clusters that enum belongs to.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters

ParamType
db*
enumId*

DB API: zcl database access~selectClusterStructsWithItems(db) ⇒

Retrieves all the cluster-related structs in the database with the items.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.

ParamType
db*

DB API: zcl database access~selectAllStructsWithItems(db) ⇒

Retrieves all the structs in the database with the items.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.

ParamType
db*

DB API: zcl database access~selectAllStructItemsByStructName(db, name) ⇒

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the details of the struct items given the name of the struct

Param
db
name

DB API: zcl database access~selectAllClusters(db) ⇒

Retrieves all the clusters in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of clusters.

ParamType
db*

DB API: zcl database access~selectClusterByCode(db, packageId, clusterCode, mfgCode) ⇒

Finds cluster by code.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cluster by code in a single package id.

ParamTypeDefaultDescription
db*
packageId*Single packageId or an array of them.
clusterCode*
mfgCode*

DB API: zcl database access~selectClusterById(db, clusterId, packageId) ⇒

Returns a promise that resolves into a cluster.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into a cluster object

ParamType
db*
clusterId*
packageId*

DB API: zcl database access~selectAttributesByClusterIdIncludingGlobal(db, clusterId, packageIds) ⇒

Returns attributes for a given cluster. IMPORTANT: packageIds are needed to properly deal with the global attributes.

This method will NOT only return the attributes that link to a given cluster, but will ALSO return the attributes that have empty clusterRef (which are global attributes), and the check in that case will be made via packageId.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise of a list of attributes, including global attributes

ParamType
db*
clusterId*
packageIds*

DB API: zcl database access~selectAttributesByClusterCodeAndManufacturerCode(db, packageId, clusterCode, manufacturerCode) ⇒

Queries for attributes inside a cluster.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into attributes.

ParamType
db*
packageId*
clusterCode*
manufacturerCode*

DB API: zcl database access~selectAttributeByAttributeIdAndClusterRef(db, attributeId, clusterRef)

This async function should be used when you want to get attributes, while also resolving against any global data that may be overridden by a particular cluster.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

ParamType
db*
attributeId*
clusterRef*

DB API: zcl database access~selectAllAttributesBySide(db, side, packageId) ⇒

Query for attributes by side.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into attributes.

ParamType
db*
side*
packageId*

DB API: attribute queries.

This module provides queries related to attributes.

DB API: zcl database access

This module provides queries for enums.

  • [DB API: zcl database access](#moduleDB API zcl database access)
    • [~clear()](#moduleDB API zcl database access..clear)
    • [~put(key, packageId, data)](#moduleDB API zcl database access..put) ⇒
    • [~get(key, packageId)](#moduleDB API zcl database access..get) ⇒
    • [~isCached(key, packageId)](#moduleDB API zcl database access..isCached) ⇒
    • [~cacheQuery(key, packageId)](#moduleDB API zcl database access..cacheQuery) ⇒
    • [~cacheStats()](#moduleDB API zcl database access..cacheStats)
    • [~enable()](#moduleDB API zcl database access..enable)
    • [~disable()](#moduleDB API zcl database access..disable)
    • [~selectAtomicType(db, packageId, typeName)](#moduleDB API zcl database access..selectAtomicType)
    • [~selectAtomicById(db, packageId)](#moduleDB API zcl database access..selectAtomicById)
    • [~selectAllBitmaps(db)](#moduleDB API zcl database access..selectAllBitmaps) ⇒
    • [~selectBitmapByNameAndClusterId(db, name, clusterId, packageIds)](#moduleDB API zcl database access..selectBitmapByNameAndClusterId) ⇒
    • [~selectAllEnums(db, packageId)](#moduleDB API zcl database access..selectAllEnums) ⇒
    • [~selectClusterEnums(db, packageId, clusterId)](#moduleDB API zcl database access..selectClusterEnums) ⇒
    • [~selectAllEnumItemsById(db, id)](#moduleDB API zcl database access..selectAllEnumItemsById) ⇒
    • [~selectAllEnumItems(db, packageId)](#moduleDB API zcl database access..selectAllEnumItems) ⇒
    • [~selectEnumById(db, id)](#moduleDB API zcl database access..selectEnumById) ⇒
    • [~selectEnumByName(db, name, packageIds)](#moduleDB API zcl database access..selectEnumByName) ⇒
    • [~selectEnumByNameAndClusterId(db, name, clusterId, packageIds)](#moduleDB API zcl database access..selectEnumByNameAndClusterId) ⇒
    • [~selectSessionClusterByCode(db, sessionId)](#moduleDB API zcl database access..selectSessionClusterByCode) ⇒
    • [~selectAllSessionClusters(db, sessionId)](#moduleDB API zcl database access..selectAllSessionClusters) ⇒
    • [~selectSessionAttributeByCode(db, sessionId)](#moduleDB API zcl database access..selectSessionAttributeByCode) ⇒
    • [~selectSessionCommandByCode(db, sessionId)](#moduleDB API zcl database access..selectSessionCommandByCode) ⇒
    • [~selectStructByNameAndClusterId(db, name, clusterId, packageIds)](#moduleDB API zcl database access..selectStructByNameAndClusterId) ⇒
    • [~selectStructsWithClusterAssociation(db, packageIds, groupByStructName)](#moduleDB API zcl database access..selectStructsWithClusterAssociation) ⇒
    • [~selectClusterBitmaps(db, packageId, clusterId)](#moduleDB API zcl database access..selectClusterBitmaps) ⇒
    • [~selectAllDomains(db)](#moduleDB API zcl database access..selectAllDomains) ⇒
    • [~selectAllStructsWithItemCount(db, packageIds)](#moduleDB API zcl database access..selectAllStructsWithItemCount) ⇒
    • [~selectStructClusters(db, structId)](#moduleDB API zcl database access..selectStructClusters) ⇒
    • [~selectEnumClusters(db, enumId)](#moduleDB API zcl database access..selectEnumClusters) ⇒
    • [~selectBitmapClusters(db, enumId)](#moduleDB API zcl database access..selectBitmapClusters) ⇒
    • [~selectClusterStructsWithItems(db)](#moduleDB API zcl database access..selectClusterStructsWithItems) ⇒
    • [~selectAllStructsWithItems(db)](#moduleDB API zcl database access..selectAllStructsWithItems) ⇒
    • [~selectAllStructItemsByStructName(db, name)](#moduleDB API zcl database access..selectAllStructItemsByStructName) ⇒
    • [~selectAllClusters(db)](#moduleDB API zcl database access..selectAllClusters) ⇒
    • [~selectClusterByCode(db, packageId, clusterCode, mfgCode)](#moduleDB API zcl database access..selectClusterByCode) ⇒
    • [~selectClusterById(db, clusterId, packageId)](#moduleDB API zcl database access..selectClusterById) ⇒
    • [~selectAttributesByClusterIdIncludingGlobal(db, clusterId, packageIds)](#moduleDB API zcl database access..selectAttributesByClusterIdIncludingGlobal) ⇒
    • [~selectAttributesByClusterCodeAndManufacturerCode(db, packageId, clusterCode, manufacturerCode)](#moduleDB API zcl database access..selectAttributesByClusterCodeAndManufacturerCode) ⇒
    • [~selectAttributeByAttributeIdAndClusterRef(db, attributeId, clusterRef)](#moduleDB API zcl database access..selectAttributeByAttributeIdAndClusterRef)
    • [~selectAllAttributesBySide(db, side, packageId)](#moduleDB API zcl database access..selectAllAttributesBySide) ⇒

DB API: zcl database access~clear()

Clears the entire cache.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

DB API: zcl database access~put(key, packageId, data) ⇒

Puts a data object into the cache under a given key/packageId

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Returns true on success.

ParamType
key*
packageId*
data*

DB API: zcl database access~get(key, packageId) ⇒

Returns a data object under a given key/packageId.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cached object or undefined if none is present or expired.

ParamType
key*
packageId*

DB API: zcl database access~isCached(key, packageId) ⇒

Returns true if a given key/packageId cache exists.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: true or false, depending on whether the cache is present.

ParamType
key*
packageId*

DB API: zcl database access~cacheQuery(key, packageId) ⇒

Cache input / output of provided queryFunction The queryFunction is assumed to have the following signature:

async function queryFunction(db, ...) {...}

The DB handle is ignored and the remaining arguments are used as the cache key.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: true or false, depending on whether the cache is present.

ParamType
key*
packageId*

DB API: zcl database access~cacheStats()

Returns the cache statistics.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

DB API: zcl database access~enable()

Enable the Database Query cache

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

DB API: zcl database access~disable()

Disable the database cache

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

DB API: zcl database access~selectAtomicType(db, packageId, typeName)

Locates atomic type based on a type name. Query is not case sensitive.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

ParamType
db*
packageId*
typeName*

DB API: zcl database access~selectAtomicById(db, packageId)

Retrieves atomic type by a given Id.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

ParamType
db*
packageId*

DB API: zcl database access~selectAllBitmaps(db) ⇒

Retrieves all the bitmaps in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of bitmaps.

ParamType
db*

DB API: zcl database access~selectBitmapByNameAndClusterId(db, name, clusterId, packageIds) ⇒

Select a bitmap matched by name and clusterId.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: bitmap information or undefined

ParamType
db*
name*
clusterId*
packageIds*

DB API: zcl database access~selectAllEnums(db, packageId) ⇒

Retrieves all the enums in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of enums.

ParamType
db*
packageId*

DB API: zcl database access~selectClusterEnums(db, packageId, clusterId) ⇒

Retrieves all the enums with cluster references in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of enums.

ParamType
db*
packageId*
clusterId*

DB API: zcl database access~selectAllEnumItemsById(db, id) ⇒

Returns an enum by ID.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: enum

ParamType
db*
id*

DB API: zcl database access~selectAllEnumItems(db, packageId) ⇒

Select all enum items in a package.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: list of enum items

ParamType
db*
packageId*

DB API: zcl database access~selectEnumById(db, id) ⇒

Select an enum matched by its primary key.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: an enum or underfined if not found

ParamType
db*
id*

DB API: zcl database access~selectEnumByName(db, name, packageIds) ⇒

Select an enum matched by name.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: enum or undefined

ParamType
db*
name*
packageIds*

DB API: zcl database access~selectEnumByNameAndClusterId(db, name, clusterId, packageIds) ⇒

Select an enum matched by name and clusterId.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: enum information or undefined

ParamType
db*
name*
clusterId*
packageIds*

DB API: zcl database access~selectSessionClusterByCode(db, sessionId) ⇒

Returns the cluster available to this session by the code.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: all the cluster objects for a given session.

ParamType
db*
sessionId*

DB API: zcl database access~selectAllSessionClusters(db, sessionId) ⇒

Returns all the clusters visible for a given session.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: all the cluster objects for a given session.

ParamType
db*
sessionId*

DB API: zcl database access~selectSessionAttributeByCode(db, sessionId) ⇒

Returns the attribute available to this session by the code.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the session attribute

ParamType
db*
sessionId*

DB API: zcl database access~selectSessionCommandByCode(db, sessionId) ⇒

Returns the command available to this session by the code.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the session attribute

ParamType
db*
sessionId*

DB API: zcl database access~selectStructByNameAndClusterId(db, name, clusterId, packageIds) ⇒

Select a struct matched by name and clusterId

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: struct information or undefined

ParamType
db*
name*
clusterId*
packageIds*

DB API: zcl database access~selectStructsWithClusterAssociation(db, packageIds, groupByStructName) ⇒

Get all structs which have a cluster associated with them. If a struct is present in more than one cluster then it can be grouped by struct name to avoid additional rows.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: structs which have an association with clusters

ParamType
db*
packageIds*
groupByStructName*

DB API: zcl database access~selectClusterBitmaps(db, packageId, clusterId) ⇒

Retrieves all the bitmaps that are associated with a cluster.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cluster-related bitmaps

ParamType
db*
packageId*
clusterId*

DB API: zcl database access~selectAllDomains(db) ⇒

Retrieves all the domains in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of domains.

ParamType
db*

DB API: zcl database access~selectAllStructsWithItemCount(db, packageIds) ⇒

Retrieves all the structs in the database, including the count of items.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs.

ParamType
db*
packageIds*

DB API: zcl database access~selectStructClusters(db, structId) ⇒

Returns an array of clusters that struct belongs to.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters

ParamType
db*
structId*

DB API: zcl database access~selectEnumClusters(db, enumId) ⇒

Returns an array of clusters that enum belongs to.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters

ParamType
db*
enumId*

DB API: zcl database access~selectBitmapClusters(db, enumId) ⇒

Returns an array of clusters that enum belongs to.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters

ParamType
db*
enumId*

DB API: zcl database access~selectClusterStructsWithItems(db) ⇒

Retrieves all the cluster-related structs in the database with the items.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.

ParamType
db*

DB API: zcl database access~selectAllStructsWithItems(db) ⇒

Retrieves all the structs in the database with the items.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.

ParamType
db*

DB API: zcl database access~selectAllStructItemsByStructName(db, name) ⇒

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the details of the struct items given the name of the struct

Param
db
name

DB API: zcl database access~selectAllClusters(db) ⇒

Retrieves all the clusters in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of clusters.

ParamType
db*

DB API: zcl database access~selectClusterByCode(db, packageId, clusterCode, mfgCode) ⇒

Finds cluster by code.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cluster by code in a single package id.

ParamTypeDefaultDescription
db*
packageId*Single packageId or an array of them.
clusterCode*
mfgCode*

DB API: zcl database access~selectClusterById(db, clusterId, packageId) ⇒

Returns a promise that resolves into a cluster.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into a cluster object

ParamType
db*
clusterId*
packageId*

DB API: zcl database access~selectAttributesByClusterIdIncludingGlobal(db, clusterId, packageIds) ⇒

Returns attributes for a given cluster. IMPORTANT: packageIds are needed to properly deal with the global attributes.

This method will NOT only return the attributes that link to a given cluster, but will ALSO return the attributes that have empty clusterRef (which are global attributes), and the check in that case will be made via packageId.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise of a list of attributes, including global attributes

ParamType
db*
clusterId*
packageIds*

DB API: zcl database access~selectAttributesByClusterCodeAndManufacturerCode(db, packageId, clusterCode, manufacturerCode) ⇒

Queries for attributes inside a cluster.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into attributes.

ParamType
db*
packageId*
clusterCode*
manufacturerCode*

DB API: zcl database access~selectAttributeByAttributeIdAndClusterRef(db, attributeId, clusterRef)

This async function should be used when you want to get attributes, while also resolving against any global data that may be overridden by a particular cluster.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

ParamType
db*
attributeId*
clusterRef*

DB API: zcl database access~selectAllAttributesBySide(db, side, packageId) ⇒

Query for attributes by side.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into attributes.

ParamType
db*
side*
packageId*

DB API: cluster queries.

This module provides queries related to cluster.

DB API: command queries.

This module provides queries related to commands.

DB API: user configuration queries against the database.

This module provides queries for user configuration.

DB API: device type database access

This module provides queries for device types.

  • [DB API: device type database access](#moduleDB API device type database access)
    • [~selectAllDeviceTypes(db)](#moduleDB API device type database access..selectAllDeviceTypes) ⇒
    • [~selectDeviceTypeById(db, id)](#moduleDB API device type database access..selectDeviceTypeById) ⇒
    • [~selectDeviceTypeByCodeAndName(db, packageId, code, name)](#moduleDB API device type database access..selectDeviceTypeByCodeAndName) ⇒
    • [~updateClusterReferencesForDeviceTypeClusters(db)](#moduleDB API device type database access..updateClusterReferencesForDeviceTypeClusters) ⇒
    • [~updateAttributeReferencesForDeviceTypeReferences(db)](#moduleDB API device type database access..updateAttributeReferencesForDeviceTypeReferences) ⇒
    • [~updateCommandReferencesForDeviceTypeReferences(db)](#moduleDB API device type database access..updateCommandReferencesForDeviceTypeReferences) ⇒
    • [~updateDeviceTypeEntityReferences(db)](#moduleDB API device type database access..updateDeviceTypeEntityReferences) ⇒

DB API: device type database access~selectAllDeviceTypes(db) ⇒

Retrieves all the device types in the database.

Kind: inner method of [DB API: device type database access](#moduleDB API device type database access)
Returns: Promise that resolves with the rows of device types.

ParamType
db*

DB API: device type database access~selectDeviceTypeById(db, id) ⇒

Retrieves the device type by its id.

Kind: inner method of [DB API: device type database access](#moduleDB API device type database access)
Returns: Device type

ParamType
db*
id*

DB API: device type database access~selectDeviceTypeByCodeAndName(db, packageId, code, name) ⇒

Retrieves the device type by the package, code and name.

Kind: inner method of [DB API: device type database access](#moduleDB API device type database access)
Returns: Device type

ParamType
db*
packageId*
code*
name*

DB API: device type database access~updateClusterReferencesForDeviceTypeClusters(db) ⇒

After loading up device type cluster table with the names, this method links the refererence to actual cluster reference.

Kind: inner method of [DB API: device type database access](#moduleDB API device type database access)
Returns: promise of completion

ParamType
db*

DB API: device type database access~updateAttributeReferencesForDeviceTypeReferences(db) ⇒

After loading up device type attribute table with the names, this method links the refererence to actual attribute reference.

Kind: inner method of [DB API: device type database access](#moduleDB API device type database access)
Returns: promise of completion

ParamType
db*

DB API: device type database access~updateCommandReferencesForDeviceTypeReferences(db) ⇒

After loading up device type command table with the names, this method links the refererence to actual command reference.

Kind: inner method of [DB API: device type database access](#moduleDB API device type database access)
Returns: promise of completion

ParamType
db*

DB API: device type database access~updateDeviceTypeEntityReferences(db) ⇒

This method returns the promise of linking the device type clusters commands and attributes to the correct IDs in the cluster, attribute and command tables.

Initial load only populates the names, so once everything is loaded, we have to link the foreign keys.

Kind: inner method of [DB API: device type database access](#moduleDB API device type database access)
Returns: promise of completed linking

ParamType
db*

DB API: endpoint type queries against the database.

This module provides queries for endpoint type.

DB API: endpoint configuration queries against the database.

This module provides queries for endpoint configuration.

DB API: zcl database access

This module provides queries for enums.

  • [DB API: zcl database access](#moduleDB API zcl database access)
    • [~clear()](#moduleDB API zcl database access..clear)
    • [~put(key, packageId, data)](#moduleDB API zcl database access..put) ⇒
    • [~get(key, packageId)](#moduleDB API zcl database access..get) ⇒
    • [~isCached(key, packageId)](#moduleDB API zcl database access..isCached) ⇒
    • [~cacheQuery(key, packageId)](#moduleDB API zcl database access..cacheQuery) ⇒
    • [~cacheStats()](#moduleDB API zcl database access..cacheStats)
    • [~enable()](#moduleDB API zcl database access..enable)
    • [~disable()](#moduleDB API zcl database access..disable)
    • [~selectAtomicType(db, packageId, typeName)](#moduleDB API zcl database access..selectAtomicType)
    • [~selectAtomicById(db, packageId)](#moduleDB API zcl database access..selectAtomicById)
    • [~selectAllBitmaps(db)](#moduleDB API zcl database access..selectAllBitmaps) ⇒
    • [~selectBitmapByNameAndClusterId(db, name, clusterId, packageIds)](#moduleDB API zcl database access..selectBitmapByNameAndClusterId) ⇒
    • [~selectAllEnums(db, packageId)](#moduleDB API zcl database access..selectAllEnums) ⇒
    • [~selectClusterEnums(db, packageId, clusterId)](#moduleDB API zcl database access..selectClusterEnums) ⇒
    • [~selectAllEnumItemsById(db, id)](#moduleDB API zcl database access..selectAllEnumItemsById) ⇒
    • [~selectAllEnumItems(db, packageId)](#moduleDB API zcl database access..selectAllEnumItems) ⇒
    • [~selectEnumById(db, id)](#moduleDB API zcl database access..selectEnumById) ⇒
    • [~selectEnumByName(db, name, packageIds)](#moduleDB API zcl database access..selectEnumByName) ⇒
    • [~selectEnumByNameAndClusterId(db, name, clusterId, packageIds)](#moduleDB API zcl database access..selectEnumByNameAndClusterId) ⇒
    • [~selectSessionClusterByCode(db, sessionId)](#moduleDB API zcl database access..selectSessionClusterByCode) ⇒
    • [~selectAllSessionClusters(db, sessionId)](#moduleDB API zcl database access..selectAllSessionClusters) ⇒
    • [~selectSessionAttributeByCode(db, sessionId)](#moduleDB API zcl database access..selectSessionAttributeByCode) ⇒
    • [~selectSessionCommandByCode(db, sessionId)](#moduleDB API zcl database access..selectSessionCommandByCode) ⇒
    • [~selectStructByNameAndClusterId(db, name, clusterId, packageIds)](#moduleDB API zcl database access..selectStructByNameAndClusterId) ⇒
    • [~selectStructsWithClusterAssociation(db, packageIds, groupByStructName)](#moduleDB API zcl database access..selectStructsWithClusterAssociation) ⇒
    • [~selectClusterBitmaps(db, packageId, clusterId)](#moduleDB API zcl database access..selectClusterBitmaps) ⇒
    • [~selectAllDomains(db)](#moduleDB API zcl database access..selectAllDomains) ⇒
    • [~selectAllStructsWithItemCount(db, packageIds)](#moduleDB API zcl database access..selectAllStructsWithItemCount) ⇒
    • [~selectStructClusters(db, structId)](#moduleDB API zcl database access..selectStructClusters) ⇒
    • [~selectEnumClusters(db, enumId)](#moduleDB API zcl database access..selectEnumClusters) ⇒
    • [~selectBitmapClusters(db, enumId)](#moduleDB API zcl database access..selectBitmapClusters) ⇒
    • [~selectClusterStructsWithItems(db)](#moduleDB API zcl database access..selectClusterStructsWithItems) ⇒
    • [~selectAllStructsWithItems(db)](#moduleDB API zcl database access..selectAllStructsWithItems) ⇒
    • [~selectAllStructItemsByStructName(db, name)](#moduleDB API zcl database access..selectAllStructItemsByStructName) ⇒
    • [~selectAllClusters(db)](#moduleDB API zcl database access..selectAllClusters) ⇒
    • [~selectClusterByCode(db, packageId, clusterCode, mfgCode)](#moduleDB API zcl database access..selectClusterByCode) ⇒
    • [~selectClusterById(db, clusterId, packageId)](#moduleDB API zcl database access..selectClusterById) ⇒
    • [~selectAttributesByClusterIdIncludingGlobal(db, clusterId, packageIds)](#moduleDB API zcl database access..selectAttributesByClusterIdIncludingGlobal) ⇒
    • [~selectAttributesByClusterCodeAndManufacturerCode(db, packageId, clusterCode, manufacturerCode)](#moduleDB API zcl database access..selectAttributesByClusterCodeAndManufacturerCode) ⇒
    • [~selectAttributeByAttributeIdAndClusterRef(db, attributeId, clusterRef)](#moduleDB API zcl database access..selectAttributeByAttributeIdAndClusterRef)
    • [~selectAllAttributesBySide(db, side, packageId)](#moduleDB API zcl database access..selectAllAttributesBySide) ⇒

DB API: zcl database access~clear()

Clears the entire cache.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

DB API: zcl database access~put(key, packageId, data) ⇒

Puts a data object into the cache under a given key/packageId

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Returns true on success.

ParamType
key*
packageId*
data*

DB API: zcl database access~get(key, packageId) ⇒

Returns a data object under a given key/packageId.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cached object or undefined if none is present or expired.

ParamType
key*
packageId*

DB API: zcl database access~isCached(key, packageId) ⇒

Returns true if a given key/packageId cache exists.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: true or false, depending on whether the cache is present.

ParamType
key*
packageId*

DB API: zcl database access~cacheQuery(key, packageId) ⇒

Cache input / output of provided queryFunction The queryFunction is assumed to have the following signature:

async function queryFunction(db, ...) {...}

The DB handle is ignored and the remaining arguments are used as the cache key.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: true or false, depending on whether the cache is present.

ParamType
key*
packageId*

DB API: zcl database access~cacheStats()

Returns the cache statistics.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

DB API: zcl database access~enable()

Enable the Database Query cache

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

DB API: zcl database access~disable()

Disable the database cache

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

DB API: zcl database access~selectAtomicType(db, packageId, typeName)

Locates atomic type based on a type name. Query is not case sensitive.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

ParamType
db*
packageId*
typeName*

DB API: zcl database access~selectAtomicById(db, packageId)

Retrieves atomic type by a given Id.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

ParamType
db*
packageId*

DB API: zcl database access~selectAllBitmaps(db) ⇒

Retrieves all the bitmaps in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of bitmaps.

ParamType
db*

DB API: zcl database access~selectBitmapByNameAndClusterId(db, name, clusterId, packageIds) ⇒

Select a bitmap matched by name and clusterId.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: bitmap information or undefined

ParamType
db*
name*
clusterId*
packageIds*

DB API: zcl database access~selectAllEnums(db, packageId) ⇒

Retrieves all the enums in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of enums.

ParamType
db*
packageId*

DB API: zcl database access~selectClusterEnums(db, packageId, clusterId) ⇒

Retrieves all the enums with cluster references in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of enums.

ParamType
db*
packageId*
clusterId*

DB API: zcl database access~selectAllEnumItemsById(db, id) ⇒

Returns an enum by ID.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: enum

ParamType
db*
id*

DB API: zcl database access~selectAllEnumItems(db, packageId) ⇒

Select all enum items in a package.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: list of enum items

ParamType
db*
packageId*

DB API: zcl database access~selectEnumById(db, id) ⇒

Select an enum matched by its primary key.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: an enum or underfined if not found

ParamType
db*
id*

DB API: zcl database access~selectEnumByName(db, name, packageIds) ⇒

Select an enum matched by name.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: enum or undefined

ParamType
db*
name*
packageIds*

DB API: zcl database access~selectEnumByNameAndClusterId(db, name, clusterId, packageIds) ⇒

Select an enum matched by name and clusterId.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: enum information or undefined

ParamType
db*
name*
clusterId*
packageIds*

DB API: zcl database access~selectSessionClusterByCode(db, sessionId) ⇒

Returns the cluster available to this session by the code.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: all the cluster objects for a given session.

ParamType
db*
sessionId*

DB API: zcl database access~selectAllSessionClusters(db, sessionId) ⇒

Returns all the clusters visible for a given session.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: all the cluster objects for a given session.

ParamType
db*
sessionId*

DB API: zcl database access~selectSessionAttributeByCode(db, sessionId) ⇒

Returns the attribute available to this session by the code.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the session attribute

ParamType
db*
sessionId*

DB API: zcl database access~selectSessionCommandByCode(db, sessionId) ⇒

Returns the command available to this session by the code.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the session attribute

ParamType
db*
sessionId*

DB API: zcl database access~selectStructByNameAndClusterId(db, name, clusterId, packageIds) ⇒

Select a struct matched by name and clusterId

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: struct information or undefined

ParamType
db*
name*
clusterId*
packageIds*

DB API: zcl database access~selectStructsWithClusterAssociation(db, packageIds, groupByStructName) ⇒

Get all structs which have a cluster associated with them. If a struct is present in more than one cluster then it can be grouped by struct name to avoid additional rows.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: structs which have an association with clusters

ParamType
db*
packageIds*
groupByStructName*

DB API: zcl database access~selectClusterBitmaps(db, packageId, clusterId) ⇒

Retrieves all the bitmaps that are associated with a cluster.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cluster-related bitmaps

ParamType
db*
packageId*
clusterId*

DB API: zcl database access~selectAllDomains(db) ⇒

Retrieves all the domains in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of domains.

ParamType
db*

DB API: zcl database access~selectAllStructsWithItemCount(db, packageIds) ⇒

Retrieves all the structs in the database, including the count of items.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs.

ParamType
db*
packageIds*

DB API: zcl database access~selectStructClusters(db, structId) ⇒

Returns an array of clusters that struct belongs to.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters

ParamType
db*
structId*

DB API: zcl database access~selectEnumClusters(db, enumId) ⇒

Returns an array of clusters that enum belongs to.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters

ParamType
db*
enumId*

DB API: zcl database access~selectBitmapClusters(db, enumId) ⇒

Returns an array of clusters that enum belongs to.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters

ParamType
db*
enumId*

DB API: zcl database access~selectClusterStructsWithItems(db) ⇒

Retrieves all the cluster-related structs in the database with the items.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.

ParamType
db*

DB API: zcl database access~selectAllStructsWithItems(db) ⇒

Retrieves all the structs in the database with the items.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.

ParamType
db*

DB API: zcl database access~selectAllStructItemsByStructName(db, name) ⇒

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the details of the struct items given the name of the struct

Param
db
name

DB API: zcl database access~selectAllClusters(db) ⇒

Retrieves all the clusters in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of clusters.

ParamType
db*

DB API: zcl database access~selectClusterByCode(db, packageId, clusterCode, mfgCode) ⇒

Finds cluster by code.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cluster by code in a single package id.

ParamTypeDefaultDescription
db*
packageId*Single packageId or an array of them.
clusterCode*
mfgCode*

DB API: zcl database access~selectClusterById(db, clusterId, packageId) ⇒

Returns a promise that resolves into a cluster.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into a cluster object

ParamType
db*
clusterId*
packageId*

DB API: zcl database access~selectAttributesByClusterIdIncludingGlobal(db, clusterId, packageIds) ⇒

Returns attributes for a given cluster. IMPORTANT: packageIds are needed to properly deal with the global attributes.

This method will NOT only return the attributes that link to a given cluster, but will ALSO return the attributes that have empty clusterRef (which are global attributes), and the check in that case will be made via packageId.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise of a list of attributes, including global attributes

ParamType
db*
clusterId*
packageIds*

DB API: zcl database access~selectAttributesByClusterCodeAndManufacturerCode(db, packageId, clusterCode, manufacturerCode) ⇒

Queries for attributes inside a cluster.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into attributes.

ParamType
db*
packageId*
clusterCode*
manufacturerCode*

DB API: zcl database access~selectAttributeByAttributeIdAndClusterRef(db, attributeId, clusterRef)

This async function should be used when you want to get attributes, while also resolving against any global data that may be overridden by a particular cluster.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

ParamType
db*
attributeId*
clusterRef*

DB API: zcl database access~selectAllAttributesBySide(db, side, packageId) ⇒

Query for attributes by side.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into attributes.

ParamType
db*
side*
packageId*

DB API: event queries.

This module provides queries related to events.

DB API: package-based queries.

This module provides queries related to imports and exports of files.

DB API: zcl loading queries

This module provides queries for ZCL loading

  • [DB API: zcl loading queries](#moduleDB API zcl loading queries)
    • [~insertGlobals(db, packageId, data)](#moduleDB API zcl loading queries..insertGlobals) ⇒
    • [~insertClusterExtensions(db, packageId, data)](#moduleDB API zcl loading queries..insertClusterExtensions) ⇒
    • [~insertClusters(db, packageId, data)](#moduleDB API zcl loading queries..insertClusters) ⇒
    • [~insertTags(db, packageId, data)](#moduleDB API zcl loading queries..insertTags) ⇒
    • [~insertDomains(db, packageId, data)](#moduleDB API zcl loading queries..insertDomains) ⇒
    • [~insertSpecs(db, packageId, data)](#moduleDB API zcl loading queries..insertSpecs) ⇒
    • [~insertGlobalAttributeDefault(db, packageId, clusterData)](#moduleDB API zcl loading queries..insertGlobalAttributeDefault) ⇒
    • [~insertAtomics(db, packageId, data)](#moduleDB API zcl loading queries..insertAtomics)
    • [~insertDeviceTypes(db, packageId, data)](#moduleDB API zcl loading queries..insertDeviceTypes) ⇒
    • [~insertDeviceTypeAttributes(db, dtClusterRefDataPairs)](#moduleDB API zcl loading queries..insertDeviceTypeAttributes)
    • [~insertDeviceTypeCommands(db, dtClusterRefDataPairs)](#moduleDB API zcl loading queries..insertDeviceTypeCommands)
    • [~createAccessRows(db, packageId, data)](#moduleDB API zcl loading queries..createAccessRows)
    • [~insertDefaultAccess(db, packageId, defaultAccess)](#moduleDB API zcl loading queries..insertDefaultAccess)
    • [~updateDataTypeClusterReferences(db, packageId)](#moduleDB API zcl loading queries..updateDataTypeClusterReferences) ⇒
    • [~insertDataTypeDiscriminator(db, packageId, data)](#moduleDB API zcl loading queries..insertDataTypeDiscriminator)
    • [~insertDataType(db, packageId, data)](#moduleDB API zcl loading queries..insertDataType)
    • [~insertNumber(db, packageId, data)](#moduleDB API zcl loading queries..insertNumber)
    • [~insertString(db, packageId, data)](#moduleDB API zcl loading queries..insertString)
    • [~insertEnumAtomic(db, packageId, data)](#moduleDB API zcl loading queries..insertEnumAtomic)
    • [~insertEnum(db, packageIds, data)](#moduleDB API zcl loading queries..insertEnum)
    • [~insertEnumItems(db, packageId, knownPackages, data)](#moduleDB API zcl loading queries..insertEnumItems)
    • [~insertBitmapAtomic(db, packageId, data)](#moduleDB API zcl loading queries..insertBitmapAtomic)
    • [~insertBitmap(db, packageIds, data)](#moduleDB API zcl loading queries..insertBitmap)
    • [~insertBitmapFields(db, packageId, knownPackages, data)](#moduleDB API zcl loading queries..insertBitmapFields)
    • [~insertStruct(db, packageIds, data)](#moduleDB API zcl loading queries..insertStruct)
    • [~insertStructItems(db, packageIds, data)](#moduleDB API zcl loading queries..insertStructItems)

DB API: zcl loading queries~insertGlobals(db, packageId, data) ⇒

Inserts globals into the database.

Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)
Returns: Promise of globals insertion.

ParamType
db*
packageId*
data*

DB API: zcl loading queries~insertClusterExtensions(db, packageId, data) ⇒

Inserts cluster extensions into the database.

Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)
Returns: Promise of cluster extension insertion.

ParamType
db*
packageId*
data*

DB API: zcl loading queries~insertClusters(db, packageId, data) ⇒

Inserts clusters into the database.

Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)
Returns: Promise of cluster insertion.

ParamTypeDescription
db*
packageId*
data*an array of objects that must contain: code, name, description, define. It also contains commands: and attributes:

DB API: zcl loading queries~insertTags(db, packageId, data) ⇒

Inserts tags into the database. data is an array of objects, containing ‘name’ and ‘description’

Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)
Returns: A promise that resolves with array of rowids.

ParamType
db*
packageId*
data*

DB API: zcl loading queries~insertDomains(db, packageId, data) ⇒

Inserts domains into the database. data is an array of objects that must contain: name

Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)
Returns: A promise that resolves with an array of rowids of all inserted domains.

ParamTypeDescription
db*
packageId*
data*Data containing name and specRef

DB API: zcl loading queries~insertSpecs(db, packageId, data) ⇒

Inserts a spec into the database.

Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)
Returns: Promise of insertion.

ParamTypeDescription
db*
packageId*
data*Data contining specCode and specDescription.

DB API: zcl loading queries~insertGlobalAttributeDefault(db, packageId, clusterData) ⇒

Inserts global attribute defaults into the database.

Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)
Returns: Promise of data insertion.

ParamTypeDescription
db*
packageId*
clusterData*array of objects that contain: code, manufacturerCode and subarrays of globalAttribute[] which contain: side, code, value

DB API: zcl loading queries~insertAtomics(db, packageId, data)

Insert atomics into the database. Data is an array of objects that must contains: name, id, description. Object might also contain ‘size’, but possibly not.

Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)

ParamType
db*
packageId*
data*

DB API: zcl loading queries~insertDeviceTypes(db, packageId, data) ⇒

Inserts device types into the database.

Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)
Returns: Promise of an insertion of device types.

ParamTypeDescription
db*
packageId*
data*an array of objects that must contain: domain, code, profileId, name, description

DB API: zcl loading queries~insertDeviceTypeAttributes(db, dtClusterRefDataPairs)

This handles the loading of device type attribute requirements into the database. There is a need to post-process to attach the actual attribute ref after the fact

Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)

ParamType
db*
dtClusterRefDataPairs*

DB API: zcl loading queries~insertDeviceTypeCommands(db, dtClusterRefDataPairs)

This handles the loading of device type command requirements into the database. There is a need to post-process to attach the actual command ref after the fact

Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)

ParamType
db*
dtClusterRefDataPairs*

DB API: zcl loading queries~createAccessRows(db, packageId, data)

Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)

ParamTypeDescription
db*
packageId*
data*array of objects that must have op/role/modifier

DB API: zcl loading queries~insertDefaultAccess(db, packageId, defaultAccess)

Inserts a default access. Default access is object that contains type and access array of {op,role,modifier}

Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)

ParamType
db*
packageId*
defaultAccess*

DB API: zcl loading queries~updateDataTypeClusterReferences(db, packageId) ⇒

This function is used as a post loading action for updating the cluster references of all the data types based on their cluster code.

Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)
Returns: promise which updates cluster references for data types

ParamType
db*
packageId*

DB API: zcl loading queries~insertDataTypeDiscriminator(db, packageId, data)

Insert Data Type Discriminator into the database. Data is all the data types that can exist with name and whether the type is a baseline data type or not for eg If we have a type called 16BitNumber which is a UINT_16(Actual representation of 16 Bit unsigned integere) then 16BitNumber is not a baseline data type but UINT_16 is base line data type. Note: We have an ignore to silently ignore duplicates

Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)

ParamType
db*
packageId*
data*

DB API: zcl loading queries~insertDataType(db, packageId, data)

Insert all Data Types into the database. The Data Type Cluster table is updated with the data type reference and cluster code. Cluster code is used later to update the cluster reference of the Data Type Cluster table(see updateDataTypeClusterReferences).

Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)

ParamTypeDescription
db*
packageId*
data*certain data type which is inserted into the data type table based on its type

DB API: zcl loading queries~insertNumber(db, packageId, data)

Insert all Number data types into the Number Table.

Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)

ParamType
db*
packageId*
data*

DB API: zcl loading queries~insertString(db, packageId, data)

Insert all String data types into the String Table.

Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)

ParamType
db*
packageId*
data*

DB API: zcl loading queries~insertEnumAtomic(db, packageId, data)

Insert all Baseline Enums into the Enum Table. Baseline enums are enums such as ENUM8, ENUM16 defined in the xml files

Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)

ParamType
db*
packageId*
data*

DB API: zcl loading queries~insertEnum(db, packageIds, data)

Insert all Enums into the Enum Table. Note: Unlike insertEnumAtomic this function adds the enums which are not baseline enums.

Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)

ParamType
db*
packageIds*
data*

DB API: zcl loading queries~insertEnumItems(db, packageId, knownPackages, data)

Insert all Enum Items into the Enum Item Table.

Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)

ParamType
db*
packageId*
knownPackages*
data*

DB API: zcl loading queries~insertBitmapAtomic(db, packageId, data)

Insert all Baseline Bitmaps into the Bitmap Table. Baseline bitmaps are bitmaps such as BITMAP8/MAP8, BITMAP16/MAP16 defined in the xml files

Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)

ParamType
db*
packageId*
data*

DB API: zcl loading queries~insertBitmap(db, packageIds, data)

Insert all Bitmaps into the Bitmap Table. Note: Unlike insertBitmapAtomic this function adds the bitmaps which are not baseline bitmaps.

Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)

ParamType
db*
packageIds*
data*

DB API: zcl loading queries~insertBitmapFields(db, packageId, knownPackages, data)

Insert all Bitmap fields into the Bitmap field Table.

Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)

ParamType
db*
packageId*
knownPackages*
data*

DB API: zcl loading queries~insertStruct(db, packageIds, data)

Insert all Structs into the Struct Table.

Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)

ParamType
db*
packageIds*
data*

DB API: zcl loading queries~insertStructItems(db, packageIds, data)

Insert all Struct items into the Struct Item Table.

Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)

ParamType
db*
packageIds*
data*

DB API: session related queries.

This module provides notification related queries.

DB API: package-based queries.

This module provides queries related to packages.

DB API: zcl database access

This module provides queries for ZCL static entities inside a single session. Things like: all visible clusters, etc.

  • [DB API: zcl database access](#moduleDB API zcl database access)
    • [~clear()](#moduleDB API zcl database access..clear)
    • [~put(key, packageId, data)](#moduleDB API zcl database access..put) ⇒
    • [~get(key, packageId)](#moduleDB API zcl database access..get) ⇒
    • [~isCached(key, packageId)](#moduleDB API zcl database access..isCached) ⇒
    • [~cacheQuery(key, packageId)](#moduleDB API zcl database access..cacheQuery) ⇒
    • [~cacheStats()](#moduleDB API zcl database access..cacheStats)
    • [~enable()](#moduleDB API zcl database access..enable)
    • [~disable()](#moduleDB API zcl database access..disable)
    • [~selectAtomicType(db, packageId, typeName)](#moduleDB API zcl database access..selectAtomicType)
    • [~selectAtomicById(db, packageId)](#moduleDB API zcl database access..selectAtomicById)
    • [~selectAllBitmaps(db)](#moduleDB API zcl database access..selectAllBitmaps) ⇒
    • [~selectBitmapByNameAndClusterId(db, name, clusterId, packageIds)](#moduleDB API zcl database access..selectBitmapByNameAndClusterId) ⇒
    • [~selectAllEnums(db, packageId)](#moduleDB API zcl database access..selectAllEnums) ⇒
    • [~selectClusterEnums(db, packageId, clusterId)](#moduleDB API zcl database access..selectClusterEnums) ⇒
    • [~selectAllEnumItemsById(db, id)](#moduleDB API zcl database access..selectAllEnumItemsById) ⇒
    • [~selectAllEnumItems(db, packageId)](#moduleDB API zcl database access..selectAllEnumItems) ⇒
    • [~selectEnumById(db, id)](#moduleDB API zcl database access..selectEnumById) ⇒
    • [~selectEnumByName(db, name, packageIds)](#moduleDB API zcl database access..selectEnumByName) ⇒
    • [~selectEnumByNameAndClusterId(db, name, clusterId, packageIds)](#moduleDB API zcl database access..selectEnumByNameAndClusterId) ⇒
    • [~selectSessionClusterByCode(db, sessionId)](#moduleDB API zcl database access..selectSessionClusterByCode) ⇒
    • [~selectAllSessionClusters(db, sessionId)](#moduleDB API zcl database access..selectAllSessionClusters) ⇒
    • [~selectSessionAttributeByCode(db, sessionId)](#moduleDB API zcl database access..selectSessionAttributeByCode) ⇒
    • [~selectSessionCommandByCode(db, sessionId)](#moduleDB API zcl database access..selectSessionCommandByCode) ⇒
    • [~selectStructByNameAndClusterId(db, name, clusterId, packageIds)](#moduleDB API zcl database access..selectStructByNameAndClusterId) ⇒
    • [~selectStructsWithClusterAssociation(db, packageIds, groupByStructName)](#moduleDB API zcl database access..selectStructsWithClusterAssociation) ⇒
    • [~selectClusterBitmaps(db, packageId, clusterId)](#moduleDB API zcl database access..selectClusterBitmaps) ⇒
    • [~selectAllDomains(db)](#moduleDB API zcl database access..selectAllDomains) ⇒
    • [~selectAllStructsWithItemCount(db, packageIds)](#moduleDB API zcl database access..selectAllStructsWithItemCount) ⇒
    • [~selectStructClusters(db, structId)](#moduleDB API zcl database access..selectStructClusters) ⇒
    • [~selectEnumClusters(db, enumId)](#moduleDB API zcl database access..selectEnumClusters) ⇒
    • [~selectBitmapClusters(db, enumId)](#moduleDB API zcl database access..selectBitmapClusters) ⇒
    • [~selectClusterStructsWithItems(db)](#moduleDB API zcl database access..selectClusterStructsWithItems) ⇒
    • [~selectAllStructsWithItems(db)](#moduleDB API zcl database access..selectAllStructsWithItems) ⇒
    • [~selectAllStructItemsByStructName(db, name)](#moduleDB API zcl database access..selectAllStructItemsByStructName) ⇒
    • [~selectAllClusters(db)](#moduleDB API zcl database access..selectAllClusters) ⇒
    • [~selectClusterByCode(db, packageId, clusterCode, mfgCode)](#moduleDB API zcl database access..selectClusterByCode) ⇒
    • [~selectClusterById(db, clusterId, packageId)](#moduleDB API zcl database access..selectClusterById) ⇒
    • [~selectAttributesByClusterIdIncludingGlobal(db, clusterId, packageIds)](#moduleDB API zcl database access..selectAttributesByClusterIdIncludingGlobal) ⇒
    • [~selectAttributesByClusterCodeAndManufacturerCode(db, packageId, clusterCode, manufacturerCode)](#moduleDB API zcl database access..selectAttributesByClusterCodeAndManufacturerCode) ⇒
    • [~selectAttributeByAttributeIdAndClusterRef(db, attributeId, clusterRef)](#moduleDB API zcl database access..selectAttributeByAttributeIdAndClusterRef)
    • [~selectAllAttributesBySide(db, side, packageId)](#moduleDB API zcl database access..selectAllAttributesBySide) ⇒

DB API: zcl database access~clear()

Clears the entire cache.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

DB API: zcl database access~put(key, packageId, data) ⇒

Puts a data object into the cache under a given key/packageId

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Returns true on success.

ParamType
key*
packageId*
data*

DB API: zcl database access~get(key, packageId) ⇒

Returns a data object under a given key/packageId.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cached object or undefined if none is present or expired.

ParamType
key*
packageId*

DB API: zcl database access~isCached(key, packageId) ⇒

Returns true if a given key/packageId cache exists.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: true or false, depending on whether the cache is present.

ParamType
key*
packageId*

DB API: zcl database access~cacheQuery(key, packageId) ⇒

Cache input / output of provided queryFunction The queryFunction is assumed to have the following signature:

async function queryFunction(db, ...) {...}

The DB handle is ignored and the remaining arguments are used as the cache key.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: true or false, depending on whether the cache is present.

ParamType
key*
packageId*

DB API: zcl database access~cacheStats()

Returns the cache statistics.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

DB API: zcl database access~enable()

Enable the Database Query cache

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

DB API: zcl database access~disable()

Disable the database cache

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

DB API: zcl database access~selectAtomicType(db, packageId, typeName)

Locates atomic type based on a type name. Query is not case sensitive.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

ParamType
db*
packageId*
typeName*

DB API: zcl database access~selectAtomicById(db, packageId)

Retrieves atomic type by a given Id.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

ParamType
db*
packageId*

DB API: zcl database access~selectAllBitmaps(db) ⇒

Retrieves all the bitmaps in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of bitmaps.

ParamType
db*

DB API: zcl database access~selectBitmapByNameAndClusterId(db, name, clusterId, packageIds) ⇒

Select a bitmap matched by name and clusterId.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: bitmap information or undefined

ParamType
db*
name*
clusterId*
packageIds*

DB API: zcl database access~selectAllEnums(db, packageId) ⇒

Retrieves all the enums in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of enums.

ParamType
db*
packageId*

DB API: zcl database access~selectClusterEnums(db, packageId, clusterId) ⇒

Retrieves all the enums with cluster references in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of enums.

ParamType
db*
packageId*
clusterId*

DB API: zcl database access~selectAllEnumItemsById(db, id) ⇒

Returns an enum by ID.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: enum

ParamType
db*
id*

DB API: zcl database access~selectAllEnumItems(db, packageId) ⇒

Select all enum items in a package.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: list of enum items

ParamType
db*
packageId*

DB API: zcl database access~selectEnumById(db, id) ⇒

Select an enum matched by its primary key.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: an enum or underfined if not found

ParamType
db*
id*

DB API: zcl database access~selectEnumByName(db, name, packageIds) ⇒

Select an enum matched by name.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: enum or undefined

ParamType
db*
name*
packageIds*

DB API: zcl database access~selectEnumByNameAndClusterId(db, name, clusterId, packageIds) ⇒

Select an enum matched by name and clusterId.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: enum information or undefined

ParamType
db*
name*
clusterId*
packageIds*

DB API: zcl database access~selectSessionClusterByCode(db, sessionId) ⇒

Returns the cluster available to this session by the code.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: all the cluster objects for a given session.

ParamType
db*
sessionId*

DB API: zcl database access~selectAllSessionClusters(db, sessionId) ⇒

Returns all the clusters visible for a given session.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: all the cluster objects for a given session.

ParamType
db*
sessionId*

DB API: zcl database access~selectSessionAttributeByCode(db, sessionId) ⇒

Returns the attribute available to this session by the code.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the session attribute

ParamType
db*
sessionId*

DB API: zcl database access~selectSessionCommandByCode(db, sessionId) ⇒

Returns the command available to this session by the code.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the session attribute

ParamType
db*
sessionId*

DB API: zcl database access~selectStructByNameAndClusterId(db, name, clusterId, packageIds) ⇒

Select a struct matched by name and clusterId

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: struct information or undefined

ParamType
db*
name*
clusterId*
packageIds*

DB API: zcl database access~selectStructsWithClusterAssociation(db, packageIds, groupByStructName) ⇒

Get all structs which have a cluster associated with them. If a struct is present in more than one cluster then it can be grouped by struct name to avoid additional rows.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: structs which have an association with clusters

ParamType
db*
packageIds*
groupByStructName*

DB API: zcl database access~selectClusterBitmaps(db, packageId, clusterId) ⇒

Retrieves all the bitmaps that are associated with a cluster.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cluster-related bitmaps

ParamType
db*
packageId*
clusterId*

DB API: zcl database access~selectAllDomains(db) ⇒

Retrieves all the domains in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of domains.

ParamType
db*

DB API: zcl database access~selectAllStructsWithItemCount(db, packageIds) ⇒

Retrieves all the structs in the database, including the count of items.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs.

ParamType
db*
packageIds*

DB API: zcl database access~selectStructClusters(db, structId) ⇒

Returns an array of clusters that struct belongs to.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters

ParamType
db*
structId*

DB API: zcl database access~selectEnumClusters(db, enumId) ⇒

Returns an array of clusters that enum belongs to.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters

ParamType
db*
enumId*

DB API: zcl database access~selectBitmapClusters(db, enumId) ⇒

Returns an array of clusters that enum belongs to.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters

ParamType
db*
enumId*

DB API: zcl database access~selectClusterStructsWithItems(db) ⇒

Retrieves all the cluster-related structs in the database with the items.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.

ParamType
db*

DB API: zcl database access~selectAllStructsWithItems(db) ⇒

Retrieves all the structs in the database with the items.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.

ParamType
db*

DB API: zcl database access~selectAllStructItemsByStructName(db, name) ⇒

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the details of the struct items given the name of the struct

Param
db
name

DB API: zcl database access~selectAllClusters(db) ⇒

Retrieves all the clusters in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of clusters.

ParamType
db*

DB API: zcl database access~selectClusterByCode(db, packageId, clusterCode, mfgCode) ⇒

Finds cluster by code.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cluster by code in a single package id.

ParamTypeDefaultDescription
db*
packageId*Single packageId or an array of them.
clusterCode*
mfgCode*

DB API: zcl database access~selectClusterById(db, clusterId, packageId) ⇒

Returns a promise that resolves into a cluster.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into a cluster object

ParamType
db*
clusterId*
packageId*

DB API: zcl database access~selectAttributesByClusterIdIncludingGlobal(db, clusterId, packageIds) ⇒

Returns attributes for a given cluster. IMPORTANT: packageIds are needed to properly deal with the global attributes.

This method will NOT only return the attributes that link to a given cluster, but will ALSO return the attributes that have empty clusterRef (which are global attributes), and the check in that case will be made via packageId.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise of a list of attributes, including global attributes

ParamType
db*
clusterId*
packageIds*

DB API: zcl database access~selectAttributesByClusterCodeAndManufacturerCode(db, packageId, clusterCode, manufacturerCode) ⇒

Queries for attributes inside a cluster.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into attributes.

ParamType
db*
packageId*
clusterCode*
manufacturerCode*

DB API: zcl database access~selectAttributeByAttributeIdAndClusterRef(db, attributeId, clusterRef)

This async function should be used when you want to get attributes, while also resolving against any global data that may be overridden by a particular cluster.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

ParamType
db*
attributeId*
clusterRef*

DB API: zcl database access~selectAllAttributesBySide(db, side, packageId) ⇒

Query for attributes by side.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into attributes.

ParamType
db*
side*
packageId*

DB API: session related queries.

This module provides session related queries.

DB API: zcl database access

This module provides queries for enums.

  • [DB API: zcl database access](#moduleDB API zcl database access)
    • [~clear()](#moduleDB API zcl database access..clear)
    • [~put(key, packageId, data)](#moduleDB API zcl database access..put) ⇒
    • [~get(key, packageId)](#moduleDB API zcl database access..get) ⇒
    • [~isCached(key, packageId)](#moduleDB API zcl database access..isCached) ⇒
    • [~cacheQuery(key, packageId)](#moduleDB API zcl database access..cacheQuery) ⇒
    • [~cacheStats()](#moduleDB API zcl database access..cacheStats)
    • [~enable()](#moduleDB API zcl database access..enable)
    • [~disable()](#moduleDB API zcl database access..disable)
    • [~selectAtomicType(db, packageId, typeName)](#moduleDB API zcl database access..selectAtomicType)
    • [~selectAtomicById(db, packageId)](#moduleDB API zcl database access..selectAtomicById)
    • [~selectAllBitmaps(db)](#moduleDB API zcl database access..selectAllBitmaps) ⇒
    • [~selectBitmapByNameAndClusterId(db, name, clusterId, packageIds)](#moduleDB API zcl database access..selectBitmapByNameAndClusterId) ⇒
    • [~selectAllEnums(db, packageId)](#moduleDB API zcl database access..selectAllEnums) ⇒
    • [~selectClusterEnums(db, packageId, clusterId)](#moduleDB API zcl database access..selectClusterEnums) ⇒
    • [~selectAllEnumItemsById(db, id)](#moduleDB API zcl database access..selectAllEnumItemsById) ⇒
    • [~selectAllEnumItems(db, packageId)](#moduleDB API zcl database access..selectAllEnumItems) ⇒
    • [~selectEnumById(db, id)](#moduleDB API zcl database access..selectEnumById) ⇒
    • [~selectEnumByName(db, name, packageIds)](#moduleDB API zcl database access..selectEnumByName) ⇒
    • [~selectEnumByNameAndClusterId(db, name, clusterId, packageIds)](#moduleDB API zcl database access..selectEnumByNameAndClusterId) ⇒
    • [~selectSessionClusterByCode(db, sessionId)](#moduleDB API zcl database access..selectSessionClusterByCode) ⇒
    • [~selectAllSessionClusters(db, sessionId)](#moduleDB API zcl database access..selectAllSessionClusters) ⇒
    • [~selectSessionAttributeByCode(db, sessionId)](#moduleDB API zcl database access..selectSessionAttributeByCode) ⇒
    • [~selectSessionCommandByCode(db, sessionId)](#moduleDB API zcl database access..selectSessionCommandByCode) ⇒
    • [~selectStructByNameAndClusterId(db, name, clusterId, packageIds)](#moduleDB API zcl database access..selectStructByNameAndClusterId) ⇒
    • [~selectStructsWithClusterAssociation(db, packageIds, groupByStructName)](#moduleDB API zcl database access..selectStructsWithClusterAssociation) ⇒
    • [~selectClusterBitmaps(db, packageId, clusterId)](#moduleDB API zcl database access..selectClusterBitmaps) ⇒
    • [~selectAllDomains(db)](#moduleDB API zcl database access..selectAllDomains) ⇒
    • [~selectAllStructsWithItemCount(db, packageIds)](#moduleDB API zcl database access..selectAllStructsWithItemCount) ⇒
    • [~selectStructClusters(db, structId)](#moduleDB API zcl database access..selectStructClusters) ⇒
    • [~selectEnumClusters(db, enumId)](#moduleDB API zcl database access..selectEnumClusters) ⇒
    • [~selectBitmapClusters(db, enumId)](#moduleDB API zcl database access..selectBitmapClusters) ⇒
    • [~selectClusterStructsWithItems(db)](#moduleDB API zcl database access..selectClusterStructsWithItems) ⇒
    • [~selectAllStructsWithItems(db)](#moduleDB API zcl database access..selectAllStructsWithItems) ⇒
    • [~selectAllStructItemsByStructName(db, name)](#moduleDB API zcl database access..selectAllStructItemsByStructName) ⇒
    • [~selectAllClusters(db)](#moduleDB API zcl database access..selectAllClusters) ⇒
    • [~selectClusterByCode(db, packageId, clusterCode, mfgCode)](#moduleDB API zcl database access..selectClusterByCode) ⇒
    • [~selectClusterById(db, clusterId, packageId)](#moduleDB API zcl database access..selectClusterById) ⇒
    • [~selectAttributesByClusterIdIncludingGlobal(db, clusterId, packageIds)](#moduleDB API zcl database access..selectAttributesByClusterIdIncludingGlobal) ⇒
    • [~selectAttributesByClusterCodeAndManufacturerCode(db, packageId, clusterCode, manufacturerCode)](#moduleDB API zcl database access..selectAttributesByClusterCodeAndManufacturerCode) ⇒
    • [~selectAttributeByAttributeIdAndClusterRef(db, attributeId, clusterRef)](#moduleDB API zcl database access..selectAttributeByAttributeIdAndClusterRef)
    • [~selectAllAttributesBySide(db, side, packageId)](#moduleDB API zcl database access..selectAllAttributesBySide) ⇒

DB API: zcl database access~clear()

Clears the entire cache.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

DB API: zcl database access~put(key, packageId, data) ⇒

Puts a data object into the cache under a given key/packageId

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Returns true on success.

ParamType
key*
packageId*
data*

DB API: zcl database access~get(key, packageId) ⇒

Returns a data object under a given key/packageId.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cached object or undefined if none is present or expired.

ParamType
key*
packageId*

DB API: zcl database access~isCached(key, packageId) ⇒

Returns true if a given key/packageId cache exists.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: true or false, depending on whether the cache is present.

ParamType
key*
packageId*

DB API: zcl database access~cacheQuery(key, packageId) ⇒

Cache input / output of provided queryFunction The queryFunction is assumed to have the following signature:

async function queryFunction(db, ...) {...}

The DB handle is ignored and the remaining arguments are used as the cache key.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: true or false, depending on whether the cache is present.

ParamType
key*
packageId*

DB API: zcl database access~cacheStats()

Returns the cache statistics.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

DB API: zcl database access~enable()

Enable the Database Query cache

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

DB API: zcl database access~disable()

Disable the database cache

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

DB API: zcl database access~selectAtomicType(db, packageId, typeName)

Locates atomic type based on a type name. Query is not case sensitive.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

ParamType
db*
packageId*
typeName*

DB API: zcl database access~selectAtomicById(db, packageId)

Retrieves atomic type by a given Id.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

ParamType
db*
packageId*

DB API: zcl database access~selectAllBitmaps(db) ⇒

Retrieves all the bitmaps in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of bitmaps.

ParamType
db*

DB API: zcl database access~selectBitmapByNameAndClusterId(db, name, clusterId, packageIds) ⇒

Select a bitmap matched by name and clusterId.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: bitmap information or undefined

ParamType
db*
name*
clusterId*
packageIds*

DB API: zcl database access~selectAllEnums(db, packageId) ⇒

Retrieves all the enums in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of enums.

ParamType
db*
packageId*

DB API: zcl database access~selectClusterEnums(db, packageId, clusterId) ⇒

Retrieves all the enums with cluster references in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of enums.

ParamType
db*
packageId*
clusterId*

DB API: zcl database access~selectAllEnumItemsById(db, id) ⇒

Returns an enum by ID.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: enum

ParamType
db*
id*

DB API: zcl database access~selectAllEnumItems(db, packageId) ⇒

Select all enum items in a package.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: list of enum items

ParamType
db*
packageId*

DB API: zcl database access~selectEnumById(db, id) ⇒

Select an enum matched by its primary key.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: an enum or underfined if not found

ParamType
db*
id*

DB API: zcl database access~selectEnumByName(db, name, packageIds) ⇒

Select an enum matched by name.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: enum or undefined

ParamType
db*
name*
packageIds*

DB API: zcl database access~selectEnumByNameAndClusterId(db, name, clusterId, packageIds) ⇒

Select an enum matched by name and clusterId.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: enum information or undefined

ParamType
db*
name*
clusterId*
packageIds*

DB API: zcl database access~selectSessionClusterByCode(db, sessionId) ⇒

Returns the cluster available to this session by the code.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: all the cluster objects for a given session.

ParamType
db*
sessionId*

DB API: zcl database access~selectAllSessionClusters(db, sessionId) ⇒

Returns all the clusters visible for a given session.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: all the cluster objects for a given session.

ParamType
db*
sessionId*

DB API: zcl database access~selectSessionAttributeByCode(db, sessionId) ⇒

Returns the attribute available to this session by the code.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the session attribute

ParamType
db*
sessionId*

DB API: zcl database access~selectSessionCommandByCode(db, sessionId) ⇒

Returns the command available to this session by the code.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the session attribute

ParamType
db*
sessionId*

DB API: zcl database access~selectStructByNameAndClusterId(db, name, clusterId, packageIds) ⇒

Select a struct matched by name and clusterId

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: struct information or undefined

ParamType
db*
name*
clusterId*
packageIds*

DB API: zcl database access~selectStructsWithClusterAssociation(db, packageIds, groupByStructName) ⇒

Get all structs which have a cluster associated with them. If a struct is present in more than one cluster then it can be grouped by struct name to avoid additional rows.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: structs which have an association with clusters

ParamType
db*
packageIds*
groupByStructName*

DB API: zcl database access~selectClusterBitmaps(db, packageId, clusterId) ⇒

Retrieves all the bitmaps that are associated with a cluster.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cluster-related bitmaps

ParamType
db*
packageId*
clusterId*

DB API: zcl database access~selectAllDomains(db) ⇒

Retrieves all the domains in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of domains.

ParamType
db*

DB API: zcl database access~selectAllStructsWithItemCount(db, packageIds) ⇒

Retrieves all the structs in the database, including the count of items.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs.

ParamType
db*
packageIds*

DB API: zcl database access~selectStructClusters(db, structId) ⇒

Returns an array of clusters that struct belongs to.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters

ParamType
db*
structId*

DB API: zcl database access~selectEnumClusters(db, enumId) ⇒

Returns an array of clusters that enum belongs to.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters

ParamType
db*
enumId*

DB API: zcl database access~selectBitmapClusters(db, enumId) ⇒

Returns an array of clusters that enum belongs to.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters

ParamType
db*
enumId*

DB API: zcl database access~selectClusterStructsWithItems(db) ⇒

Retrieves all the cluster-related structs in the database with the items.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.

ParamType
db*

DB API: zcl database access~selectAllStructsWithItems(db) ⇒

Retrieves all the structs in the database with the items.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.

ParamType
db*

DB API: zcl database access~selectAllStructItemsByStructName(db, name) ⇒

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the details of the struct items given the name of the struct

Param
db
name

DB API: zcl database access~selectAllClusters(db) ⇒

Retrieves all the clusters in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of clusters.

ParamType
db*

DB API: zcl database access~selectClusterByCode(db, packageId, clusterCode, mfgCode) ⇒

Finds cluster by code.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cluster by code in a single package id.

ParamTypeDefaultDescription
db*
packageId*Single packageId or an array of them.
clusterCode*
mfgCode*

DB API: zcl database access~selectClusterById(db, clusterId, packageId) ⇒

Returns a promise that resolves into a cluster.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into a cluster object

ParamType
db*
clusterId*
packageId*

DB API: zcl database access~selectAttributesByClusterIdIncludingGlobal(db, clusterId, packageIds) ⇒

Returns attributes for a given cluster. IMPORTANT: packageIds are needed to properly deal with the global attributes.

This method will NOT only return the attributes that link to a given cluster, but will ALSO return the attributes that have empty clusterRef (which are global attributes), and the check in that case will be made via packageId.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise of a list of attributes, including global attributes

ParamType
db*
clusterId*
packageIds*

DB API: zcl database access~selectAttributesByClusterCodeAndManufacturerCode(db, packageId, clusterCode, manufacturerCode) ⇒

Queries for attributes inside a cluster.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into attributes.

ParamType
db*
packageId*
clusterCode*
manufacturerCode*

DB API: zcl database access~selectAttributeByAttributeIdAndClusterRef(db, attributeId, clusterRef)

This async function should be used when you want to get attributes, while also resolving against any global data that may be overridden by a particular cluster.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

ParamType
db*
attributeId*
clusterRef*

DB API: zcl database access~selectAllAttributesBySide(db, side, packageId) ⇒

Query for attributes by side.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into attributes.

ParamType
db*
side*
packageId*

DB API: zcl database access

This module provides queries for ZCL static queries.

  • [DB API: zcl database access](#moduleDB API zcl database access)
    • [~clear()](#moduleDB API zcl database access..clear)
    • [~put(key, packageId, data)](#moduleDB API zcl database access..put) ⇒
    • [~get(key, packageId)](#moduleDB API zcl database access..get) ⇒
    • [~isCached(key, packageId)](#moduleDB API zcl database access..isCached) ⇒
    • [~cacheQuery(key, packageId)](#moduleDB API zcl database access..cacheQuery) ⇒
    • [~cacheStats()](#moduleDB API zcl database access..cacheStats)
    • [~enable()](#moduleDB API zcl database access..enable)
    • [~disable()](#moduleDB API zcl database access..disable)
    • [~selectAtomicType(db, packageId, typeName)](#moduleDB API zcl database access..selectAtomicType)
    • [~selectAtomicById(db, packageId)](#moduleDB API zcl database access..selectAtomicById)
    • [~selectAllBitmaps(db)](#moduleDB API zcl database access..selectAllBitmaps) ⇒
    • [~selectBitmapByNameAndClusterId(db, name, clusterId, packageIds)](#moduleDB API zcl database access..selectBitmapByNameAndClusterId) ⇒
    • [~selectAllEnums(db, packageId)](#moduleDB API zcl database access..selectAllEnums) ⇒
    • [~selectClusterEnums(db, packageId, clusterId)](#moduleDB API zcl database access..selectClusterEnums) ⇒
    • [~selectAllEnumItemsById(db, id)](#moduleDB API zcl database access..selectAllEnumItemsById) ⇒
    • [~selectAllEnumItems(db, packageId)](#moduleDB API zcl database access..selectAllEnumItems) ⇒
    • [~selectEnumById(db, id)](#moduleDB API zcl database access..selectEnumById) ⇒
    • [~selectEnumByName(db, name, packageIds)](#moduleDB API zcl database access..selectEnumByName) ⇒
    • [~selectEnumByNameAndClusterId(db, name, clusterId, packageIds)](#moduleDB API zcl database access..selectEnumByNameAndClusterId) ⇒
    • [~selectSessionClusterByCode(db, sessionId)](#moduleDB API zcl database access..selectSessionClusterByCode) ⇒
    • [~selectAllSessionClusters(db, sessionId)](#moduleDB API zcl database access..selectAllSessionClusters) ⇒
    • [~selectSessionAttributeByCode(db, sessionId)](#moduleDB API zcl database access..selectSessionAttributeByCode) ⇒
    • [~selectSessionCommandByCode(db, sessionId)](#moduleDB API zcl database access..selectSessionCommandByCode) ⇒
    • [~selectStructByNameAndClusterId(db, name, clusterId, packageIds)](#moduleDB API zcl database access..selectStructByNameAndClusterId) ⇒
    • [~selectStructsWithClusterAssociation(db, packageIds, groupByStructName)](#moduleDB API zcl database access..selectStructsWithClusterAssociation) ⇒
    • [~selectClusterBitmaps(db, packageId, clusterId)](#moduleDB API zcl database access..selectClusterBitmaps) ⇒
    • [~selectAllDomains(db)](#moduleDB API zcl database access..selectAllDomains) ⇒
    • [~selectAllStructsWithItemCount(db, packageIds)](#moduleDB API zcl database access..selectAllStructsWithItemCount) ⇒
    • [~selectStructClusters(db, structId)](#moduleDB API zcl database access..selectStructClusters) ⇒
    • [~selectEnumClusters(db, enumId)](#moduleDB API zcl database access..selectEnumClusters) ⇒
    • [~selectBitmapClusters(db, enumId)](#moduleDB API zcl database access..selectBitmapClusters) ⇒
    • [~selectClusterStructsWithItems(db)](#moduleDB API zcl database access..selectClusterStructsWithItems) ⇒
    • [~selectAllStructsWithItems(db)](#moduleDB API zcl database access..selectAllStructsWithItems) ⇒
    • [~selectAllStructItemsByStructName(db, name)](#moduleDB API zcl database access..selectAllStructItemsByStructName) ⇒
    • [~selectAllClusters(db)](#moduleDB API zcl database access..selectAllClusters) ⇒
    • [~selectClusterByCode(db, packageId, clusterCode, mfgCode)](#moduleDB API zcl database access..selectClusterByCode) ⇒
    • [~selectClusterById(db, clusterId, packageId)](#moduleDB API zcl database access..selectClusterById) ⇒
    • [~selectAttributesByClusterIdIncludingGlobal(db, clusterId, packageIds)](#moduleDB API zcl database access..selectAttributesByClusterIdIncludingGlobal) ⇒
    • [~selectAttributesByClusterCodeAndManufacturerCode(db, packageId, clusterCode, manufacturerCode)](#moduleDB API zcl database access..selectAttributesByClusterCodeAndManufacturerCode) ⇒
    • [~selectAttributeByAttributeIdAndClusterRef(db, attributeId, clusterRef)](#moduleDB API zcl database access..selectAttributeByAttributeIdAndClusterRef)
    • [~selectAllAttributesBySide(db, side, packageId)](#moduleDB API zcl database access..selectAllAttributesBySide) ⇒

DB API: zcl database access~clear()

Clears the entire cache.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

DB API: zcl database access~put(key, packageId, data) ⇒

Puts a data object into the cache under a given key/packageId

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Returns true on success.

ParamType
key*
packageId*
data*

DB API: zcl database access~get(key, packageId) ⇒

Returns a data object under a given key/packageId.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cached object or undefined if none is present or expired.

ParamType
key*
packageId*

DB API: zcl database access~isCached(key, packageId) ⇒

Returns true if a given key/packageId cache exists.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: true or false, depending on whether the cache is present.

ParamType
key*
packageId*

DB API: zcl database access~cacheQuery(key, packageId) ⇒

Cache input / output of provided queryFunction The queryFunction is assumed to have the following signature:

async function queryFunction(db, ...) {...}

The DB handle is ignored and the remaining arguments are used as the cache key.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: true or false, depending on whether the cache is present.

ParamType
key*
packageId*

DB API: zcl database access~cacheStats()

Returns the cache statistics.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

DB API: zcl database access~enable()

Enable the Database Query cache

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

DB API: zcl database access~disable()

Disable the database cache

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

DB API: zcl database access~selectAtomicType(db, packageId, typeName)

Locates atomic type based on a type name. Query is not case sensitive.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

ParamType
db*
packageId*
typeName*

DB API: zcl database access~selectAtomicById(db, packageId)

Retrieves atomic type by a given Id.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

ParamType
db*
packageId*

DB API: zcl database access~selectAllBitmaps(db) ⇒

Retrieves all the bitmaps in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of bitmaps.

ParamType
db*

DB API: zcl database access~selectBitmapByNameAndClusterId(db, name, clusterId, packageIds) ⇒

Select a bitmap matched by name and clusterId.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: bitmap information or undefined

ParamType
db*
name*
clusterId*
packageIds*

DB API: zcl database access~selectAllEnums(db, packageId) ⇒

Retrieves all the enums in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of enums.

ParamType
db*
packageId*

DB API: zcl database access~selectClusterEnums(db, packageId, clusterId) ⇒

Retrieves all the enums with cluster references in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of enums.

ParamType
db*
packageId*
clusterId*

DB API: zcl database access~selectAllEnumItemsById(db, id) ⇒

Returns an enum by ID.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: enum

ParamType
db*
id*

DB API: zcl database access~selectAllEnumItems(db, packageId) ⇒

Select all enum items in a package.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: list of enum items

ParamType
db*
packageId*

DB API: zcl database access~selectEnumById(db, id) ⇒

Select an enum matched by its primary key.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: an enum or underfined if not found

ParamType
db*
id*

DB API: zcl database access~selectEnumByName(db, name, packageIds) ⇒

Select an enum matched by name.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: enum or undefined

ParamType
db*
name*
packageIds*

DB API: zcl database access~selectEnumByNameAndClusterId(db, name, clusterId, packageIds) ⇒

Select an enum matched by name and clusterId.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: enum information or undefined

ParamType
db*
name*
clusterId*
packageIds*

DB API: zcl database access~selectSessionClusterByCode(db, sessionId) ⇒

Returns the cluster available to this session by the code.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: all the cluster objects for a given session.

ParamType
db*
sessionId*

DB API: zcl database access~selectAllSessionClusters(db, sessionId) ⇒

Returns all the clusters visible for a given session.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: all the cluster objects for a given session.

ParamType
db*
sessionId*

DB API: zcl database access~selectSessionAttributeByCode(db, sessionId) ⇒

Returns the attribute available to this session by the code.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the session attribute

ParamType
db*
sessionId*

DB API: zcl database access~selectSessionCommandByCode(db, sessionId) ⇒

Returns the command available to this session by the code.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the session attribute

ParamType
db*
sessionId*

DB API: zcl database access~selectStructByNameAndClusterId(db, name, clusterId, packageIds) ⇒

Select a struct matched by name and clusterId

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: struct information or undefined

ParamType
db*
name*
clusterId*
packageIds*

DB API: zcl database access~selectStructsWithClusterAssociation(db, packageIds, groupByStructName) ⇒

Get all structs which have a cluster associated with them. If a struct is present in more than one cluster then it can be grouped by struct name to avoid additional rows.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: structs which have an association with clusters

ParamType
db*
packageIds*
groupByStructName*

DB API: zcl database access~selectClusterBitmaps(db, packageId, clusterId) ⇒

Retrieves all the bitmaps that are associated with a cluster.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cluster-related bitmaps

ParamType
db*
packageId*
clusterId*

DB API: zcl database access~selectAllDomains(db) ⇒

Retrieves all the domains in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of domains.

ParamType
db*

DB API: zcl database access~selectAllStructsWithItemCount(db, packageIds) ⇒

Retrieves all the structs in the database, including the count of items.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs.

ParamType
db*
packageIds*

DB API: zcl database access~selectStructClusters(db, structId) ⇒

Returns an array of clusters that struct belongs to.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters

ParamType
db*
structId*

DB API: zcl database access~selectEnumClusters(db, enumId) ⇒

Returns an array of clusters that enum belongs to.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters

ParamType
db*
enumId*

DB API: zcl database access~selectBitmapClusters(db, enumId) ⇒

Returns an array of clusters that enum belongs to.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters

ParamType
db*
enumId*

DB API: zcl database access~selectClusterStructsWithItems(db) ⇒

Retrieves all the cluster-related structs in the database with the items.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.

ParamType
db*

DB API: zcl database access~selectAllStructsWithItems(db) ⇒

Retrieves all the structs in the database with the items.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.

ParamType
db*

DB API: zcl database access~selectAllStructItemsByStructName(db, name) ⇒

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the details of the struct items given the name of the struct

Param
db
name

DB API: zcl database access~selectAllClusters(db) ⇒

Retrieves all the clusters in the database.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of clusters.

ParamType
db*

DB API: zcl database access~selectClusterByCode(db, packageId, clusterCode, mfgCode) ⇒

Finds cluster by code.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cluster by code in a single package id.

ParamTypeDefaultDescription
db*
packageId*Single packageId or an array of them.
clusterCode*
mfgCode*

DB API: zcl database access~selectClusterById(db, clusterId, packageId) ⇒

Returns a promise that resolves into a cluster.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into a cluster object

ParamType
db*
clusterId*
packageId*

DB API: zcl database access~selectAttributesByClusterIdIncludingGlobal(db, clusterId, packageIds) ⇒

Returns attributes for a given cluster. IMPORTANT: packageIds are needed to properly deal with the global attributes.

This method will NOT only return the attributes that link to a given cluster, but will ALSO return the attributes that have empty clusterRef (which are global attributes), and the check in that case will be made via packageId.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise of a list of attributes, including global attributes

ParamType
db*
clusterId*
packageIds*

DB API: zcl database access~selectAttributesByClusterCodeAndManufacturerCode(db, packageId, clusterCode, manufacturerCode) ⇒

Queries for attributes inside a cluster.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into attributes.

ParamType
db*
packageId*
clusterCode*
manufacturerCode*

DB API: zcl database access~selectAttributeByAttributeIdAndClusterRef(db, attributeId, clusterRef)

This async function should be used when you want to get attributes, while also resolving against any global data that may be overridden by a particular cluster.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)

ParamType
db*
attributeId*
clusterRef*

DB API: zcl database access~selectAllAttributesBySide(db, side, packageId) ⇒

Query for attributes by side.

Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into attributes.

ParamType
db*
side*
packageId*

JS API: generator logic

  • [JS API: generator logic](#moduleJS API generator logic)
    • [~loadGenTemplateFromFile(path)](#moduleJS API generator logic..loadGenTemplateFromFile) ⇒
    • [~recordTemplatesPackage(context)](#moduleJS API generator logic..recordTemplatesPackage) ⇒
    • [~decodePackageExtensionEntity(entityType, entity)](#moduleJS API generator logic..decodePackageExtensionEntity) ⇒
    • [~loadZclExtensions(zclExt)](#moduleJS API generator logic..loadZclExtensions) ⇒
    • [~loadTemplates(db, genTemplatesJsonArray)](#moduleJS API generator logic..loadTemplates)
    • [~loadSingleTemplate(db, genTemplatesJson)](#moduleJS API generator logic..loadSingleTemplate) ⇒
    • [~generateAllTemplates(genResult, genTemplateJsonPkg, generateOnly)](#moduleJS API generator logic..generateAllTemplates) ⇒
    • [~generateSingleTemplate(genResult, singleTemplatePkg)](#moduleJS API generator logic..generateSingleTemplate) ⇒
    • [~generate(db, packageId)](#moduleJS API generator logic..generate) ⇒
    • [~writeFileWithBackup(fileName, content, doBackup)](#moduleJS API generator logic..writeFileWithBackup) ⇒
    • [~generateGenerationContent(genResult)](#moduleJS API generator logic..generateGenerationContent)
    • [~generateAndWriteFiles(db, sessionId, packageId, outputDirectory)](#moduleJS API generator logic..generateAndWriteFiles) ⇒
    • [~postProcessGeneratedFiles(outputDirectory, genResult)](#moduleJS API generator logic..postProcessGeneratedFiles) ⇒
    • [~contentIndexer(content)](#moduleJS API generator logic..contentIndexer)
    • [~generateSingleFileForPreview(db, sessionId, fileName)](#moduleJS API generator logic..generateSingleFileForPreview) ⇒
    • [~produceCompiledTemplate(singleTemplatePkg)](#moduleJS API generator logic..produceCompiledTemplate) ⇒
    • [~produceContent(hb, metaInfo, db, sessionId, singlePkg, overridePath:)](#moduleJS API generator logic..produceContent) ⇒
    • [~wrapOverridable(originalFn, overrideFn)](#moduleJS API generator logic..wrapOverridable) ⇒
    • [~loadOverridable(genTemplatePackageId)](#moduleJS API generator logic..loadOverridable)
    • [~loadPartial(path)](#moduleJS API generator logic..loadPartial)
    • [~loadHelper(helpers)](#moduleJS API generator logic..loadHelper)
    • [~allBuiltInHelpers()](#moduleJS API generator logic..allBuiltInHelpers) ⇒
    • [~findHelperPackageByAlias(alias)](#moduleJS API generator logic..findHelperPackageByAlias) ⇒
    • [~initializeBuiltInHelpersForPackage()](#moduleJS API generator logic..initializeBuiltInHelpersForPackage)
    • [~hbInstance()](#moduleJS API generator logic..hbInstance) ⇒
    • [~makeSynchronizablePromise(promise)](#moduleJS API generator logic..makeSynchronizablePromise)
    • [~collectBlocks(resultArray, options, context)](#moduleJS API generator logic..collectBlocks) ⇒
    • [~ensureZclPackageId(context)](#moduleJS API generator logic..ensureZclPackageId) ⇒
    • [~ensureZclPackageIds(context)](#moduleJS API generator logic..ensureZclPackageIds) ⇒
    • [~ensureTemplatePackageId(context)](#moduleJS API generator logic..ensureTemplatePackageId) ⇒
    • [~ensureEndpointTypeIds(context)](#moduleJS API generator logic..ensureEndpointTypeIds) ⇒
    • [~ensureZclClusterSdkExtensions(context, templatePackageId)](#moduleJS API generator logic..ensureZclClusterSdkExtensions) ⇒
    • [~ensureZclDeviceTypeSdkExtensions(context, templatePackageId)](#moduleJS API generator logic..ensureZclDeviceTypeSdkExtensions) ⇒
    • [~ensureZclAttributeSdkExtensions(context, templatePackageId)](#moduleJS API generator logic..ensureZclAttributeSdkExtensions) ⇒
    • [~ensureZclAttributeTypeSdkExtensions(context, templatePackageId)](#moduleJS API generator logic..ensureZclAttributeTypeSdkExtensions) ⇒
    • [~ensureZclCommandSdkExtensions(context, templatePackageId)](#moduleJS API generator logic..ensureZclCommandSdkExtensions) ⇒
    • [~ensureZclEventSdkExtensions(context, templatePackageId)](#moduleJS API generator logic..ensureZclEventSdkExtensions) ⇒
    • [~templatePromise(global, promise)](#moduleJS API generator logic..templatePromise)
    • [~deprecatedHelper(fn, explanation)](#moduleJS API generator logic..deprecatedHelper) ⇒

JS API: generator logic~loadGenTemplateFromFile(path) ⇒

Given a path, it will read generation template object into memory.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Object that contains: data, crc, templateData

ParamType
path*

JS API: generator logic~recordTemplatesPackage(context) ⇒

Given a loading context, it records the package into the packages table and adds the packageId field into the resolved context.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with the same context passed in, except packageId added to it

ParamType
context*

JS API: generator logic~decodePackageExtensionEntity(entityType, entity) ⇒

This method takes extension data in JSON, and converts it into an object that contains: entityCode, entityQualifier, parentCode, manufacturerCode and value

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: object that can be used for database injection

ParamType
entityType*
entity*

JS API: generator logic~loadZclExtensions(zclExt) ⇒

Returns a promise that will load the zcl extensions.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Promise of loading the zcl extensions.

ParamType
zclExt*

JS API: generator logic~loadTemplates(db, genTemplatesJsonArray)

Api that loads an array of template JSON files or a single file if you just pass in one String.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)

ParamType
db*
genTemplatesJsonArray*

JS API: generator logic~loadSingleTemplate(db, genTemplatesJson) ⇒

Main API async function to load templates from a gen-template.json file.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: the loading context, contains: db, path, crc, packageId and templateData, or error

ParamTypeDescription
db*Database
genTemplatesJson*Path to the JSON file or an array of paths to JSON file

JS API: generator logic~generateAllTemplates(genResult, genTemplateJsonPkg, generateOnly) ⇒

Generates all the templates inside a toplevel package.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Promise that resolves with genResult, that contains all the generated templates, keyed by their ‘output’

ParamTypeDescription
genResult*
genTemplateJsonPkg*Package that points to genTemplate.json file
generateOnly*if NULL then generate all templates, else only generate template whose out file name matches this.

JS API: generator logic~generateSingleTemplate(genResult, singleTemplatePkg) ⇒

Function that generates a single package and adds it to the generation result.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with the genResult, with newly generated content added.

ParamTypeDescription
genResult*
singleTemplatePkg*Single template package.

JS API: generator logic~generate(db, packageId) ⇒

Main API async function to generate stuff.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Promise that resolves into a generation result.

ParamTypeDescription
db*Database
packageId*packageId Template package id. It can be either single template or gen template json.

JS API: generator logic~writeFileWithBackup(fileName, content, doBackup) ⇒

Promise to write out a file, optionally creating a backup.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise of a written file.

ParamType
fileName*
content*
doBackup*

JS API: generator logic~generateGenerationContent(genResult)

Returns a promise that resolves into a content that should be written out to gen result file.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)

ParamType
genResult*

JS API: generator logic~generateAndWriteFiles(db, sessionId, packageId, outputDirectory) ⇒

Generate files and write them into the given directory.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: a promise which will resolve when all the files are written.

ParamType
db*
sessionId*
packageId*
outputDirectory*

JS API: generator logic~postProcessGeneratedFiles(outputDirectory, genResult) ⇒

Executes post processing actions as defined by the gen-templates.json

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise of a dealt-with post processing actions

ParamType
outputDirectory*
genResult*

JS API: generator logic~contentIndexer(content)

This async function takes a string, and resolves a preview object out of it.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)

ParamTypeDescription
content*String to form into preview.

JS API: generator logic~generateSingleFileForPreview(db, sessionId, fileName) ⇒

Generates a single file and feeds it back for preview.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves into a preview object.

ParamType
db*
sessionId*
fileName*

JS API: generator logic~produceCompiledTemplate(singleTemplatePkg) ⇒

Resolves into a precompiled template, either from previous precompile or freshly compiled.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: templates

ParamType
singleTemplatePkg*

JS API: generator logic~produceContent(hb, metaInfo, db, sessionId, singlePkg, overridePath:) ⇒

Given db connection, session and a single template package, produce the output.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Promise that resolves with the ‘utf8’ string that contains the generated content.

ParamTypeDescription
hb*
metaInfo*
db*
sessionId*
singlePkg*
overridePath:*if passed, it provides a path to the override file that can override the overridable.js

JS API: generator logic~wrapOverridable(originalFn, overrideFn) ⇒

This function attemps to call override function, but if override function throws an exception, it calls the original function.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: result from override function, unless it throws an exception, in which case return result from original function.

ParamType
originalFn*
overrideFn*

JS API: generator logic~loadOverridable(genTemplatePackageId)

This function is responsible to load the overridable function container.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)

ParamType
genTemplatePackageId*

JS API: generator logic~loadPartial(path)

Function that loads the partials.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)

ParamType
path*

JS API: generator logic~loadHelper(helpers)

Function that loads the helpers.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)

ParamTypeDescription
helpers*a string path if value is passed through CLI, the nativeRequire() is leverage the native js function instead of webpack's special sauce. a required() module if invoked by backend js code. this is required to force webpack to resolve the included files as path will be difference after being packed for production.

JS API: generator logic~allBuiltInHelpers() ⇒

Returns an object that contains all the helper functions, keyed by their name

NOTE: This method is ONLY used for API testing. You should not use this method for any real work inside the engine or something.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Object containing all the helper functions.

JS API: generator logic~findHelperPackageByAlias(alias) ⇒

Given an alias, this method finds a builtin helper package by its alias.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Helper package or undefined if none was found.

ParamType
alias*

JS API: generator logic~initializeBuiltInHelpersForPackage()

Global helper initialization

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)

JS API: generator logic~hbInstance() ⇒

This method returns the correct instance for a given generation flow.

TBD: At this point it doesn‘t do anything yet, it’s just a central point to get the correct instance.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Instance of handlebars to be used.

JS API: generator logic~makeSynchronizablePromise(promise)

All promises used by the templates should be synchronizable.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)

ParamType
promise*

JS API: generator logic~collectBlocks(resultArray, options, context) ⇒

Helpful function that collects the individual blocks by using elements of an array as a context, executing promises for each, and collecting them into the outgoing string.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Promise that resolves with a content string.

ParamTypeDescription
resultArray*
options*Options passed from a block helper.
context*The context from within this was called.

JS API: generator logic~ensureZclPackageId(context) ⇒

Returns the promise that resolves with the ZCL properties package id.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with the package id.

ParamType
context*

JS API: generator logic~ensureZclPackageIds(context) ⇒

Returns the promise that resolves with all ZCL package id specific to current session.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with a list of package id.

ParamType
context*

JS API: generator logic~ensureTemplatePackageId(context) ⇒

Returns the promise that resolves with the ZCL properties package id.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with the package id.

ParamType
context*

JS API: generator logic~ensureEndpointTypeIds(context) ⇒

Populate the endpoint type ids into the global context.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: endpoint type ids

ParamType
context*

JS API: generator logic~ensureZclClusterSdkExtensions(context, templatePackageId) ⇒

Resolves with cached cluster extensions, but if they don't exist, it will populate them.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with cluster extensions.

ParamType
context*
templatePackageId*

JS API: generator logic~ensureZclDeviceTypeSdkExtensions(context, templatePackageId) ⇒

Resolves with cached cluster extensions, but if they don't exist, it will populate them.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with cluster extensions.

ParamType
context*
templatePackageId*

JS API: generator logic~ensureZclAttributeSdkExtensions(context, templatePackageId) ⇒

Resolves with cached attribute extensions, but if they don't exist, it will populate them.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with attribute extensions.

ParamType
context*
templatePackageId*

JS API: generator logic~ensureZclAttributeTypeSdkExtensions(context, templatePackageId) ⇒

Resolves with cached attribute type extensions, but if they don't exist, it will populate them.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with attribute type extensions.

ParamType
context*
templatePackageId*

JS API: generator logic~ensureZclCommandSdkExtensions(context, templatePackageId) ⇒

Resolves with cached command extensions, but if they don't exist, it will populate them.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with command extensions.

ParamType
context*
templatePackageId*

JS API: generator logic~ensureZclEventSdkExtensions(context, templatePackageId) ⇒

Resolves with cached command extensions, but if they don't exist, it will populate them.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with command extensions.

ParamType
context*
templatePackageId*

JS API: generator logic~templatePromise(global, promise)

Every helper that returns a promise, should not return the promise directly. So instead of returning the promise directly, it should return: return templatePromise(this.global, promise)

This will ensure that after tag works as expected.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)

ParamType
global*
promise*

JS API: generator logic~deprecatedHelper(fn, explanation) ⇒

Function wrapper that can be used when a helper is deprecated.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: a function that wraps the original function, with deprecation message.

ParamTypeDescription
fn*
explanation*can contain text, or from/to, or just be a string message itself.

Templating API: Access helpers

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

  • [Templating API: Access helpers](#moduleTemplating API Access helpers)
    • [~access_aggregate(options)](#moduleTemplating API Access helpers..access_aggregate)
    • [~access(options)](#moduleTemplating API Access helpers..access)

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](#moduleTemplating API Access helpers)

ParamType
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](#moduleTemplating API Access helpers)

ParamType
options*

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](#moduleTemplating API C formatting helpers)
    • [~asOffset(hex)](#moduleTemplating API C formatting helpers..asOffset)
    • [~asDelimitedMacro(label)](#moduleTemplating API C formatting helpers..asDelimitedMacro)
    • [~asHex(label)](#moduleTemplating API C formatting helpers..asHex) ⇒
    • [~asUnderlyingTypeHelper(dataType, context, packageIds)](#moduleTemplating API C formatting helpers..asUnderlyingTypeHelper) ⇒
    • [~asUnderlyingType(value)](#moduleTemplating API C formatting helpers..asUnderlyingType) ⇒
    • [~asType(label)](#moduleTemplating API C formatting helpers..asType) ⇒
    • [~asSymbol(label)](#moduleTemplating API C formatting helpers..asSymbol) ⇒
    • [~asBytes(value)](#moduleTemplating API C formatting helpers..asBytes)
    • [~asCamelCased(str)](#moduleTemplating API C formatting helpers..asCamelCased) ⇒
    • [~cleanseLabel(label)](#moduleTemplating API C formatting helpers..cleanseLabel)
    • [~asUnderscoreLowercase(str)](#moduleTemplating API C formatting helpers..asUnderscoreLowercase) ⇒
    • [~cleanseLabelAsKebabCase(label)](#moduleTemplating API C formatting helpers..cleanseLabelAsKebabCase)
    • [~asSpacedLowercase(str)](#moduleTemplating API C formatting helpers..asSpacedLowercase) ⇒
    • [~asUnderscoreUppercase(str)](#moduleTemplating API C formatting helpers..asUnderscoreUppercase) ⇒
    • [~asCliType(size, isSigned)](#moduleTemplating API C formatting helpers..asCliType) ⇒
    • [~as_zcl_cli_type(str, optional, isSigned)](#moduleTemplating API C formatting helpers..as_zcl_cli_type)
    • [~dataTypeForBitmap(db, bitmap_name, packageIds)](#moduleTemplating API C formatting helpers..dataTypeForBitmap)
    • [~dataTypeForEnum(db, enum_name, packageIds)](#moduleTemplating API C formatting helpers..dataTypeForEnum)
    • [~addOne(number)](#moduleTemplating API C formatting helpers..addOne)
    • [~is_number_greater_than(num1, num2)](#moduleTemplating API C formatting helpers..is_number_greater_than) ⇒
    • [~cluster_extension(options)](#moduleTemplating API C formatting helpers..cluster_extension) ⇒
    • [~device_type_extension(options)](#moduleTemplating API C formatting helpers..device_type_extension) ⇒
    • [~attribute_type_extension(options)](#moduleTemplating API C formatting helpers..attribute_type_extension) ⇒
    • [~attribute_extension(options)](#moduleTemplating API C formatting helpers..attribute_extension) ⇒
    • [~command_extension(options)](#moduleTemplating API C formatting helpers..command_extension) ⇒
    • [~event_extension(options)](#moduleTemplating 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](#moduleTemplating API C formatting helpers)

ParamType
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](#moduleTemplating API C formatting helpers)

ParamType
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](#moduleTemplating API C formatting helpers)
Returns: Label formatted as C hex constant.

ParamType
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](#moduleTemplating API C formatting helpers)
Returns: The appropriate C type for the given data type

ParamType
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](#moduleTemplating API C formatting helpers)
Returns: The appropriate C Type

ParamType
value*

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

Formats label as a C type.

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

ParamType
label*

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

Formats label as a C symbol.

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

ParamType
label*

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](#moduleTemplating API C formatting helpers)

ParamType
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](#moduleTemplating API C formatting helpers)
Returns: a spaced out string in lowercase

ParamType
str*

Templating API: C formatting helpers~cleanseLabel(label)

returns a string after converting ‘:’ and ‘-’ into ‘_’

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

ParamType
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](#moduleTemplating API C formatting helpers)
Returns: String in lowercase with underscores

ParamType
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](#moduleTemplating API C formatting helpers)

ParamType
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](#moduleTemplating API C formatting helpers)
Returns: a spaced out string in lowercase

ParamType
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](#moduleTemplating API C formatting helpers)
Returns: String in uppercase with underscores

ParamType
str*

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

Returns the cli type representation.

Kind: inner method of [Templating API: C formatting helpers](#moduleTemplating 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](#moduleTemplating API C formatting helpers)

ParamDescription
str
optional
isSignedReturn 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](#moduleTemplating API C formatting helpers)

ParamType
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](#moduleTemplating API C formatting helpers)

ParamType
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](#moduleTemplating API C formatting helpers)

ParamType
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](#moduleTemplating 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](#moduleTemplating API C formatting helpers)
Returns: Value of the cluster extension property.

ParamType
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](#moduleTemplating API C formatting helpers)
Returns: Value of the cluster extension property.

ParamType
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](#moduleTemplating API C formatting helpers)
Returns: Value of the attribute type extension property.

ParamType
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](#moduleTemplating API C formatting helpers)
Returns: Value of the attribute extension property.

ParamType
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](#moduleTemplating API C formatting helpers)
Returns: Value of the command extension property.

ParamType
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](#moduleTemplating API C formatting helpers)
Returns: Value of the command extension property.

ParamType
options*

Templating API: C formatting helpers

This module contains the API for accessing SDK extensions.

  • [Templating API: C formatting helpers](#moduleTemplating API C formatting helpers)
    • [~asOffset(hex)](#moduleTemplating API C formatting helpers..asOffset)
    • [~asDelimitedMacro(label)](#moduleTemplating API C formatting helpers..asDelimitedMacro)
    • [~asHex(label)](#moduleTemplating API C formatting helpers..asHex) ⇒
    • [~asUnderlyingTypeHelper(dataType, context, packageIds)](#moduleTemplating API C formatting helpers..asUnderlyingTypeHelper) ⇒
    • [~asUnderlyingType(value)](#moduleTemplating API C formatting helpers..asUnderlyingType) ⇒
    • [~asType(label)](#moduleTemplating API C formatting helpers..asType) ⇒
    • [~asSymbol(label)](#moduleTemplating API C formatting helpers..asSymbol) ⇒
    • [~asBytes(value)](#moduleTemplating API C formatting helpers..asBytes)
    • [~asCamelCased(str)](#moduleTemplating API C formatting helpers..asCamelCased) ⇒
    • [~cleanseLabel(label)](#moduleTemplating API C formatting helpers..cleanseLabel)
    • [~asUnderscoreLowercase(str)](#moduleTemplating API C formatting helpers..asUnderscoreLowercase) ⇒
    • [~cleanseLabelAsKebabCase(label)](#moduleTemplating API C formatting helpers..cleanseLabelAsKebabCase)
    • [~asSpacedLowercase(str)](#moduleTemplating API C formatting helpers..asSpacedLowercase) ⇒
    • [~asUnderscoreUppercase(str)](#moduleTemplating API C formatting helpers..asUnderscoreUppercase) ⇒
    • [~asCliType(size, isSigned)](#moduleTemplating API C formatting helpers..asCliType) ⇒
    • [~as_zcl_cli_type(str, optional, isSigned)](#moduleTemplating API C formatting helpers..as_zcl_cli_type)
    • [~dataTypeForBitmap(db, bitmap_name, packageIds)](#moduleTemplating API C formatting helpers..dataTypeForBitmap)
    • [~dataTypeForEnum(db, enum_name, packageIds)](#moduleTemplating API C formatting helpers..dataTypeForEnum)
    • [~addOne(number)](#moduleTemplating API C formatting helpers..addOne)
    • [~is_number_greater_than(num1, num2)](#moduleTemplating API C formatting helpers..is_number_greater_than) ⇒
    • [~cluster_extension(options)](#moduleTemplating API C formatting helpers..cluster_extension) ⇒
    • [~device_type_extension(options)](#moduleTemplating API C formatting helpers..device_type_extension) ⇒
    • [~attribute_type_extension(options)](#moduleTemplating API C formatting helpers..attribute_type_extension) ⇒
    • [~attribute_extension(options)](#moduleTemplating API C formatting helpers..attribute_extension) ⇒
    • [~command_extension(options)](#moduleTemplating API C formatting helpers..command_extension) ⇒
    • [~event_extension(options)](#moduleTemplating 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](#moduleTemplating API C formatting helpers)

ParamType
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](#moduleTemplating API C formatting helpers)

ParamType
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](#moduleTemplating API C formatting helpers)
Returns: Label formatted as C hex constant.

ParamType
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](#moduleTemplating API C formatting helpers)
Returns: The appropriate C type for the given data type

ParamType
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](#moduleTemplating API C formatting helpers)
Returns: The appropriate C Type

ParamType
value*

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

Formats label as a C type.

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

ParamType
label*

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

Formats label as a C symbol.

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

ParamType
label*

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](#moduleTemplating API C formatting helpers)

ParamType
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](#moduleTemplating API C formatting helpers)
Returns: a spaced out string in lowercase

ParamType
str*

Templating API: C formatting helpers~cleanseLabel(label)

returns a string after converting ‘:’ and ‘-’ into ‘_’

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

ParamType
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](#moduleTemplating API C formatting helpers)
Returns: String in lowercase with underscores

ParamType
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](#moduleTemplating API C formatting helpers)

ParamType
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](#moduleTemplating API C formatting helpers)
Returns: a spaced out string in lowercase

ParamType
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](#moduleTemplating API C formatting helpers)
Returns: String in uppercase with underscores

ParamType
str*

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

Returns the cli type representation.

Kind: inner method of [Templating API: C formatting helpers](#moduleTemplating 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](#moduleTemplating API C formatting helpers)

ParamDescription
str
optional
isSignedReturn 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](#moduleTemplating API C formatting helpers)

ParamType
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](#moduleTemplating API C formatting helpers)

ParamType
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](#moduleTemplating API C formatting helpers)

ParamType
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](#moduleTemplating 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](#moduleTemplating API C formatting helpers)
Returns: Value of the cluster extension property.

ParamType
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](#moduleTemplating API C formatting helpers)
Returns: Value of the cluster extension property.

ParamType
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](#moduleTemplating API C formatting helpers)
Returns: Value of the attribute type extension property.

ParamType
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](#moduleTemplating API C formatting helpers)
Returns: Value of the attribute extension property.

ParamType
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](#moduleTemplating API C formatting helpers)
Returns: Value of the command extension property.

ParamType
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](#moduleTemplating API C formatting helpers)
Returns: Value of the command extension property.

ParamType
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](#moduleTemplating API user-data specific helpers)
    • [~user_endpoints(options)](#moduleTemplating API user-data specific helpers..user_endpoints)
    • [~user_endpoint_types(options)](#moduleTemplating API user-data specific helpers..user_endpoint_types)
    • [~user_clusters(options)](#moduleTemplating API user-data specific helpers..user_clusters)
    • [~user_cluster_attributes(options)](#moduleTemplating API user-data specific helpers..user_cluster_attributes) ⇒
    • [~user_cluster_commands(options)](#moduleTemplating API user-data specific helpers..user_cluster_commands) ⇒
    • [~user_cluster_events(options)](#moduleTemplating API user-data specific helpers..user_cluster_events) ⇒
    • [~user_endpoint_count_by_cluster(clusterTypeId)](#moduleTemplating API user-data specific helpers..user_endpoint_count_by_cluster) ⇒
    • [~user_all_attributes(options)](#moduleTemplating API user-data specific helpers..user_all_attributes) ⇒
    • [~all_user_cluster_commands(options)](#moduleTemplating API user-data specific helpers..all_user_cluster_commands) ⇒
    • [~all_user_cluster_command_util(name, side, options, currentContext, isManufacturingSpecific, isIrrespectiveOfManufacturingSpecification)](#moduleTemplating API user-data specific helpers..all_user_cluster_command_util)
    • [~all_user_cluster_manufacturer_specific_commands(options)](#moduleTemplating API user-data specific helpers..all_user_cluster_manufacturer_specific_commands) ⇒
    • [~all_user_cluster_non_manufacturer_specific_commands(options)](#moduleTemplating API user-data specific helpers..all_user_cluster_non_manufacturer_specific_commands) ⇒
    • [~all_user_cluster_manufacturer_specific_attributes(options)](#moduleTemplating API user-data specific helpers..all_user_cluster_manufacturer_specific_attributes) ⇒
    • [~all_user_cluster_non_manufacturer_specific_attributes(options)](#moduleTemplating API user-data specific helpers..all_user_cluster_non_manufacturer_specific_attributes) ⇒
    • [~all_commands_for_user_enabled_clusters(options)](#moduleTemplating API user-data specific helpers..all_commands_for_user_enabled_clusters) ⇒
    • [~all_cli_commands_for_user_enabled_clusters(options)](#moduleTemplating API user-data specific helpers..all_cli_commands_for_user_enabled_clusters) ⇒
    • [~all_user_clusters(options)](#moduleTemplating API user-data specific helpers..all_user_clusters) ⇒
    • [~all_user_clusters_irrespective_of_side(options)](#moduleTemplating API user-data specific helpers..all_user_clusters_irrespective_of_side) ⇒
    • [~all_user_clusters_names(options)](#moduleTemplating API user-data specific helpers..all_user_clusters_names) ⇒
    • [~user_cluster_command_count_with_cli()](#moduleTemplating API user-data specific helpers..user_cluster_command_count_with_cli)
    • [~user_cluster_commands_with_cli()](#moduleTemplating API user-data specific helpers..user_cluster_commands_with_cli)
    • [~user_cluster_commands_all_endpoints(options)](#moduleTemplating API user-data specific helpers..user_cluster_commands_all_endpoints)
    • [~user_cluster_has_enabled_command(name, side)](#moduleTemplating API user-data specific helpers..user_cluster_has_enabled_command) ⇒
    • [~all_user_cluster_commands_irrespective_of_manufaturing_specification(options)](#moduleTemplating API user-data specific helpers..all_user_cluster_commands_irrespective_of_manufaturing_specification) ⇒
    • [~enabled_attributes_for_cluster_and_side(name, side, options)](#moduleTemplating API user-data specific helpers..enabled_attributes_for_cluster_and_side) ⇒
    • [~user_session_key(options)](#moduleTemplating API user-data specific helpers..user_session_key) ⇒
    • [~if_command_discovery_enabled()](#moduleTemplating API user-data specific helpers..if_command_discovery_enabled)
    • [~is_command_default_response_enabled(command, options)](#moduleTemplating API user-data specific helpers..is_command_default_response_enabled) ⇒
    • [~is_command_default_response_disabled(command, options)](#moduleTemplating API user-data specific helpers..is_command_default_response_disabled) ⇒
    • [~all_user_cluster_attributes_for_generated_defaults(name, side, options)](#moduleTemplating API user-data specific helpers..all_user_cluster_attributes_for_generated_defaults) ⇒
    • [~all_user_cluster_generated_attributes(options)](#moduleTemplating API user-data specific helpers..all_user_cluster_generated_attributes) ⇒
    • [~all_user_reportable_attributes(options)](#moduleTemplating API user-data specific helpers..all_user_reportable_attributes) ⇒
    • [~all_user_cluster_generated_commands(options)](#moduleTemplating API user-data specific helpers..all_user_cluster_generated_commands) ⇒
    • [~all_user_clusters_with_incoming_or_outgoing_commands(options, is_incoming)](#moduleTemplating API user-data specific helpers..all_user_clusters_with_incoming_or_outgoing_commands) ⇒
    • [~all_user_clusters_with_incoming_commands(options)](#moduleTemplating API user-data specific helpers..all_user_clusters_with_incoming_commands) ⇒
    • [~all_user_clusters_with_outgoing_commands(options)](#moduleTemplating API user-data specific helpers..all_user_clusters_with_outgoing_commands) ⇒
    • [~manufacturing_clusters_with_incoming_commands(clusterCode, options)](#moduleTemplating API user-data specific helpers..manufacturing_clusters_with_incoming_commands) ⇒
    • [~all_user_clusters_with_incoming_commands_combined(options)](#moduleTemplating API user-data specific helpers..all_user_clusters_with_incoming_commands_combined) ⇒
    • [~all_incoming_commands_for_cluster_combined(clusterName, clientSide, serverSide, options)](#moduleTemplating API user-data specific helpers..all_incoming_commands_for_cluster_combined) ⇒
    • [~all_incoming_or_outgoing_commands_for_cluster(clusterName, clusterSide, isIncoming, options)](#moduleTemplating API user-data specific helpers..all_incoming_or_outgoing_commands_for_cluster) ⇒
    • [~all_incoming_commands_for_cluster(clusterName, options)](#moduleTemplating API user-data specific helpers..all_incoming_commands_for_cluster) ⇒
    • [~all_outgoing_commands_for_cluster(clusterName, options)](#moduleTemplating API user-data specific helpers..all_outgoing_commands_for_cluster) ⇒
    • [~generated_clustes_details(options)](#moduleTemplating API user-data specific helpers..generated_clustes_details) ⇒
    • [~generated_endpoint_type_details(options)](#moduleTemplating API user-data specific helpers..generated_endpoint_type_details) ⇒
    • [~all_user_cluster_attributes_min_max_defaults(name, side, options)](#moduleTemplating API user-data specific helpers..all_user_cluster_attributes_min_max_defaults) ⇒
    • [~checkAttributeMatch(clusterName, attributeName, attributeSide, attributeValue, attributeValueType, endpointAttributes)](#moduleTemplating API user-data specific helpers..checkAttributeMatch) ⇒
    • [~generated_defaults_index(clusterName, attributeName, attributeValueType, attributeValue, prefixReturn, postFixReturn)](#moduleTemplating API user-data specific helpers..generated_defaults_index) ⇒
    • [~generated_default_index(clusterName, attributeName, attributeSide, attributeValueType, attributeValue, prefixReturn, postFixReturn)](#moduleTemplating API user-data specific helpers..generated_default_index) ⇒
    • [~generated_attributes_min_max_index(name, side, options)](#moduleTemplating API user-data specific helpers..generated_attributes_min_max_index) ⇒
    • [~generated_attribute_min_max_index(clusterName, attributeName, attributeSide, options)](#moduleTemplating API user-data specific helpers..generated_attribute_min_max_index) ⇒

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](#moduleTemplating API user-data specific helpers)

ParamType
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](#moduleTemplating API user-data specific helpers)

ParamType
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](#moduleTemplating API user-data specific helpers)

ParamType
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](#moduleTemplating API user-data specific helpers)
Returns: Promise of the resolved blocks iterating over cluster attributes.

ParamType
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](#moduleTemplating API user-data specific helpers)
Returns: Promise of the resolved blocks iterating over cluster commands.

ParamType
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](#moduleTemplating API user-data specific helpers)
Returns: Promise of the resolved blocks iterating over cluster events.

ParamType
options*

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](#moduleTemplating API user-data specific helpers)
Returns: Promise of the number of endpoint

ParamType
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](#moduleTemplating API user-data specific helpers)
Returns: Promise of the resolved blocks iterating over cluster commands.

ParamType
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](#moduleTemplating API user-data specific helpers)
Returns: Promise of the resolved blocks iterating over cluster commands.

ParamType
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](#moduleTemplating API user-data specific helpers)

ParamDefaultDescription
name
side
options
currentContext
isManufacturingSpecific
isIrrespectiveOfManufacturingSpecificationfalseReturns: 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_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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating API user-data specific helpers)
Returns: Promise of the resolved blocks iterating over cluster commands.

ParamType
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](#moduleTemplating 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](#moduleTemplating API user-data specific helpers)
Returns: Promise of the resolved blocks iterating over cluster commands.

ParamType
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](#moduleTemplating API user-data specific helpers)
Returns: Promise of the resolved blocks iterating over cluster commands.

ParamType
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](#moduleTemplating API user-data specific helpers)
Returns: Promise of the resolved blocks iterating over cluster commands.

ParamType
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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating API user-data specific helpers)

ParamDescription
optionsReturns: 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](#moduleTemplating API user-data specific helpers)
Returns: True if cluster has enabled commands otherwise false

ParamTypeDescription
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](#moduleTemplating 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 manufacturing-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](#moduleTemplating 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](#moduleTemplating API user-data specific helpers)
Returns: Promise of value of the session key or undefined.

ParamType
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](#moduleTemplating API user-data specific helpers)

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](#moduleTemplating 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)

ParamType
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](#moduleTemplating 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).

ParamType
command*
options*

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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating API user-data specific helpers)
Returns: All clusters with side that have available incoming or outgiong commands across all endpoints.

ParamDescription
options
is_incomingboolean 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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_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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating API user-data specific helpers)
Returns: Cluster Details per endpoint with attribute summaries within the clusters

ParamType
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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating API user-data specific helpers)
Returns: index of the generated min max default in the array

Param
clusterName
attributeName
attributeSide
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](#moduleTemplating API toplevel utility helpers)
    • [~zap_header()](#moduleTemplating API toplevel utility helpers..zap_header) ⇒
    • [~ident()](#moduleTemplating API toplevel utility helpers..ident) ⇒
    • [~template_options(category, options)](#moduleTemplating API toplevel utility helpers..template_options)
    • [~first(options)](#moduleTemplating API toplevel utility helpers..first) ⇒
    • [~not_first(options)](#moduleTemplating API toplevel utility helpers..not_first) ⇒
    • [~last(options)](#moduleTemplating API toplevel utility helpers..last) ⇒
    • [~not_last(optionms)](#moduleTemplating API toplevel utility helpers..not_last) ⇒
    • [~middle(options)](#moduleTemplating API toplevel utility helpers..middle) ⇒
    • [~template_option_with_code(options, key)](#moduleTemplating API toplevel utility helpers..template_option_with_code)
    • [~fail(options)](#moduleTemplating API toplevel utility helpers..fail)
    • [~isEqual(string_a, string_b)](#moduleTemplating API toplevel utility helpers..isEqual)
    • [~is_lowercase_equal(string_a, string_b)](#moduleTemplating API toplevel utility helpers..is_lowercase_equal)
    • [~trim_string(str)](#moduleTemplating API toplevel utility helpers..trim_string) ⇒
    • [~asLastWord(str)](#moduleTemplating API toplevel utility helpers..asLastWord)
    • [~iterate()](#moduleTemplating API toplevel utility helpers..iterate)
    • [~concatenate()](#moduleTemplating API toplevel utility helpers..concatenate)
    • [~is_num_equal(numA, numB)](#moduleTemplating API toplevel utility helpers..is_num_equal) ⇒
    • [~is_defined(value)](#moduleTemplating API toplevel utility helpers..is_defined) ⇒
    • [~replace_string(mainString, replaceString, replaceWithString)](#moduleTemplating API toplevel utility helpers..replace_string) ⇒
    • [~add_prefix_to_all_strings(str, prefixStr)](#moduleTemplating API toplevel utility helpers..add_prefix_to_all_strings) ⇒
    • [~multiply()](#moduleTemplating API toplevel utility helpers..multiply) ⇒
    • [~is_string_underscored(val)](#moduleTemplating API toplevel utility helpers..is_string_underscored) ⇒
    • [~as_uppercase(val)](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating API toplevel utility helpers)
Returns: whitespace that is the identation.

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](#moduleTemplating API toplevel utility helpers)

ParamType
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](#moduleTemplating API toplevel utility helpers)
Returns: content, if it's the first element inside an operator, empty otherwise.

ParamType
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](#moduleTemplating API toplevel utility helpers)
Returns: content, if it's the first element inside an operator, empty otherwise.

ParamType
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](#moduleTemplating API toplevel utility helpers)
Returns: content, if it's the last element inside an operator, empty otherwise.

ParamType
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](#moduleTemplating API toplevel utility helpers)
Returns: content, if it's not the last element inside a block, empty otherwise.

ParamType
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](#moduleTemplating API toplevel utility helpers)
Returns: content, if it's the middle element inside an operator, empty otherwise.

ParamType
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](#moduleTemplating API toplevel utility helpers)

ParamType
options*
key*

Templating API: toplevel utility helpers~fail(options)

Forced fail halper.

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

ParamType
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](#moduleTemplating API toplevel utility helpers)

ParamType
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](#moduleTemplating API toplevel utility helpers)

ParamType
string_a*
string_b*

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](#moduleTemplating API toplevel utility helpers)
Returns: A string with no leading and trailing spaces

ParamType
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](#moduleTemplating API toplevel utility helpers)

ParamType
str*

Templating API: toplevel utility helpers~iterate()

Iteration block.

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

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](#moduleTemplating API toplevel utility helpers)

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

Kind: inner method of [Templating API: toplevel utility helpers](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating API toplevel utility helpers)
Returns: true if a string has an underscore in it

ParamType
val*

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

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

ParamType
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](#moduleTemplating API static zcl helpers)
    • [~zcl_bitmaps(options)](#moduleTemplating API static zcl helpers..zcl_bitmaps) ⇒
    • [~zcl_bitmap_items(options)](#moduleTemplating API static zcl helpers..zcl_bitmap_items)
    • [~zcl_enums(options)](#moduleTemplating API static zcl helpers..zcl_enums) ⇒
    • [~zcl_structs(options)](#moduleTemplating API static zcl helpers..zcl_structs) ⇒
    • [~zcl_enum_items(options)](#moduleTemplating API static zcl helpers..zcl_enum_items)
    • [~first_unused_enum_value(options)](#moduleTemplating API static zcl helpers..first_unused_enum_value) ⇒
    • [~zcl_struct_items(options)](#moduleTemplating API static zcl helpers..zcl_struct_items) ⇒
    • [~zcl_struct_items_by_struct_name(name, options)](#moduleTemplating API static zcl helpers..zcl_struct_items_by_struct_name) ⇒
    • [~zcl_device_types(options)](#moduleTemplating API static zcl helpers..zcl_device_types) ⇒
    • [~zcl_device_type_clusters(options)](#moduleTemplating API static zcl helpers..zcl_device_type_clusters) ⇒
    • [~zcl_device_type_cluster_commands(options)](#moduleTemplating API static zcl helpers..zcl_device_type_cluster_commands) ⇒
    • [~zcl_device_type_cluster_attributes(options)](#moduleTemplating API static zcl helpers..zcl_device_type_cluster_attributes) ⇒
    • [~zcl_clusters(options)](#moduleTemplating API static zcl helpers..zcl_clusters) ⇒
    • [~zcl_commands(options)](#moduleTemplating API static zcl helpers..zcl_commands) ⇒
    • [~zcl_commands_with_cluster_info(options)](#moduleTemplating API static zcl helpers..zcl_commands_with_cluster_info) ⇒
    • [~zcl_commands_with_arguments(options)](#moduleTemplating API static zcl helpers..zcl_commands_with_arguments)
    • [~zcl_commands_source_client(options)](#moduleTemplating API static zcl helpers..zcl_commands_source_client) ⇒
    • [~zcl_commands_source_server(options)](#moduleTemplating API static zcl helpers..zcl_commands_source_server) ⇒
    • [~zcl_events(options)](#moduleTemplating API static zcl helpers..zcl_events) ⇒
    • [~zcl_command_tree(options)](#moduleTemplating API static zcl helpers..zcl_command_tree) ⇒
    • [~zcl_global_commands(options)](#moduleTemplating API static zcl helpers..zcl_global_commands) ⇒
    • [~zcl_attributes(options)](#moduleTemplating API static zcl helpers..zcl_attributes) ⇒
    • [~zcl_attributes_client(options)](#moduleTemplating API static zcl helpers..zcl_attributes_client) ⇒
    • [~zcl_attributes_server(options)](#moduleTemplating API static zcl helpers..zcl_attributes_server) ⇒
    • [~zcl_atomics(options)](#moduleTemplating API static zcl helpers..zcl_atomics) ⇒
    • [~zcl_cluster_largest_label_length()](#moduleTemplating API static zcl helpers..zcl_cluster_largest_label_length) ⇒
    • [~largestLabelLength(An)](#moduleTemplating API static zcl helpers..largestLabelLength) ⇒
    • [~zcl_command_arguments_count(commandId)](#moduleTemplating API static zcl helpers..zcl_command_arguments_count) ⇒
    • [~ifCommandArgumentsHaveFixedLengthWithCurrentContext(commandId, fixedLengthReturn, notFixedLengthReturn, currentContext)](#moduleTemplating API static zcl helpers..ifCommandArgumentsHaveFixedLengthWithCurrentContext)
    • [~if_command_arguments_have_fixed_length(commandId, fixedLengthReturn, notFixedLengthReturn)](#moduleTemplating 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)](#moduleTemplating 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)](#moduleTemplating API static zcl helpers..as_underlying_zcl_type_if_command_is_not_fixed_length)
    • [~command_arguments_total_length(commandId)](#moduleTemplating API static zcl helpers..command_arguments_total_length)
    • [~zcl_command_arguments(options)](#moduleTemplating API static zcl helpers..zcl_command_arguments) ⇒
    • [~zcl_event_fields(options)](#moduleTemplating API static zcl helpers..zcl_event_fields)
    • [~zcl_command_argument_data_type(typeName, options)](#moduleTemplating API static zcl helpers..zcl_command_argument_data_type)
    • [~asUnderlyingZclType(typeName, options)](#moduleTemplating API static zcl helpers..asUnderlyingZclType)
    • [~zcl_string_type_return(type, options)](#moduleTemplating API static zcl helpers..zcl_string_type_return)
    • [~is_zcl_string(type)](#moduleTemplating API static zcl helpers..is_zcl_string)
    • [~if_is_number(type)](#moduleTemplating API static zcl helpers..if_is_number) ⇒
    • [~if_is_string(type)](#moduleTemplating API static zcl helpers..if_is_string) ⇒
    • [~if_is_char_string(type)](#moduleTemplating API static zcl helpers..if_is_char_string) ⇒
    • [~if_is_octet_string(type)](#moduleTemplating API static zcl helpers..if_is_octet_string) ⇒
    • [~if_is_short_string(type)](#moduleTemplating API static zcl helpers..if_is_short_string) ⇒
    • [~if_is_long_string(type)](#moduleTemplating API static zcl helpers..if_is_long_string) ⇒
    • [~if_is_atomic(type:)](#moduleTemplating API static zcl helpers..if_is_atomic) ⇒
    • [~if_is_bitmap(type)](#moduleTemplating API static zcl helpers..if_is_bitmap) ⇒
    • [~if_is_enum(type)](#moduleTemplating API static zcl helpers..if_is_enum) ⇒
    • [~if_is_struct(type)](#moduleTemplating API static zcl helpers..if_is_struct) ⇒
    • [~isClient(side)](#moduleTemplating API static zcl helpers..isClient) ⇒
    • [~isServer(side)](#moduleTemplating API static zcl helpers..isServer) ⇒
    • [~as_underlying_zcl_type_command_argument_always_present(type:, commandId:, appendString:, introducedInRef:, removedInRef:, presentIf:, options:)](#moduleTemplating API static zcl helpers..as_underlying_zcl_type_command_argument_always_present) ⇒
    • [~if_command_argument_always_present(commandId, introducedInRef, removedInRef, presentIf, argumentPresentReturn, argumentNotPresentReturn)](#moduleTemplating 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:)](#moduleTemplating 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)](#moduleTemplating 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)](#moduleTemplating 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:)](#moduleTemplating 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)](#moduleTemplating 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)](#moduleTemplating 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:)](#moduleTemplating 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)](#moduleTemplating 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)](#moduleTemplating API static zcl helpers..if_command_argument_always_present_with_presentif) ⇒
    • [~if_manufacturing_specific_cluster(clusterId, manufacturer_specific_return, null_manufacturer_specific_return)](#moduleTemplating API static zcl helpers..if_manufacturing_specific_cluster) ⇒
    • [~if_mfg_specific_cluster(clusterId, options)](#moduleTemplating API static zcl helpers..if_mfg_specific_cluster) ⇒
    • [~as_generated_default_macro(value, attributeSize, options)](#moduleTemplating API static zcl helpers..as_generated_default_macro) ⇒
    • [~attribute_mask(writable, storageOption, minMax, mfgSpecific, clusterCode, client, isSingleton, prefixString, postfixString)](#moduleTemplating API static zcl helpers..attribute_mask) ⇒
    • [~command_mask(commmandSource, clusterSide, isIncomingEnabled, isOutgoingEnabled, manufacturingCode, prefixForMask)](#moduleTemplating API static zcl helpers..command_mask) ⇒
    • [~command_mask_sub_helper(commandMask, str)](#moduleTemplating API static zcl helpers..command_mask_sub_helper) ⇒
    • [~format_zcl_string_as_characters_for_generated_defaults(stringVal, sizeOfString)](#moduleTemplating API static zcl helpers..format_zcl_string_as_characters_for_generated_defaults) ⇒
    • [~as_type_min_value(type, options)](#moduleTemplating API static zcl helpers..as_type_min_value) ⇒
    • [~as_type_max_value(type, options)](#moduleTemplating API static zcl helpers..as_type_max_value) ⇒
    • [~structs_with_clusters(options)](#moduleTemplating API static zcl helpers..structs_with_clusters)
    • [~as_zcl_type_size(type, options)](#moduleTemplating API static zcl helpers..as_zcl_type_size) ⇒
    • [~if_compare(leftValue, rightValue, options)](#moduleTemplating API static zcl helpers..if_compare) ⇒ Object
    • [~if_is_data_type_signed(type, clusterId, options)](#moduleTemplating API static zcl helpers..if_is_data_type_signed) ⇒
    • [~as_zcl_data_type_size(type, clusterId, options)](#moduleTemplating 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](#moduleTemplating API static zcl helpers)
Returns: Promise of content.

ParamType
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](#moduleTemplating API static zcl helpers)

ParamType
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](#moduleTemplating API static zcl helpers)
Returns: Promise of content.

ParamType
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](#moduleTemplating API static zcl helpers)
Returns: Promise of content.

ParamType
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](#moduleTemplating API static zcl helpers)

ParamType
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](#moduleTemplating API static zcl helpers)
Returns: the unused enum value

ParamType
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](#moduleTemplating API static zcl helpers)
Returns: Promise of content.

ParamType
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](#moduleTemplating API static zcl helpers)
Returns: Promise of content.

Param
name
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](#moduleTemplating API static zcl helpers)
Returns: Promise of content.

ParamType
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](#moduleTemplating API static zcl helpers)
Returns: blocks for clusters

ParamType
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](#moduleTemplating API static zcl helpers)
Returns: blocks for commands

ParamType
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](#moduleTemplating API static zcl helpers)
Returns: blocks for attributes

ParamType
options*

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

Block helper iterating over all clusters.

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

ParamType
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](#moduleTemplating API static zcl helpers)
Returns: Promise of content.

ParamType
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](#moduleTemplating API static zcl helpers)
Returns: Promise of content.

ParamType
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](#moduleTemplating API static zcl helpers)

ParamType
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](#moduleTemplating API static zcl helpers)
Returns: Promise of content.

ParamType
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](#moduleTemplating API static zcl helpers)
Returns: Promise of content.

ParamType
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](#moduleTemplating API static zcl helpers)
Returns: Promise of content.

ParamType
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](#moduleTemplating API static zcl helpers)
Returns: Promise of content.

ParamType
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](#moduleTemplating API static zcl helpers)
Returns: Promise of global command iteration.

ParamType
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](#moduleTemplating API static zcl helpers)
Returns: Promise of attribute iteration.

ParamType
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](#moduleTemplating API static zcl helpers)
Returns: Promise of attribute iteration.

ParamType
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](#moduleTemplating API static zcl helpers)
Returns: Promise of attribute iteration.

ParamType
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](#moduleTemplating API static zcl helpers)
Returns: Promise of content.

ParamType
options*

Templating API: static zcl helpers~zcl_cluster_largest_label_length() ⇒

Given: N/A

Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating 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](#moduleTemplating API static zcl helpers)
Returns: the length of largest object name in an array. Helper for zcl_cluster_largest_label_length

ParamTypeDescription
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](#moduleTemplating API static zcl helpers)
Returns: Number of command arguments as an integer

ParamType
commandId*

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

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

ParamDescription
commandId
fixedLengthReturn
notFixedLengthReturn
currentContextReturns 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](#moduleTemplating API static zcl helpers)

ParamDescription
commandId
fixedLengthReturn
notFixedLengthReturnReturns 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](#moduleTemplating 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](#moduleTemplating API static zcl helpers)

ParamDescription
type
commandId
appendString
optionsReturns: 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](#moduleTemplating API static zcl helpers)

ParamDescription
commandIdReturns 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](#moduleTemplating API static zcl helpers)
Returns: Promise of command argument iteration.

ParamType
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](#moduleTemplating API static zcl helpers)

ParamType
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](#moduleTemplating API static zcl helpers)

ParamType
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](#moduleTemplating API static zcl helpers)

ParamTypeDescription
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](#moduleTemplating API static zcl helpers)

ParamDescription
type
optionsReturns 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](#moduleTemplating API static zcl helpers)

ParamDescription
typeReturn: 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](#moduleTemplating API static zcl helpers)
Returns: Promise of content.

ParamType
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](#moduleTemplating API static zcl helpers)
Returns: Promise of content.

ParamType
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](#moduleTemplating API static zcl helpers)
Returns: Promise of content.

ParamType
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](#moduleTemplating API static zcl helpers)
Returns: Promise of content.

ParamType
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](#moduleTemplating API static zcl helpers)
Returns: Promise of content.

ParamType
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](#moduleTemplating API static zcl helpers)
Returns: Promise of content.

ParamType
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](#moduleTemplating API static zcl helpers)
Returns: Promise of content.

ParamTypeDescription
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](#moduleTemplating API static zcl helpers)
Returns: Promise of content.

ParamType
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](#moduleTemplating API static zcl helpers)
Returns: Promise of content.

ParamType
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](#moduleTemplating 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](#moduleTemplating API static zcl helpers)
Returns: boolean

ParamType
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](#moduleTemplating API static zcl helpers)
Returns: boolean

ParamType
side*

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](#moduleTemplating 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.

ParamDescription
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](#moduleTemplating 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](#moduleTemplating 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.

ParamDescription
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](#moduleTemplating 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.

ParamDescription
commandArgcommand argument
appendStringappend the string to the argument
optionsoptions 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](#moduleTemplating 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](#moduleTemplating 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.

ParamDescription
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](#moduleTemplating 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.

ParamDescription
commandArgcommand argument
appendStringappend the string to the argument
optionsoptions 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](#moduleTemplating 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](#moduleTemplating 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.

ParamDescription
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](#moduleTemplating 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.

ParamDescription
commandArgcommand argument
appendStringappend the string to the argument
optionsoptions 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](#moduleTemplating 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](#moduleTemplating 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.

ParamType
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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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.
ParamType
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](#moduleTemplating 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.
ParamType
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](#moduleTemplating API static zcl helpers)

ParamTypeDescription
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](#moduleTemplating API static zcl helpers)
Returns: size of zcl type

ParamType
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](#moduleTemplating 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)

ParamType
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.

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

ParamType
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 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](#moduleTemplating API static zcl helpers)
Returns: size of the data type

ParamType
type*
clusterId*
options*

Templating API: Overridable functions.

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

JS API: generator logic

  • [JS API: generator logic](#moduleJS API generator logic)
    • [~loadGenTemplateFromFile(path)](#moduleJS API generator logic..loadGenTemplateFromFile) ⇒
    • [~recordTemplatesPackage(context)](#moduleJS API generator logic..recordTemplatesPackage) ⇒
    • [~decodePackageExtensionEntity(entityType, entity)](#moduleJS API generator logic..decodePackageExtensionEntity) ⇒
    • [~loadZclExtensions(zclExt)](#moduleJS API generator logic..loadZclExtensions) ⇒
    • [~loadTemplates(db, genTemplatesJsonArray)](#moduleJS API generator logic..loadTemplates)
    • [~loadSingleTemplate(db, genTemplatesJson)](#moduleJS API generator logic..loadSingleTemplate) ⇒
    • [~generateAllTemplates(genResult, genTemplateJsonPkg, generateOnly)](#moduleJS API generator logic..generateAllTemplates) ⇒
    • [~generateSingleTemplate(genResult, singleTemplatePkg)](#moduleJS API generator logic..generateSingleTemplate) ⇒
    • [~generate(db, packageId)](#moduleJS API generator logic..generate) ⇒
    • [~writeFileWithBackup(fileName, content, doBackup)](#moduleJS API generator logic..writeFileWithBackup) ⇒
    • [~generateGenerationContent(genResult)](#moduleJS API generator logic..generateGenerationContent)
    • [~generateAndWriteFiles(db, sessionId, packageId, outputDirectory)](#moduleJS API generator logic..generateAndWriteFiles) ⇒
    • [~postProcessGeneratedFiles(outputDirectory, genResult)](#moduleJS API generator logic..postProcessGeneratedFiles) ⇒
    • [~contentIndexer(content)](#moduleJS API generator logic..contentIndexer)
    • [~generateSingleFileForPreview(db, sessionId, fileName)](#moduleJS API generator logic..generateSingleFileForPreview) ⇒
    • [~produceCompiledTemplate(singleTemplatePkg)](#moduleJS API generator logic..produceCompiledTemplate) ⇒
    • [~produceContent(hb, metaInfo, db, sessionId, singlePkg, overridePath:)](#moduleJS API generator logic..produceContent) ⇒
    • [~wrapOverridable(originalFn, overrideFn)](#moduleJS API generator logic..wrapOverridable) ⇒
    • [~loadOverridable(genTemplatePackageId)](#moduleJS API generator logic..loadOverridable)
    • [~loadPartial(path)](#moduleJS API generator logic..loadPartial)
    • [~loadHelper(helpers)](#moduleJS API generator logic..loadHelper)
    • [~allBuiltInHelpers()](#moduleJS API generator logic..allBuiltInHelpers) ⇒
    • [~findHelperPackageByAlias(alias)](#moduleJS API generator logic..findHelperPackageByAlias) ⇒
    • [~initializeBuiltInHelpersForPackage()](#moduleJS API generator logic..initializeBuiltInHelpersForPackage)
    • [~hbInstance()](#moduleJS API generator logic..hbInstance) ⇒
    • [~makeSynchronizablePromise(promise)](#moduleJS API generator logic..makeSynchronizablePromise)
    • [~collectBlocks(resultArray, options, context)](#moduleJS API generator logic..collectBlocks) ⇒
    • [~ensureZclPackageId(context)](#moduleJS API generator logic..ensureZclPackageId) ⇒
    • [~ensureZclPackageIds(context)](#moduleJS API generator logic..ensureZclPackageIds) ⇒
    • [~ensureTemplatePackageId(context)](#moduleJS API generator logic..ensureTemplatePackageId) ⇒
    • [~ensureEndpointTypeIds(context)](#moduleJS API generator logic..ensureEndpointTypeIds) ⇒
    • [~ensureZclClusterSdkExtensions(context, templatePackageId)](#moduleJS API generator logic..ensureZclClusterSdkExtensions) ⇒
    • [~ensureZclDeviceTypeSdkExtensions(context, templatePackageId)](#moduleJS API generator logic..ensureZclDeviceTypeSdkExtensions) ⇒
    • [~ensureZclAttributeSdkExtensions(context, templatePackageId)](#moduleJS API generator logic..ensureZclAttributeSdkExtensions) ⇒
    • [~ensureZclAttributeTypeSdkExtensions(context, templatePackageId)](#moduleJS API generator logic..ensureZclAttributeTypeSdkExtensions) ⇒
    • [~ensureZclCommandSdkExtensions(context, templatePackageId)](#moduleJS API generator logic..ensureZclCommandSdkExtensions) ⇒
    • [~ensureZclEventSdkExtensions(context, templatePackageId)](#moduleJS API generator logic..ensureZclEventSdkExtensions) ⇒
    • [~templatePromise(global, promise)](#moduleJS API generator logic..templatePromise)
    • [~deprecatedHelper(fn, explanation)](#moduleJS API generator logic..deprecatedHelper) ⇒

JS API: generator logic~loadGenTemplateFromFile(path) ⇒

Given a path, it will read generation template object into memory.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Object that contains: data, crc, templateData

ParamType
path*

JS API: generator logic~recordTemplatesPackage(context) ⇒

Given a loading context, it records the package into the packages table and adds the packageId field into the resolved context.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with the same context passed in, except packageId added to it

ParamType
context*

JS API: generator logic~decodePackageExtensionEntity(entityType, entity) ⇒

This method takes extension data in JSON, and converts it into an object that contains: entityCode, entityQualifier, parentCode, manufacturerCode and value

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: object that can be used for database injection

ParamType
entityType*
entity*

JS API: generator logic~loadZclExtensions(zclExt) ⇒

Returns a promise that will load the zcl extensions.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Promise of loading the zcl extensions.

ParamType
zclExt*

JS API: generator logic~loadTemplates(db, genTemplatesJsonArray)

Api that loads an array of template JSON files or a single file if you just pass in one String.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)

ParamType
db*
genTemplatesJsonArray*

JS API: generator logic~loadSingleTemplate(db, genTemplatesJson) ⇒

Main API async function to load templates from a gen-template.json file.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: the loading context, contains: db, path, crc, packageId and templateData, or error

ParamTypeDescription
db*Database
genTemplatesJson*Path to the JSON file or an array of paths to JSON file

JS API: generator logic~generateAllTemplates(genResult, genTemplateJsonPkg, generateOnly) ⇒

Generates all the templates inside a toplevel package.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Promise that resolves with genResult, that contains all the generated templates, keyed by their ‘output’

ParamTypeDescription
genResult*
genTemplateJsonPkg*Package that points to genTemplate.json file
generateOnly*if NULL then generate all templates, else only generate template whose out file name matches this.

JS API: generator logic~generateSingleTemplate(genResult, singleTemplatePkg) ⇒

Function that generates a single package and adds it to the generation result.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with the genResult, with newly generated content added.

ParamTypeDescription
genResult*
singleTemplatePkg*Single template package.

JS API: generator logic~generate(db, packageId) ⇒

Main API async function to generate stuff.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Promise that resolves into a generation result.

ParamTypeDescription
db*Database
packageId*packageId Template package id. It can be either single template or gen template json.

JS API: generator logic~writeFileWithBackup(fileName, content, doBackup) ⇒

Promise to write out a file, optionally creating a backup.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise of a written file.

ParamType
fileName*
content*
doBackup*

JS API: generator logic~generateGenerationContent(genResult)

Returns a promise that resolves into a content that should be written out to gen result file.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)

ParamType
genResult*

JS API: generator logic~generateAndWriteFiles(db, sessionId, packageId, outputDirectory) ⇒

Generate files and write them into the given directory.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: a promise which will resolve when all the files are written.

ParamType
db*
sessionId*
packageId*
outputDirectory*

JS API: generator logic~postProcessGeneratedFiles(outputDirectory, genResult) ⇒

Executes post processing actions as defined by the gen-templates.json

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise of a dealt-with post processing actions

ParamType
outputDirectory*
genResult*

JS API: generator logic~contentIndexer(content)

This async function takes a string, and resolves a preview object out of it.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)

ParamTypeDescription
content*String to form into preview.

JS API: generator logic~generateSingleFileForPreview(db, sessionId, fileName) ⇒

Generates a single file and feeds it back for preview.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves into a preview object.

ParamType
db*
sessionId*
fileName*

JS API: generator logic~produceCompiledTemplate(singleTemplatePkg) ⇒

Resolves into a precompiled template, either from previous precompile or freshly compiled.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: templates

ParamType
singleTemplatePkg*

JS API: generator logic~produceContent(hb, metaInfo, db, sessionId, singlePkg, overridePath:) ⇒

Given db connection, session and a single template package, produce the output.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Promise that resolves with the ‘utf8’ string that contains the generated content.

ParamTypeDescription
hb*
metaInfo*
db*
sessionId*
singlePkg*
overridePath:*if passed, it provides a path to the override file that can override the overridable.js

JS API: generator logic~wrapOverridable(originalFn, overrideFn) ⇒

This function attemps to call override function, but if override function throws an exception, it calls the original function.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: result from override function, unless it throws an exception, in which case return result from original function.

ParamType
originalFn*
overrideFn*

JS API: generator logic~loadOverridable(genTemplatePackageId)

This function is responsible to load the overridable function container.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)

ParamType
genTemplatePackageId*

JS API: generator logic~loadPartial(path)

Function that loads the partials.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)

ParamType
path*

JS API: generator logic~loadHelper(helpers)

Function that loads the helpers.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)

ParamTypeDescription
helpers*a string path if value is passed through CLI, the nativeRequire() is leverage the native js function instead of webpack's special sauce. a required() module if invoked by backend js code. this is required to force webpack to resolve the included files as path will be difference after being packed for production.

JS API: generator logic~allBuiltInHelpers() ⇒

Returns an object that contains all the helper functions, keyed by their name

NOTE: This method is ONLY used for API testing. You should not use this method for any real work inside the engine or something.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Object containing all the helper functions.

JS API: generator logic~findHelperPackageByAlias(alias) ⇒

Given an alias, this method finds a builtin helper package by its alias.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Helper package or undefined if none was found.

ParamType
alias*

JS API: generator logic~initializeBuiltInHelpersForPackage()

Global helper initialization

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)

JS API: generator logic~hbInstance() ⇒

This method returns the correct instance for a given generation flow.

TBD: At this point it doesn‘t do anything yet, it’s just a central point to get the correct instance.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Instance of handlebars to be used.

JS API: generator logic~makeSynchronizablePromise(promise)

All promises used by the templates should be synchronizable.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)

ParamType
promise*

JS API: generator logic~collectBlocks(resultArray, options, context) ⇒

Helpful function that collects the individual blocks by using elements of an array as a context, executing promises for each, and collecting them into the outgoing string.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Promise that resolves with a content string.

ParamTypeDescription
resultArray*
options*Options passed from a block helper.
context*The context from within this was called.

JS API: generator logic~ensureZclPackageId(context) ⇒

Returns the promise that resolves with the ZCL properties package id.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with the package id.

ParamType
context*

JS API: generator logic~ensureZclPackageIds(context) ⇒

Returns the promise that resolves with all ZCL package id specific to current session.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with a list of package id.

ParamType
context*

JS API: generator logic~ensureTemplatePackageId(context) ⇒

Returns the promise that resolves with the ZCL properties package id.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with the package id.

ParamType
context*

JS API: generator logic~ensureEndpointTypeIds(context) ⇒

Populate the endpoint type ids into the global context.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: endpoint type ids

ParamType
context*

JS API: generator logic~ensureZclClusterSdkExtensions(context, templatePackageId) ⇒

Resolves with cached cluster extensions, but if they don't exist, it will populate them.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with cluster extensions.

ParamType
context*
templatePackageId*

JS API: generator logic~ensureZclDeviceTypeSdkExtensions(context, templatePackageId) ⇒

Resolves with cached cluster extensions, but if they don't exist, it will populate them.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with cluster extensions.

ParamType
context*
templatePackageId*

JS API: generator logic~ensureZclAttributeSdkExtensions(context, templatePackageId) ⇒

Resolves with cached attribute extensions, but if they don't exist, it will populate them.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with attribute extensions.

ParamType
context*
templatePackageId*

JS API: generator logic~ensureZclAttributeTypeSdkExtensions(context, templatePackageId) ⇒

Resolves with cached attribute type extensions, but if they don't exist, it will populate them.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with attribute type extensions.

ParamType
context*
templatePackageId*

JS API: generator logic~ensureZclCommandSdkExtensions(context, templatePackageId) ⇒

Resolves with cached command extensions, but if they don't exist, it will populate them.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with command extensions.

ParamType
context*
templatePackageId*

JS API: generator logic~ensureZclEventSdkExtensions(context, templatePackageId) ⇒

Resolves with cached command extensions, but if they don't exist, it will populate them.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with command extensions.

ParamType
context*
templatePackageId*

JS API: generator logic~templatePromise(global, promise)

Every helper that returns a promise, should not return the promise directly. So instead of returning the promise directly, it should return: return templatePromise(this.global, promise)

This will ensure that after tag works as expected.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)

ParamType
global*
promise*

JS API: generator logic~deprecatedHelper(fn, explanation) ⇒

Function wrapper that can be used when a helper is deprecated.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: a function that wraps the original function, with deprecation message.

ParamTypeDescription
fn*
explanation*can contain text, or from/to, or just be a string message itself.

JS API: generator logic

  • [JS API: generator logic](#moduleJS API generator logic)
    • [~loadGenTemplateFromFile(path)](#moduleJS API generator logic..loadGenTemplateFromFile) ⇒
    • [~recordTemplatesPackage(context)](#moduleJS API generator logic..recordTemplatesPackage) ⇒
    • [~decodePackageExtensionEntity(entityType, entity)](#moduleJS API generator logic..decodePackageExtensionEntity) ⇒
    • [~loadZclExtensions(zclExt)](#moduleJS API generator logic..loadZclExtensions) ⇒
    • [~loadTemplates(db, genTemplatesJsonArray)](#moduleJS API generator logic..loadTemplates)
    • [~loadSingleTemplate(db, genTemplatesJson)](#moduleJS API generator logic..loadSingleTemplate) ⇒
    • [~generateAllTemplates(genResult, genTemplateJsonPkg, generateOnly)](#moduleJS API generator logic..generateAllTemplates) ⇒
    • [~generateSingleTemplate(genResult, singleTemplatePkg)](#moduleJS API generator logic..generateSingleTemplate) ⇒
    • [~generate(db, packageId)](#moduleJS API generator logic..generate) ⇒
    • [~writeFileWithBackup(fileName, content, doBackup)](#moduleJS API generator logic..writeFileWithBackup) ⇒
    • [~generateGenerationContent(genResult)](#moduleJS API generator logic..generateGenerationContent)
    • [~generateAndWriteFiles(db, sessionId, packageId, outputDirectory)](#moduleJS API generator logic..generateAndWriteFiles) ⇒
    • [~postProcessGeneratedFiles(outputDirectory, genResult)](#moduleJS API generator logic..postProcessGeneratedFiles) ⇒
    • [~contentIndexer(content)](#moduleJS API generator logic..contentIndexer)
    • [~generateSingleFileForPreview(db, sessionId, fileName)](#moduleJS API generator logic..generateSingleFileForPreview) ⇒
    • [~produceCompiledTemplate(singleTemplatePkg)](#moduleJS API generator logic..produceCompiledTemplate) ⇒
    • [~produceContent(hb, metaInfo, db, sessionId, singlePkg, overridePath:)](#moduleJS API generator logic..produceContent) ⇒
    • [~wrapOverridable(originalFn, overrideFn)](#moduleJS API generator logic..wrapOverridable) ⇒
    • [~loadOverridable(genTemplatePackageId)](#moduleJS API generator logic..loadOverridable)
    • [~loadPartial(path)](#moduleJS API generator logic..loadPartial)
    • [~loadHelper(helpers)](#moduleJS API generator logic..loadHelper)
    • [~allBuiltInHelpers()](#moduleJS API generator logic..allBuiltInHelpers) ⇒
    • [~findHelperPackageByAlias(alias)](#moduleJS API generator logic..findHelperPackageByAlias) ⇒
    • [~initializeBuiltInHelpersForPackage()](#moduleJS API generator logic..initializeBuiltInHelpersForPackage)
    • [~hbInstance()](#moduleJS API generator logic..hbInstance) ⇒
    • [~makeSynchronizablePromise(promise)](#moduleJS API generator logic..makeSynchronizablePromise)
    • [~collectBlocks(resultArray, options, context)](#moduleJS API generator logic..collectBlocks) ⇒
    • [~ensureZclPackageId(context)](#moduleJS API generator logic..ensureZclPackageId) ⇒
    • [~ensureZclPackageIds(context)](#moduleJS API generator logic..ensureZclPackageIds) ⇒
    • [~ensureTemplatePackageId(context)](#moduleJS API generator logic..ensureTemplatePackageId) ⇒
    • [~ensureEndpointTypeIds(context)](#moduleJS API generator logic..ensureEndpointTypeIds) ⇒
    • [~ensureZclClusterSdkExtensions(context, templatePackageId)](#moduleJS API generator logic..ensureZclClusterSdkExtensions) ⇒
    • [~ensureZclDeviceTypeSdkExtensions(context, templatePackageId)](#moduleJS API generator logic..ensureZclDeviceTypeSdkExtensions) ⇒
    • [~ensureZclAttributeSdkExtensions(context, templatePackageId)](#moduleJS API generator logic..ensureZclAttributeSdkExtensions) ⇒
    • [~ensureZclAttributeTypeSdkExtensions(context, templatePackageId)](#moduleJS API generator logic..ensureZclAttributeTypeSdkExtensions) ⇒
    • [~ensureZclCommandSdkExtensions(context, templatePackageId)](#moduleJS API generator logic..ensureZclCommandSdkExtensions) ⇒
    • [~ensureZclEventSdkExtensions(context, templatePackageId)](#moduleJS API generator logic..ensureZclEventSdkExtensions) ⇒
    • [~templatePromise(global, promise)](#moduleJS API generator logic..templatePromise)
    • [~deprecatedHelper(fn, explanation)](#moduleJS API generator logic..deprecatedHelper) ⇒

JS API: generator logic~loadGenTemplateFromFile(path) ⇒

Given a path, it will read generation template object into memory.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Object that contains: data, crc, templateData

ParamType
path*

JS API: generator logic~recordTemplatesPackage(context) ⇒

Given a loading context, it records the package into the packages table and adds the packageId field into the resolved context.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with the same context passed in, except packageId added to it

ParamType
context*

JS API: generator logic~decodePackageExtensionEntity(entityType, entity) ⇒

This method takes extension data in JSON, and converts it into an object that contains: entityCode, entityQualifier, parentCode, manufacturerCode and value

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: object that can be used for database injection

ParamType
entityType*
entity*

JS API: generator logic~loadZclExtensions(zclExt) ⇒

Returns a promise that will load the zcl extensions.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Promise of loading the zcl extensions.

ParamType
zclExt*

JS API: generator logic~loadTemplates(db, genTemplatesJsonArray)

Api that loads an array of template JSON files or a single file if you just pass in one String.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)

ParamType
db*
genTemplatesJsonArray*

JS API: generator logic~loadSingleTemplate(db, genTemplatesJson) ⇒

Main API async function to load templates from a gen-template.json file.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: the loading context, contains: db, path, crc, packageId and templateData, or error

ParamTypeDescription
db*Database
genTemplatesJson*Path to the JSON file or an array of paths to JSON file

JS API: generator logic~generateAllTemplates(genResult, genTemplateJsonPkg, generateOnly) ⇒

Generates all the templates inside a toplevel package.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Promise that resolves with genResult, that contains all the generated templates, keyed by their ‘output’

ParamTypeDescription
genResult*
genTemplateJsonPkg*Package that points to genTemplate.json file
generateOnly*if NULL then generate all templates, else only generate template whose out file name matches this.

JS API: generator logic~generateSingleTemplate(genResult, singleTemplatePkg) ⇒

Function that generates a single package and adds it to the generation result.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with the genResult, with newly generated content added.

ParamTypeDescription
genResult*
singleTemplatePkg*Single template package.

JS API: generator logic~generate(db, packageId) ⇒

Main API async function to generate stuff.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Promise that resolves into a generation result.

ParamTypeDescription
db*Database
packageId*packageId Template package id. It can be either single template or gen template json.

JS API: generator logic~writeFileWithBackup(fileName, content, doBackup) ⇒

Promise to write out a file, optionally creating a backup.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise of a written file.

ParamType
fileName*
content*
doBackup*

JS API: generator logic~generateGenerationContent(genResult)

Returns a promise that resolves into a content that should be written out to gen result file.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)

ParamType
genResult*

JS API: generator logic~generateAndWriteFiles(db, sessionId, packageId, outputDirectory) ⇒

Generate files and write them into the given directory.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: a promise which will resolve when all the files are written.

ParamType
db*
sessionId*
packageId*
outputDirectory*

JS API: generator logic~postProcessGeneratedFiles(outputDirectory, genResult) ⇒

Executes post processing actions as defined by the gen-templates.json

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise of a dealt-with post processing actions

ParamType
outputDirectory*
genResult*

JS API: generator logic~contentIndexer(content)

This async function takes a string, and resolves a preview object out of it.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)

ParamTypeDescription
content*String to form into preview.

JS API: generator logic~generateSingleFileForPreview(db, sessionId, fileName) ⇒

Generates a single file and feeds it back for preview.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves into a preview object.

ParamType
db*
sessionId*
fileName*

JS API: generator logic~produceCompiledTemplate(singleTemplatePkg) ⇒

Resolves into a precompiled template, either from previous precompile or freshly compiled.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: templates

ParamType
singleTemplatePkg*

JS API: generator logic~produceContent(hb, metaInfo, db, sessionId, singlePkg, overridePath:) ⇒

Given db connection, session and a single template package, produce the output.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Promise that resolves with the ‘utf8’ string that contains the generated content.

ParamTypeDescription
hb*
metaInfo*
db*
sessionId*
singlePkg*
overridePath:*if passed, it provides a path to the override file that can override the overridable.js

JS API: generator logic~wrapOverridable(originalFn, overrideFn) ⇒

This function attemps to call override function, but if override function throws an exception, it calls the original function.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: result from override function, unless it throws an exception, in which case return result from original function.

ParamType
originalFn*
overrideFn*

JS API: generator logic~loadOverridable(genTemplatePackageId)

This function is responsible to load the overridable function container.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)

ParamType
genTemplatePackageId*

JS API: generator logic~loadPartial(path)

Function that loads the partials.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)

ParamType
path*

JS API: generator logic~loadHelper(helpers)

Function that loads the helpers.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)

ParamTypeDescription
helpers*a string path if value is passed through CLI, the nativeRequire() is leverage the native js function instead of webpack's special sauce. a required() module if invoked by backend js code. this is required to force webpack to resolve the included files as path will be difference after being packed for production.

JS API: generator logic~allBuiltInHelpers() ⇒

Returns an object that contains all the helper functions, keyed by their name

NOTE: This method is ONLY used for API testing. You should not use this method for any real work inside the engine or something.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Object containing all the helper functions.

JS API: generator logic~findHelperPackageByAlias(alias) ⇒

Given an alias, this method finds a builtin helper package by its alias.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Helper package or undefined if none was found.

ParamType
alias*

JS API: generator logic~initializeBuiltInHelpersForPackage()

Global helper initialization

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)

JS API: generator logic~hbInstance() ⇒

This method returns the correct instance for a given generation flow.

TBD: At this point it doesn‘t do anything yet, it’s just a central point to get the correct instance.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Instance of handlebars to be used.

JS API: generator logic~makeSynchronizablePromise(promise)

All promises used by the templates should be synchronizable.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)

ParamType
promise*

JS API: generator logic~collectBlocks(resultArray, options, context) ⇒

Helpful function that collects the individual blocks by using elements of an array as a context, executing promises for each, and collecting them into the outgoing string.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Promise that resolves with a content string.

ParamTypeDescription
resultArray*
options*Options passed from a block helper.
context*The context from within this was called.

JS API: generator logic~ensureZclPackageId(context) ⇒

Returns the promise that resolves with the ZCL properties package id.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with the package id.

ParamType
context*

JS API: generator logic~ensureZclPackageIds(context) ⇒

Returns the promise that resolves with all ZCL package id specific to current session.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with a list of package id.

ParamType
context*

JS API: generator logic~ensureTemplatePackageId(context) ⇒

Returns the promise that resolves with the ZCL properties package id.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with the package id.

ParamType
context*

JS API: generator logic~ensureEndpointTypeIds(context) ⇒

Populate the endpoint type ids into the global context.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: endpoint type ids

ParamType
context*

JS API: generator logic~ensureZclClusterSdkExtensions(context, templatePackageId) ⇒

Resolves with cached cluster extensions, but if they don't exist, it will populate them.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with cluster extensions.

ParamType
context*
templatePackageId*

JS API: generator logic~ensureZclDeviceTypeSdkExtensions(context, templatePackageId) ⇒

Resolves with cached cluster extensions, but if they don't exist, it will populate them.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with cluster extensions.

ParamType
context*
templatePackageId*

JS API: generator logic~ensureZclAttributeSdkExtensions(context, templatePackageId) ⇒

Resolves with cached attribute extensions, but if they don't exist, it will populate them.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with attribute extensions.

ParamType
context*
templatePackageId*

JS API: generator logic~ensureZclAttributeTypeSdkExtensions(context, templatePackageId) ⇒

Resolves with cached attribute type extensions, but if they don't exist, it will populate them.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with attribute type extensions.

ParamType
context*
templatePackageId*

JS API: generator logic~ensureZclCommandSdkExtensions(context, templatePackageId) ⇒

Resolves with cached command extensions, but if they don't exist, it will populate them.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with command extensions.

ParamType
context*
templatePackageId*

JS API: generator logic~ensureZclEventSdkExtensions(context, templatePackageId) ⇒

Resolves with cached command extensions, but if they don't exist, it will populate them.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with command extensions.

ParamType
context*
templatePackageId*

JS API: generator logic~templatePromise(global, promise)

Every helper that returns a promise, should not return the promise directly. So instead of returning the promise directly, it should return: return templatePromise(this.global, promise)

This will ensure that after tag works as expected.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)

ParamType
global*
promise*

JS API: generator logic~deprecatedHelper(fn, explanation) ⇒

Function wrapper that can be used when a helper is deprecated.

Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: a function that wraps the original function, with deprecation message.

ParamTypeDescription
fn*
explanation*can contain text, or from/to, or just be a string message itself.

REST API: user data

This module provides the API to access zcl specific information.

  • [REST API: user data](#moduleREST API user data)
    • [~getComponentIdsByCluster(db, sessionId, clusterId, side)](#moduleREST API user data..getComponentIdsByCluster) ⇒ *
    • [~httpGetSessionKeyValues(db)](#moduleREST API user data..httpGetSessionKeyValues) ⇒
    • [~httpGetNotifications(db)](#moduleREST API user data..httpGetNotifications) ⇒
    • [~httpPostSaveSessionKeyValue(db)](#moduleREST API user data..httpPostSaveSessionKeyValue) ⇒
    • [~httpPostCluster(db)](#moduleREST API user data..httpPostCluster) ⇒
    • [~httpPostAttributeUpdate(db)](#moduleREST API user data..httpPostAttributeUpdate) ⇒
    • [~httpPostCommandUpdate(db)](#moduleREST API user data..httpPostCommandUpdate) ⇒
    • [~httpPostEventUpdate(db)](#moduleREST API user data..httpPostEventUpdate) ⇒
    • [~httpGetInitialState(db)](#moduleREST API user data..httpGetInitialState) ⇒
    • [~httpGetOption(db)](#moduleREST API user data..httpGetOption) ⇒
    • [~httpGetUiOptions(db)](#moduleREST API user data..httpGetUiOptions) ⇒
    • [~httpGetPackages()](#moduleREST API user data..httpGetPackages)
    • [~httpGetAllPackages()](#moduleREST API user data..httpGetAllPackages)
    • [~httpPostAddNewPackage()](#moduleREST API user data..httpPostAddNewPackage)
    • [~httpPostShareClusterStatesAcrossEndpoints()](#moduleREST API user data..httpPostShareClusterStatesAcrossEndpoints)
    • [~httpPostDuplicateEndpoint(db)](#moduleREST API user data..httpPostDuplicateEndpoint) ⇒
    • [~httpPostDuplicateEndpointType(db)](#moduleREST API user data..httpPostDuplicateEndpointType) ⇒
    • [~duplicateEndpointTypeClusters(db, oldEndpointTypeId, newEndpointTypeId)](#moduleREST API user data..duplicateEndpointTypeClusters)

REST API: user data~getComponentIdsByCluster(db, sessionId, clusterId, side) ⇒ *

Promise that return a list of component Ids required by a specific cluster

Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: * - - {componentIds, clusterId, clusterLabel, side}

ParamType
db*
sessionId*
clusterId*
side*

REST API: user data~httpGetSessionKeyValues(db) ⇒

HTTP GET: session key values

Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: callback for the express uri registration

ParamType
db*

REST API: user data~httpGetNotifications(db) ⇒

HTTP GET: session get notifications

Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: callback for the express uri registration

ParamType
db*

REST API: user data~httpPostSaveSessionKeyValue(db) ⇒

HTTP POST: save session key value

Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: callback for the express uri registration

ParamType
db*

REST API: user data~httpPostCluster(db) ⇒

HTTP POST: cluster

Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: callback for the express uri registration

ParamType
db*

REST API: user data~httpPostAttributeUpdate(db) ⇒

HTTP POST attribute update

Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: callback for the express uri registration

ParamType
db*

REST API: user data~httpPostCommandUpdate(db) ⇒

HTTP POST: command update

Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: callback for the express uri registration

ParamType
db*

REST API: user data~httpPostEventUpdate(db) ⇒

HTTP POST: command update

Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: callback for the express uri registration

ParamType
db*

REST API: user data~httpGetInitialState(db) ⇒

HTTP GET: initial state

Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: callback for the express uri registration

ParamType
db*

REST API: user data~httpGetOption(db) ⇒

HTTP GET: option

Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: callback for the express uri registration

ParamType
db*

REST API: user data~httpGetUiOptions(db) ⇒

HTTP GET: ui_options

Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: UI options from all packages.

ParamType
db*

REST API: user data~httpGetPackages()

HTTP GET: Project packages

Kind: inner method of [REST API: user data](#moduleREST API user data)

REST API: user data~httpGetAllPackages()

HTTP GET: All Packages

Kind: inner method of [REST API: user data](#moduleREST API user data)

REST API: user data~httpPostAddNewPackage()

HTTP POST: Add new project package

Kind: inner method of [REST API: user data](#moduleREST API user data)

REST API: user data~httpPostShareClusterStatesAcrossEndpoints()

HTTP POST: Unify all Attributes / Command states if a certain cluster is enabled on more than one endpoint.

  1. In Zigbee world, the Attribute / Command configurations is a global singleton entity. If one cluster is enabled by more than 1 endpoint, the attribute states (on/off) should be identical across each endpoint. To emulate the global singleton entity, this function ensures Attribute changes are applied to all endpoint specific attribute fields. When unify event is triggered, this function will align all shared Attribute/Command states to the first matching entry from beginning of the endpoint list.
  2. (native case in ZAP) In Matter, the Attribute configuration are endpoint specific.

Kind: inner method of [REST API: user data](#moduleREST API user data)

REST API: user data~httpPostDuplicateEndpoint(db) ⇒

Creating a duplicate for endpoint

Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: newly created endpoint id

ParamType
db*

REST API: user data~httpPostDuplicateEndpointType(db) ⇒

Creating a duplicate for endpoint-type and endpoint-type-attributes

Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: newly created endpoint-type id

ParamType
db*

REST API: user data~duplicateEndpointTypeClusters(db, oldEndpointTypeId, newEndpointTypeId)

duplicate all clusters and attributes of an old endpoint type, using oldEndpointType id and newly created endpointType id

Kind: inner method of [REST API: user data](#moduleREST API user data)

ParamType
db*
oldEndpointTypeId*
newEndpointTypeId*

REST API: admin functions

This module provides the REST API to the admin functions.

  • [REST API: admin functions](#moduleREST API admin functions)
    • [~httpPostSql(db, app)](#moduleREST API admin functions..httpPostSql) ⇒
    • [~httpGetVersion(db)](#moduleREST API admin functions..httpGetVersion) ⇒
    • [~httpGetCache(db)](#moduleREST API admin functions..httpGetCache)

REST API: admin functions~httpPostSql(db, app) ⇒

API: /sql Request JSON:

Response JSON:

Kind: inner method of [REST API: admin functions](#moduleREST API admin functions)
Returns: callback for the express uri registration

ParamType
db*
app*

REST API: admin functions~httpGetVersion(db) ⇒

API: /version Response JSON:

Kind: inner method of [REST API: admin functions](#moduleREST API admin functions)
Returns: callback for the express uri registration.

ParamType
db*

REST API: admin functions~httpGetCache(db)

API: /cache Response JSON:

Kind: inner method of [REST API: admin functions](#moduleREST API admin functions)

ParamType
db*

REST API: endpoint

This module provides the REST API to the user specific data.

  • [REST API: endpoint](#moduleREST API endpoint)
    • [~httpDeleteEndpoint(db)](#moduleREST API endpoint..httpDeleteEndpoint) ⇒
    • [~httpDeleteEndpointType(db)](#moduleREST API endpoint..httpDeleteEndpointType) ⇒
    • [~httpPostEndpoint(db)](#moduleREST API endpoint..httpPostEndpoint) ⇒
    • [~httpPatchEndpoint(db)](#moduleREST API endpoint..httpPatchEndpoint) ⇒
    • [~httpPostEndpointType(db)](#moduleREST API endpoint..httpPostEndpointType) ⇒
    • [~httpPatchEndpointType(db)](#moduleREST API endpoint..httpPatchEndpointType) ⇒

REST API: endpoint~httpDeleteEndpoint(db) ⇒

HTTP DELETE: endpoint

Kind: inner method of [REST API: endpoint](#moduleREST API endpoint)
Returns: callback for the express uri registration

ParamType
db*

REST API: endpoint~httpDeleteEndpointType(db) ⇒

HTTP DELETE: endpoint type

Kind: inner method of [REST API: endpoint](#moduleREST API endpoint)
Returns: callback for the express uri registration

ParamType
db*

REST API: endpoint~httpPostEndpoint(db) ⇒

HTTP POST: endpoint

Kind: inner method of [REST API: endpoint](#moduleREST API endpoint)
Returns: callback for the express uri registration

ParamType
db*

REST API: endpoint~httpPatchEndpoint(db) ⇒

HTTP POST: endpoint

Kind: inner method of [REST API: endpoint](#moduleREST API endpoint)
Returns: callback for the express uri registration

ParamTypeDescription
db*Main database to use for the operation.

REST API: endpoint~httpPostEndpointType(db) ⇒

HTTP POST endpoint type

Kind: inner method of [REST API: endpoint](#moduleREST API endpoint)
Returns: callback for the express uri registration

ParamType
db*

REST API: endpoint~httpPatchEndpointType(db) ⇒

HTTP POST: endpoint type update

Kind: inner method of [REST API: endpoint](#moduleREST API endpoint)
Returns: callback for the express uri registration

ParamType
db*

External IDE interface.

This module provides the interface to an extenal IDE: Simplicity Studio.

REST API: generation functions

This module provides the REST API to the generation.

  • [REST API: generation functions](#moduleREST API generation functions)
    • [~httpGetPreviewNameIndex(db)](#moduleREST API generation functions..httpGetPreviewNameIndex) ⇒
    • [~httpGetPreviewName(db)](#moduleREST API generation functions..httpGetPreviewName) ⇒
    • [~httpGetPreview(db)](#moduleREST API generation functions..httpGetPreview) ⇒
    • [~httpPutGenerate(db)](#moduleREST API generation functions..httpPutGenerate) ⇒
    • [~httpPostComponentAdd(db)](#moduleREST API generation functions..httpPostComponentAdd)

REST API: generation functions~httpGetPreviewNameIndex(db) ⇒

HTTP GET: preview single file with index.

Kind: inner method of [REST API: generation functions](#moduleREST API generation functions)
Returns: callback for the express uri registration

ParamType
db*

REST API: generation functions~httpGetPreviewName(db) ⇒

HTTP GET: Preview a single file.

Kind: inner method of [REST API: generation functions](#moduleREST API generation functions)
Returns: callback for the express uri registration

ParamType
db*

REST API: generation functions~httpGetPreview(db) ⇒

HTTP GET: total preview object.

Kind: inner method of [REST API: generation functions](#moduleREST API generation functions)
Returns: callback for the express uri registration

ParamType
db*

REST API: generation functions~httpPutGenerate(db) ⇒

HTTP PUT: performs local generation into a specified directory.

Kind: inner method of [REST API: generation functions](#moduleREST API generation functions)
Returns: callback for the express uri registration

ParamType
db*

REST API: generation functions~httpPostComponentAdd(db)

Enable components by ‘componentId’ or corresponding components specified, via ‘defaults’, by ‘clusterId’ / ‘roles’

Kind: inner method of [REST API: generation functions](#moduleREST API generation functions)

ParamType
db*

REST API: generation functions

This module provides the REST API to the IDE component handling.

  • [REST API: generation functions](#moduleREST API generation functions)
    • [~httpGetPreviewNameIndex(db)](#moduleREST API generation functions..httpGetPreviewNameIndex) ⇒
    • [~httpGetPreviewName(db)](#moduleREST API generation functions..httpGetPreviewName) ⇒
    • [~httpGetPreview(db)](#moduleREST API generation functions..httpGetPreview) ⇒
    • [~httpPutGenerate(db)](#moduleREST API generation functions..httpPutGenerate) ⇒
    • [~httpPostComponentAdd(db)](#moduleREST API generation functions..httpPostComponentAdd)

REST API: generation functions~httpGetPreviewNameIndex(db) ⇒

HTTP GET: preview single file with index.

Kind: inner method of [REST API: generation functions](#moduleREST API generation functions)
Returns: callback for the express uri registration

ParamType
db*

REST API: generation functions~httpGetPreviewName(db) ⇒

HTTP GET: Preview a single file.

Kind: inner method of [REST API: generation functions](#moduleREST API generation functions)
Returns: callback for the express uri registration

ParamType
db*

REST API: generation functions~httpGetPreview(db) ⇒

HTTP GET: total preview object.

Kind: inner method of [REST API: generation functions](#moduleREST API generation functions)
Returns: callback for the express uri registration

ParamType
db*

REST API: generation functions~httpPutGenerate(db) ⇒

HTTP PUT: performs local generation into a specified directory.

Kind: inner method of [REST API: generation functions](#moduleREST API generation functions)
Returns: callback for the express uri registration

ParamType
db*

REST API: generation functions~httpPostComponentAdd(db)

Enable components by ‘componentId’ or corresponding components specified, via ‘defaults’, by ‘clusterId’ / ‘roles’

Kind: inner method of [REST API: generation functions](#moduleREST API generation functions)

ParamType
db*

REST API: initialization functions

This module provides the REST API to the session initialization

  • [REST API: initialization functions](#moduleREST API initialization functions)
    • [~packagesAndSessions(db)](#moduleREST API initialization functions..packagesAndSessions) ⇒
    • [~initializeSession(db, options:)](#moduleREST API initialization functions..initializeSession) ⇒
    • [~loadPreviousSessions(db)](#moduleREST API initialization functions..loadPreviousSessions) ⇒
    • [~init(db)](#moduleREST API initialization functions..init) ⇒

REST API: initialization functions~packagesAndSessions(db) ⇒

This function returns Properties, Templates and Dirty-Sessions

Kind: inner method of [REST API: initialization functions](#moduleREST API initialization functions)
Returns: Properties, Templates and Dirty-Sessions.

ParamType
db*

REST API: initialization functions~initializeSession(db, options:) ⇒

This function creates a new session with its packages according to selected Properties and Templates

Kind: inner method of [REST API: initialization functions](#moduleREST API initialization functions)
Returns: A success message.

ParamTypeDescription
db*
options:*object containing ‘zcl’ and ‘template’

REST API: initialization functions~loadPreviousSessions(db) ⇒

This function reloads previous session by user selected session's id

Kind: inner method of [REST API: initialization functions](#moduleREST API initialization functions)
Returns: A success message.

ParamType
db*

REST API: initialization functions~init(db) ⇒

Init function from the App.vue

Kind: inner method of [REST API: initialization functions](#moduleREST API initialization functions)
Returns: A success message.

ParamType
db*

REST API: static zcl functions

This module provides the REST API to the static zcl queries.

  • [REST API: static zcl functions](#moduleREST API static zcl functions)
    • [~httpGetZclEntity(app)](#moduleREST API static zcl functions..httpGetZclEntity)
    • [~httpGetZclExtension(db)](#moduleREST API static zcl functions..httpGetZclExtension) ⇒

REST API: static zcl functions~httpGetZclEntity(app)

API: /zcl/:entity/:id

Kind: inner method of [REST API: static zcl functions](#moduleREST API static zcl functions)

ParamTypeDescription
app*Express instance.

REST API: static zcl functions~httpGetZclExtension(db) ⇒

API: /zclExtension/:entity/:extension

Kind: inner method of [REST API: static zcl functions](#moduleREST API static zcl functions)
Returns: zcl extension handler

ParamType
db*

REST API: user data

This module provides the REST API to the user specific data.

  • [REST API: user data](#moduleREST API user data)
    • [~getComponentIdsByCluster(db, sessionId, clusterId, side)](#moduleREST API user data..getComponentIdsByCluster) ⇒ *
    • [~httpGetSessionKeyValues(db)](#moduleREST API user data..httpGetSessionKeyValues) ⇒
    • [~httpGetNotifications(db)](#moduleREST API user data..httpGetNotifications) ⇒
    • [~httpPostSaveSessionKeyValue(db)](#moduleREST API user data..httpPostSaveSessionKeyValue) ⇒
    • [~httpPostCluster(db)](#moduleREST API user data..httpPostCluster) ⇒
    • [~httpPostAttributeUpdate(db)](#moduleREST API user data..httpPostAttributeUpdate) ⇒
    • [~httpPostCommandUpdate(db)](#moduleREST API user data..httpPostCommandUpdate) ⇒
    • [~httpPostEventUpdate(db)](#moduleREST API user data..httpPostEventUpdate) ⇒
    • [~httpGetInitialState(db)](#moduleREST API user data..httpGetInitialState) ⇒
    • [~httpGetOption(db)](#moduleREST API user data..httpGetOption) ⇒
    • [~httpGetUiOptions(db)](#moduleREST API user data..httpGetUiOptions) ⇒
    • [~httpGetPackages()](#moduleREST API user data..httpGetPackages)
    • [~httpGetAllPackages()](#moduleREST API user data..httpGetAllPackages)
    • [~httpPostAddNewPackage()](#moduleREST API user data..httpPostAddNewPackage)
    • [~httpPostShareClusterStatesAcrossEndpoints()](#moduleREST API user data..httpPostShareClusterStatesAcrossEndpoints)
    • [~httpPostDuplicateEndpoint(db)](#moduleREST API user data..httpPostDuplicateEndpoint) ⇒
    • [~httpPostDuplicateEndpointType(db)](#moduleREST API user data..httpPostDuplicateEndpointType) ⇒
    • [~duplicateEndpointTypeClusters(db, oldEndpointTypeId, newEndpointTypeId)](#moduleREST API user data..duplicateEndpointTypeClusters)

REST API: user data~getComponentIdsByCluster(db, sessionId, clusterId, side) ⇒ *

Promise that return a list of component Ids required by a specific cluster

Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: * - - {componentIds, clusterId, clusterLabel, side}

ParamType
db*
sessionId*
clusterId*
side*

REST API: user data~httpGetSessionKeyValues(db) ⇒

HTTP GET: session key values

Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: callback for the express uri registration

ParamType
db*

REST API: user data~httpGetNotifications(db) ⇒

HTTP GET: session get notifications

Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: callback for the express uri registration

ParamType
db*

REST API: user data~httpPostSaveSessionKeyValue(db) ⇒

HTTP POST: save session key value

Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: callback for the express uri registration

ParamType
db*

REST API: user data~httpPostCluster(db) ⇒

HTTP POST: cluster

Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: callback for the express uri registration

ParamType
db*

REST API: user data~httpPostAttributeUpdate(db) ⇒

HTTP POST attribute update

Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: callback for the express uri registration

ParamType
db*

REST API: user data~httpPostCommandUpdate(db) ⇒

HTTP POST: command update

Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: callback for the express uri registration

ParamType
db*

REST API: user data~httpPostEventUpdate(db) ⇒

HTTP POST: command update

Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: callback for the express uri registration

ParamType
db*

REST API: user data~httpGetInitialState(db) ⇒

HTTP GET: initial state

Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: callback for the express uri registration

ParamType
db*

REST API: user data~httpGetOption(db) ⇒

HTTP GET: option

Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: callback for the express uri registration

ParamType
db*

REST API: user data~httpGetUiOptions(db) ⇒

HTTP GET: ui_options

Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: UI options from all packages.

ParamType
db*

REST API: user data~httpGetPackages()

HTTP GET: Project packages

Kind: inner method of [REST API: user data](#moduleREST API user data)

REST API: user data~httpGetAllPackages()

HTTP GET: All Packages

Kind: inner method of [REST API: user data](#moduleREST API user data)

REST API: user data~httpPostAddNewPackage()

HTTP POST: Add new project package

Kind: inner method of [REST API: user data](#moduleREST API user data)

REST API: user data~httpPostShareClusterStatesAcrossEndpoints()

HTTP POST: Unify all Attributes / Command states if a certain cluster is enabled on more than one endpoint.

  1. In Zigbee world, the Attribute / Command configurations is a global singleton entity. If one cluster is enabled by more than 1 endpoint, the attribute states (on/off) should be identical across each endpoint. To emulate the global singleton entity, this function ensures Attribute changes are applied to all endpoint specific attribute fields. When unify event is triggered, this function will align all shared Attribute/Command states to the first matching entry from beginning of the endpoint list.
  2. (native case in ZAP) In Matter, the Attribute configuration are endpoint specific.

Kind: inner method of [REST API: user data](#moduleREST API user data)

REST API: user data~httpPostDuplicateEndpoint(db) ⇒

Creating a duplicate for endpoint

Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: newly created endpoint id

ParamType
db*

REST API: user data~httpPostDuplicateEndpointType(db) ⇒

Creating a duplicate for endpoint-type and endpoint-type-attributes

Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: newly created endpoint-type id

ParamType
db*

REST API: user data~duplicateEndpointTypeClusters(db, oldEndpointTypeId, newEndpointTypeId)

duplicate all clusters and attributes of an old endpoint type, using oldEndpointType id and newly created endpointType id

Kind: inner method of [REST API: user data](#moduleREST API user data)

ParamType
db*
oldEndpointTypeId*
newEndpointTypeId*

JS API: http server

This module provides the HTTP server functionality.

  • [JS API: http server](#moduleJS API http server)
    • [~registerRestApi(filename, db, app)](#moduleJS API http server..registerRestApi)
    • [~initHttpServer(db, port)](#moduleJS API http server..initHttpServer) ⇒
    • [~shutdownHttpServer()](#moduleJS API http server..shutdownHttpServer) ⇒
    • [~shutdownHttpServerSync()](#moduleJS API http server..shutdownHttpServerSync) ⇒
    • [~httpServerPort()](#moduleJS API http server..httpServerPort) ⇒
    • [~httpServerUrl()](#moduleJS API http server..httpServerUrl) ⇒
    • [~httpServerStartupMessage()](#moduleJS API http server..httpServerStartupMessage)

JS API: http server~registerRestApi(filename, db, app)

This function is used to register a rest module, which exports get/post/etc. arrays.

Kind: inner method of [JS API: http server](#moduleJS API http server)

ParamType
filename*
db*
app*

JS API: http server~initHttpServer(db, port) ⇒

Promises to initialize the http server on a given port using a given database.

Kind: inner method of [JS API: http server](#moduleJS API http server)
Returns: A promise that resolves with an express app.

ParamTypeDescription
db*Database object to use.
port*Port for the HTTP server.

JS API: http server~shutdownHttpServer() ⇒

Promises to shut down the http server.

Kind: inner method of [JS API: http server](#moduleJS API http server)
Returns: Promise that resolves when server is shut down.

JS API: http server~shutdownHttpServerSync() ⇒

Promises to shut down the http server.

Kind: inner method of [JS API: http server](#moduleJS API http server)
Returns: Promise that resolves when server is shut down.

JS API: http server~httpServerPort() ⇒

Port http server is listening on.

Kind: inner method of [JS API: http server](#moduleJS API http server)
Returns: port

JS API: http server~httpServerUrl() ⇒

Returns the URL of the server.

Kind: inner method of [JS API: http server](#moduleJS API http server)
Returns: the server URL

JS API: http server~httpServerStartupMessage()

Returns the startup message that needs to be printed out.

Kind: inner method of [JS API: http server](#moduleJS API http server)

JS API: websocket server

This module provides the HTTP server functionality.

  • [JS API: websocket server](#moduleJS API websocket server)
    • [~initializeWebSocket(httpServer)](#moduleJS API websocket server..initializeWebSocket)
    • [~clientSocket(sessionUuid)](#moduleJS API websocket server..clientSocket)
    • [~doSend(socket, object)](#moduleJS API websocket server..doSend)
    • [~sendWebSocketData(category, payload)](#moduleJS API websocket server..sendWebSocketData)
    • [~sendWebSocketMessage(msg)](#moduleJS API websocket server..sendWebSocketMessage)
    • [~onWebSocket(category, listener)](#moduleJS API websocket server..onWebSocket)

JS API: websocket server~initializeWebSocket(httpServer)

Initialize a websocket, and register listeners to the websocket connection and the message receipt.

Kind: inner method of [JS API: websocket server](#moduleJS API websocket server)

ParamType
httpServer*

JS API: websocket server~clientSocket(sessionUuid)

Method that returns the websocket for a given session key.

Kind: inner method of [JS API: websocket server](#moduleJS API websocket server)

ParamType
sessionUuid*

JS API: websocket server~doSend(socket, object)

Bottom-most function that sends an object over a socket.

Kind: inner method of [JS API: websocket server](#moduleJS API websocket server)

ParamType
socket*
object*

JS API: websocket server~sendWebSocketData(category, payload)

Send websocket payload with a given category.

Kind: inner method of [JS API: websocket server](#moduleJS API websocket server)

ParamType
category*
payload*

JS API: websocket server~sendWebSocketMessage(msg)

This can be used to send unstructured websocket message. On the receiving end, the event will contain category ‘generic’.

Kind: inner method of [JS API: websocket server](#moduleJS API websocket server)

ParamType
msg*

JS API: websocket server~onWebSocket(category, listener)

If you wish to register to a specific category of websocket messages, you can use this function. Listener will be executed with a given socket and data object.

Kind: inner method of [JS API: websocket server](#moduleJS API websocket server)

ParamTypeDescription
category*category of message.
listener*function that receives socket, data.

JS API: renderer API related utilities

  • [JS API: renderer API related utilities](#moduleJS API renderer API related utilities)
    • [~getSessionUuidFromBrowserWindow(browserWindow)](#moduleJS API renderer API related utilities..getSessionUuidFromBrowserWindow) ⇒
    • [~getRendererApiInformation(browserWindow)](#moduleJS API renderer API related utilities..getRendererApiInformation) ⇒
    • [~execRendererApi(browserWindow, rendererApiCommand, ...theArgs)](#moduleJS API renderer API related utilities..execRendererApi)
    • [~execFileOpen(browserWindow, filePath)](#moduleJS API renderer API related utilities..execFileOpen) ⇒
    • [~processRendererNotify(message)](#moduleJS API renderer API related utilities..processRendererNotify) ⇒
    • [~reportFiles(browserWindow, result)](#moduleJS API renderer API related utilities..reportFiles)
    • [~getUserKeyFromCookieValue(cookieValue)](#moduleJS API renderer API related utilities..getUserKeyFromCookieValue) ⇒
    • [~getUserKeyFromBrowserCookie(browserCookie)](#moduleJS API renderer API related utilities..getUserKeyFromBrowserCookie)
    • [~getUserKeyFromBrowserWindow(browserWindow)](#moduleJS API renderer API related utilities..getUserKeyFromBrowserWindow)

JS API: renderer API related utilities~getSessionUuidFromBrowserWindow(browserWindow) ⇒

This method returns the global session UUID from the browser window that is set by the front-end.

Kind: inner method of [JS API: renderer API related utilities](#moduleJS API renderer API related utilities)
Returns: session UUID

ParamType
browserWindow*

JS API: renderer API related utilities~getRendererApiInformation(browserWindow) ⇒

Returns descriptive text about renderer api.

Kind: inner method of [JS API: renderer API related utilities](#moduleJS API renderer API related utilities)
Returns: description of renderer api

ParamType
browserWindow*

JS API: renderer API related utilities~execRendererApi(browserWindow, rendererApiCommand, ...theArgs)

Execute RendererApi commands

Kind: inner method of [JS API: renderer API related utilities](#moduleJS API renderer API related utilities)

ParamType
browserWindow*
rendererApiCommand*
...theArgsany

JS API: renderer API related utilities~execFileOpen(browserWindow, filePath) ⇒

Executes the file open renderer API action.

Kind: inner method of [JS API: renderer API related utilities](#moduleJS API renderer API related utilities)
Returns: Result of file open call.

ParamType
browserWindow*
filePath*

JS API: renderer API related utilities~processRendererNotify(message) ⇒

This method takes a message and checks if it‘s a renderer API notification call. If it is, it processe it and returns true. If it’s not it returns false.

Kind: inner method of [JS API: renderer API related utilities](#moduleJS API renderer API related utilities)
Returns: true if message was a notify message and was consumed.

ParamType
message*

JS API: renderer API related utilities~reportFiles(browserWindow, result)

This method calls the reportFiles renderer API call.

Kind: inner method of [JS API: renderer API related utilities](#moduleJS API renderer API related utilities)

ParamType
browserWindow*
result*

JS API: renderer API related utilities~getUserKeyFromCookieValue(cookieValue) ⇒

Returns cookie for user identification.

Kind: inner method of [JS API: renderer API related utilities](#moduleJS API renderer API related utilities)
Returns: cookie value used for user identification

ParamType
cookieValue*

JS API: renderer API related utilities~getUserKeyFromBrowserCookie(browserCookie)

Returns the session key

Kind: inner method of [JS API: renderer API related utilities](#moduleJS API renderer API related utilities)

ParamTypeDescription
browserCookie*object

JS API: renderer API related utilities~getUserKeyFromBrowserWindow(browserWindow)

Returns a promise that resolves into the session key.

Kind: inner method of [JS API: renderer API related utilities](#moduleJS API renderer API related utilities)

ParamType
browserWindow*

JS API: async reporting

This module provides the mechanism for dealing with the async reporting from backend to the UI.

This mechanism takes care of:

  • dirty flag
  • [JS API: async reporting](#moduleJS API async reporting)
    • [~sendDirtyFlagStatus(db, session)](#moduleJS API async reporting..sendDirtyFlagStatus)
    • [~startAsyncReporting(db, intervalMs)](#moduleJS API async reporting..startAsyncReporting)
    • [~stopAsyncReporting()](#moduleJS API async reporting..stopAsyncReporting)

JS API: async reporting~sendDirtyFlagStatus(db, session)

Sends a dirty flag status for a single session.

Kind: inner method of [JS API: async reporting](#moduleJS API async reporting)

ParamType
db*
session*

JS API: async reporting~startAsyncReporting(db, intervalMs)

Start the interval that will check and report dirty flags.

Kind: inner method of [JS API: async reporting](#moduleJS API async reporting)

ParamType
db*
intervalMs*

JS API: async reporting~stopAsyncReporting()

Stop the interval that will check and report dirty flags

Kind: inner method of [JS API: async reporting](#moduleJS API async reporting)

JS API: post-import.

This module contains the API functions for the post-load scripting functionality.

JS API: SDK utilities

JS API: SDK utilities~readSdkJson(sdkPath, logger)

This function reads in the sdk.json that is passed as sdkPath, and resolve the promise with the sdk object. logger is used for printouts.

Kind: inner method of [JS API: SDK utilities](#moduleJS API SDK utilities)

ParamType
sdkPath*
logger*

JS API: type related utilities

  • [JS API: type related utilities](#moduleJS API type related utilities)
    • [~typeSize(db, zclPackageId, type)](#moduleJS API type related utilities..typeSize)
    • [~typeSizeAttribute(db, zclPackageIds, at, [defaultValue])](#moduleJS API type related utilities..typeSizeAttribute) ⇒
    • [~convertFloatToBigEndian(value, size)](#moduleJS API type related utilities..convertFloatToBigEndian) ⇒
    • [~convertIntToBigEndian(value, size)](#moduleJS API type related utilities..convertIntToBigEndian) ⇒
    • [~longTypeDefaultValue(size, type, value)](#moduleJS API type related utilities..longTypeDefaultValue) ⇒
    • [~convertToCliType(str)](#moduleJS API type related utilities..convertToCliType) ⇒
    • [~isString(type)](#moduleJS API type related utilities..isString) ⇒
    • [~isFloat(type)](#moduleJS API type related utilities..isFloat) ⇒
    • [~isSignedInteger(type)](#moduleJS API type related utilities..isSignedInteger) ⇒
    • [~isOneBytePrefixedString(type)](#moduleJS API type related utilities..isOneBytePrefixedString) ⇒
    • [~isTwoBytePrefixedString(type)](#moduleJS API type related utilities..isTwoBytePrefixedString) ⇒
    • [~getSignAndSizeOfZclType(type, context, options)](#moduleJS API type related utilities..getSignAndSizeOfZclType) ⇒

JS API: type related utilities~typeSize(db, zclPackageId, type)

This function resolves with the size of a given type. -1 means that this size is variable.

Kind: inner method of [JS API: type related utilities](#moduleJS API type related utilities)

ParamType
db*
zclPackageId*
type*

JS API: type related utilities~typeSizeAttribute(db, zclPackageIds, at, [defaultValue]) ⇒

Returns the size of a real attribute, taking type size and defaults into consideration, so that strings are properly sized.

Kind: inner method of [JS API: type related utilities](#moduleJS API type related utilities)
Returns: Promise that resolves into the size of the attribute.

ParamTypeDefault
db*
zclPackageIds*
at*
[defaultValue]*

JS API: type related utilities~convertFloatToBigEndian(value, size) ⇒

Kind: inner method of [JS API: type related utilities](#moduleJS API type related utilities)
Returns: The big endian value for a given float value padded with the given size. The value is returned in hex format and prefixed with ‘0x’.

ParamType
value*
size*

JS API: type related utilities~convertIntToBigEndian(value, size) ⇒

Kind: inner method of [JS API: type related utilities](#moduleJS API type related utilities)
Returns: The big endian value for a given integer value padded with the given size. The value is returned in hex format and prefixed with ‘0x’.

ParamType
value*
size*

JS API: type related utilities~longTypeDefaultValue(size, type, value) ⇒

If the type is more than 2 bytes long, then this method creates the default byte array.

Kind: inner method of [JS API: type related utilities](#moduleJS API type related utilities)
Returns: string which is a C-formatted byte array.

ParamTypeDescription
size*Size of bytes generated.
type*Type of the object.
value*Default value.

JS API: type related utilities~convertToCliType(str) ⇒

Conversion to a CLI type. THis is here temporarily until we come up with a proper type engine.

Kind: inner method of [JS API: type related utilities](#moduleJS API type related utilities)
Returns: converted type

ParamType
str*

JS API: type related utilities~isString(type) ⇒

Returns true if a given ZCL type is a string type.

Kind: inner method of [JS API: type related utilities](#moduleJS API type related utilities)
Returns: true if type is string, false otherwise

ParamType
type*

JS API: type related utilities~isFloat(type) ⇒

Returns true if a given ZCL type is a float type.

Kind: inner method of [JS API: type related utilities](#moduleJS API type related utilities)
Returns: true if type is float, false otherwise

ParamType
type*

JS API: type related utilities~isSignedInteger(type) ⇒

Returns true if a given ZCL type is a signed integer.

Kind: inner method of [JS API: type related utilities](#moduleJS API type related utilities)
Returns: true if type is signed integer, false otherwise

ParamType
type*

JS API: type related utilities~isOneBytePrefixedString(type) ⇒

Checks if type is a one-byte lengh string.

Kind: inner method of [JS API: type related utilities](#moduleJS API type related utilities)
Returns: true if the said type is a string prefixed by one byte length

ParamType
type*

JS API: type related utilities~isTwoBytePrefixedString(type) ⇒

Checks if type is a two-byte lengh string.

Kind: inner method of [JS API: type related utilities](#moduleJS API type related utilities)
Returns: true if the said type is a string prefixed by two byte length

ParamType
type*

JS API: type related utilities~getSignAndSizeOfZclType(type, context, options) ⇒

Given a zcl device type returns its sign, size and zcl data type info stored in the database table. Note: Enums and Bitmaps are considered to be unsigned.

Kind: inner method of [JS API: type related utilities](#moduleJS API type related utilities)
Returns: returns sign, size and info of zcl device type Available Options:

  • size: Determine whether to calculate the size of zcl device type in bits or bytes for eg: getSignAndSizeOfZclType(‘int8u’ this size=‘bits’) will return the size in bits which will be 8. If not mentioned then it will return the size in bytes i.e. 1 in this case.
ParamType
type*
context*
options*

JS API: random utilities

  • [JS API: random utilities](#moduleJS API random utilities)
    • [~checksum(data)](#moduleJS API random utilities..checksum) ⇒
    • [~ensurePackagesAndPopulateSessionOptions(db, sessionId, options:, selectedZclPropertyPackage, selectedGenTemplatePackages)](#moduleJS API random utilities..ensurePackagesAndPopulateSessionOptions) ⇒
    • [~createBackupFile(filePath)](#moduleJS API random utilities..createBackupFile)
    • [~matchFeatureLevel(featureLevel)](#moduleJS API random utilities..matchFeatureLevel)
    • [~sessionReport(db, sessionId)](#moduleJS API random utilities..sessionReport) ⇒
    • [~sessionDump(db, sessionId)](#moduleJS API random utilities..sessionDump) ⇒
    • [~executePromisesSequentially(arrayOfData, promiseCreator)](#moduleJS API random utilities..executePromisesSequentially)
    • [~createAbsolutePath(relativePath, relativity, zapFilePath)](#moduleJS API random utilities..createAbsolutePath)
    • [~locateRelativeFilePath(rootFileLocations, relativeFilePath)](#moduleJS API random utilities..locateRelativeFilePath) ⇒
    • [~executeExternalProgram(cmd)](#moduleJS API random utilities..executeExternalProgram)
    • [~getClusterExtensionDefault(extensions, extensionId, clusterCode)](#moduleJS API random utilities..getClusterExtensionDefault) ⇒
    • [~getClusterExtension(extensions, property, clusterCode)](#moduleJS API random utilities..getClusterExtension) ⇒
    • [~createUuid()](#moduleJS API random utilities..createUuid)
    • [~waitFor(time)](#moduleJS API random utilities..waitFor)
    • [~parseXml(fileContent)](#moduleJS API random utilities..parseXml) ⇒
    • [~readFileContentAndCrc(metadata)](#moduleJS API random utilities..readFileContentAndCrc) ⇒
    • [~duration(nsDifference)](#moduleJS API random utilities..duration) ⇒
    • [~mainOrSecondaryInstance()](#moduleJS API random utilities..mainOrSecondaryInstance)
    • [~collectJsonData(jsonFile)](#moduleJS API random utilities..collectJsonData)

JS API: random utilities~checksum(data) ⇒

Returns the CRC of the data that is passed.

Kind: inner method of [JS API: random utilities](#moduleJS API random utilities)
Returns: Calculated CRC of a data.

ParamType
data*

JS API: random utilities~ensurePackagesAndPopulateSessionOptions(db, sessionId, options:, selectedZclPropertyPackage, selectedGenTemplatePackages) ⇒

This function assigns a proper package ID to the session if there are no packages present. It will also populate session options.

Kind: inner method of [JS API: random utilities](#moduleJS API random utilities)
Returns: Promise that resolves with the packages array.

ParamTypeDescription
db*
sessionId*
options:*object containing ‘zcl’ and ‘template’
selectedZclPropertyPackage*
selectedGenTemplatePackages*

JS API: random utilities~createBackupFile(filePath)

Move database file out of the way into the backup location.

Kind: inner method of [JS API: random utilities](#moduleJS API random utilities)

ParamType
filePath*

JS API: random utilities~matchFeatureLevel(featureLevel)

Returns an object that contains: match: true or false if featureLevel is matched or not. message: in case of missmatch, the message shown to user.

Kind: inner method of [JS API: random utilities](#moduleJS API random utilities)

ParamType
featureLevel*

JS API: random utilities~sessionReport(db, sessionId) ⇒

Produces a text dump of a session data for human consumption.

Kind: inner method of [JS API: random utilities](#moduleJS API random utilities)
Returns: promise that resolves into a text report for the session.

ParamType
db*
sessionId*

JS API: random utilities~sessionDump(db, sessionId) ⇒

Produces a text dump of a session data for human consumption.

Kind: inner method of [JS API: random utilities](#moduleJS API random utilities)
Returns: promise that resolves into a text report for the session.

ParamType
db*
sessionId*

JS API: random utilities~executePromisesSequentially(arrayOfData, promiseCreator)

If you have an array of arguments, and a function that creates a promise out of each of those arguments, this function executes them sequentially, one by one.

Kind: inner method of [JS API: random utilities](#moduleJS API random utilities)

ParamType
arrayOfData*
promiseCreator*

JS API: random utilities~createAbsolutePath(relativePath, relativity, zapFilePath)

This function creates absolute path out of relative path and its relativity

Kind: inner method of [JS API: random utilities](#moduleJS API random utilities)

ParamType
relativePath*
relativity*
zapFilePath*

JS API: random utilities~locateRelativeFilePath(rootFileLocations, relativeFilePath) ⇒

This method takes an array of root locations and a relative path. It will attempt to locate an absolute file at the path, combining the root location and a relative path, until a file is found and returned.

If none of the combined root locations and relative paths results in an actual file, null is returned.

Kind: inner method of [JS API: random utilities](#moduleJS API random utilities)
Returns: A fully resolved path that exists, or null if none is available.

ParamTypeDescription
rootFileLocations*Array of root file locations, typically directories
relativeFilePath*Relative path

JS API: random utilities~executeExternalProgram(cmd)

Returns a promise of an execution of an external program.

Kind: inner method of [JS API: random utilities](#moduleJS API random utilities)

ParamType
cmd*

JS API: random utilities~getClusterExtensionDefault(extensions, extensionId, clusterCode) ⇒

Retrieve specific entry from extensions defaults(array) via ‘clusterCode’ key fields

Kind: inner method of [JS API: random utilities](#moduleJS API random utilities)
Returns: Value of the cluster extension property.
Parem: * clusterRole: one of server/client enums, or null for either.

ParamTypeDescription
extensions*
extensionId*field name under specific extension
clusterCode*search key

JS API: random utilities~getClusterExtension(extensions, property, clusterCode) ⇒

Retrieve specific entry from extensions defaults(array) via ‘clusterCode’ key fields

Kind: inner method of [JS API: random utilities](#moduleJS API random utilities)
Returns: Object containing all attribuetes specific to the extension

ParamTypeDescription
extensions*
property*field name under specific extension
clusterCode*search key

JS API: random utilities~createUuid()

Global way how to get an UUID.

Kind: inner method of [JS API: random utilities](#moduleJS API random utilities)

JS API: random utilities~waitFor(time)

Returns a promise that resolves after time milliseconds

Kind: inner method of [JS API: random utilities](#moduleJS API random utilities)

Param
time

JS API: random utilities~parseXml(fileContent) ⇒

Returns a promise that resolve into a parsed XML object.

Kind: inner method of [JS API: random utilities](#moduleJS API random utilities)
Returns: promise that resolves into parsed object.

ParamType
fileContent*

JS API: random utilities~readFileContentAndCrc(metadata) ⇒

Reads the properties file and returns object containing ‘data’, ‘filePath’ and ‘crc’

Kind: inner method of [JS API: random utilities](#moduleJS API random utilities)
Returns: Promise to populate data, filePath and crc into the context.

ParamTypeDescription
metadata*file

JS API: random utilities~duration(nsDifference) ⇒

This method takes a nanosecond duration and prints out decently human readable time out of it.

Kind: inner method of [JS API: random utilities](#moduleJS API random utilities)
Returns: String with human readable time duration.

ParamType
nsDifference*

JS API: random utilities~mainOrSecondaryInstance()

This method returns true if the running instance is the first and main instance of the zap, and false if zap instance is already running.

Kind: inner method of [JS API: random utilities](#moduleJS API random utilities)

JS API: random utilities~collectJsonData(jsonFile)

Utility method that collects data from a JSON file.

JSON file is formatted as a bunch of keyed strings: “someKey”: [ “a”, “b”, “c”] Then it supports following special keys: “include”: “path/to/json/file” - includes the said JSON file “disable”: [ “x”, “y” ...] - disables the specified data points “collection”: [“key”, “key2”, ...] - collects final list of data points

Kind: inner method of [JS API: random utilities](#moduleJS API random utilities)

ParamType
jsonFile*

REST API: various zcl utilities

This module provides the API to access various zcl utilities.

  • [REST API: various zcl utilities](#moduleREST API various zcl utilities)
    • [~clusterComparator(a, b)](#moduleREST API various zcl utilities..clusterComparator) ⇒
    • [~attributeComparator(a, b)](#moduleREST API various zcl utilities..attributeComparator) ⇒
    • [~commandComparator(a, b)](#moduleREST API various zcl utilities..commandComparator) ⇒
    • [~eventComparator(a, b)](#moduleREST API various zcl utilities..eventComparator) ⇒
    • [~sortStructsByDependency(structs)](#moduleREST API various zcl utilities..sortStructsByDependency) ⇒
    • [~calculateBytes(res, options, db, packageIds, isStructType)](#moduleREST API various zcl utilities..calculateBytes)
    • [~optionsHashOrDefault(options, optionsKey, defaultValue)](#moduleREST API various zcl utilities..optionsHashOrDefault)
    • [~dataTypeCharacterFormatter(db, packageIds, type, options, resType)](#moduleREST API various zcl utilities..dataTypeCharacterFormatter)
    • [~isEnum(db, enum_name, packageIds)](#moduleREST API various zcl utilities..isEnum) ⇒
    • [~isStruct(db, struct_name, packageIds)](#moduleREST API various zcl utilities..isStruct) ⇒
    • [~isEvent(db, event_name, packageId)](#moduleREST API various zcl utilities..isEvent) ⇒
    • [~isBitmap(db, bitmap_name, packageIds)](#moduleREST API various zcl utilities..isBitmap) ⇒
    • [~defaultMessageForTypeConversion(fromType, toType, noWarning)](#moduleREST API various zcl utilities..defaultMessageForTypeConversion)
    • [~dataTypeHelper(type, options, packageIds, db, resolvedType, overridable)](#moduleREST API various zcl utilities..dataTypeHelper) ⇒
    • [~asUnderlyingZclTypeWithPackageId(type, options, packageIds, currentInstance)](#moduleREST API various zcl utilities..asUnderlyingZclTypeWithPackageId)
    • [~determineType(db, type, packageIds)](#moduleREST API various zcl utilities..determineType)
    • [~zcl_data_type_size_and_sign(type, dataType, clusterId, packageIds, context)](#moduleREST API various zcl utilities..zcl_data_type_size_and_sign) ⇒

REST API: various zcl utilities~clusterComparator(a, b) ⇒

Comparator for sorting clusters.

Kind: inner method of [REST API: various zcl utilities](#moduleREST API various zcl utilities)
Returns: -1, 0 or 1

ParamType
a*
b*

REST API: various zcl utilities~attributeComparator(a, b) ⇒

Comparator for sorting attribute.

Kind: inner method of [REST API: various zcl utilities](#moduleREST API various zcl utilities)
Returns: -1, 0 or 1

ParamType
a*
b*

REST API: various zcl utilities~commandComparator(a, b) ⇒

Comparator for sorting commands.

Kind: inner method of [REST API: various zcl utilities](#moduleREST API various zcl utilities)
Returns: -1, 0 or 1

ParamType
a*
b*

REST API: various zcl utilities~eventComparator(a, b) ⇒

Comparator for sorting events.

Kind: inner method of [REST API: various zcl utilities](#moduleREST API various zcl utilities)
Returns: -1, 0 or 1

ParamType
a*
b*

REST API: various zcl utilities~sortStructsByDependency(structs) ⇒

This method retrieves a bunch of structs sorted alphabetically. It's expected to resort the structs into a list where they are sorted in a way where dependency is observed.

It uses the DFS-based topological sort algorithm.

Kind: inner method of [REST API: various zcl utilities](#moduleREST API various zcl utilities)
Returns: sorted structs according to topological search.

ParamType
structs*

REST API: various zcl utilities~calculateBytes(res, options, db, packageIds, isStructType)

This function calculates the number of bytes in the data type and based on that returns the option specified in the template. for eg: Given that options are as follows: options.hash.array=“b” options.hash.one_byte=“u” options.hash.two_byte=“v” options.hash.three_byte=“x” options.hash.four_byte=“w” options.hash.short_string=“s” options.hash.long_string=“l” options.hash.default=“b”

calculateBytes(“char_string”, options) will return ‘s’

Kind: inner method of [REST API: various zcl utilities](#moduleREST API various zcl utilities)

ParamType
res*
options*
db*
packageIds*
isStructType*

REST API: various zcl utilities~optionsHashOrDefault(options, optionsKey, defaultValue)

Kind: inner method of [REST API: various zcl utilities](#moduleREST API various zcl utilities)

ParamDescription
options
optionsKey
defaultValueGiven the values determine to give the user defined value or the calculated value

REST API: various zcl utilities~dataTypeCharacterFormatter(db, packageIds, type, options, resType)

Kind: inner method of [REST API: various zcl utilities](#moduleREST API various zcl utilities)

ParamTypeDescription
db*
packageIds*
type*
options*
resType*Character associated to a zcl/c data type.

REST API: various zcl utilities~isEnum(db, enum_name, packageIds) ⇒

Local function that checks if an enum by the name exists

Kind: inner method of [REST API: various zcl utilities](#moduleREST API various zcl utilities)
Returns: Promise of content.

ParamType
db*
enum_name*
packageIds*

REST API: various zcl utilities~isStruct(db, struct_name, packageIds) ⇒

Local function that checks if a struct by the name exists

Kind: inner method of [REST API: various zcl utilities](#moduleREST API various zcl utilities)
Returns: Promise of content.

ParamType
db*
struct_name*
packageIds*

REST API: various zcl utilities~isEvent(db, event_name, packageId) ⇒

Function that checks if a given thing is an avent.

Kind: inner method of [REST API: various zcl utilities](#moduleREST API various zcl utilities)
Returns: Promise of content.

ParamType
db*
event_name*
packageId*

REST API: various zcl utilities~isBitmap(db, bitmap_name, packageIds) ⇒

Local function that checks if a bitmap by the name exists

Kind: inner method of [REST API: various zcl utilities](#moduleREST API various zcl utilities)
Returns: Promise of content.

ParamType
db*
bitmap_name*
packageIds*

REST API: various zcl utilities~defaultMessageForTypeConversion(fromType, toType, noWarning)

Kind: inner method of [REST API: various zcl utilities](#moduleREST API various zcl utilities)

ParamTypeDescription
fromType*
toType*
noWarning*Type warning message. If noWarning is set to true then the warning message will not be shown.

REST API: various zcl utilities~dataTypeHelper(type, options, packageIds, db, resolvedType, overridable) ⇒

Kind: inner method of [REST API: various zcl utilities](#moduleREST API various zcl utilities)
Returns: the data type associated with the resolvedType

ParamType
type*
options*
packageIds*
db*
resolvedType*
overridable*

REST API: various zcl utilities~asUnderlyingZclTypeWithPackageId(type, options, packageIds, currentInstance)

Kind: inner method of [REST API: various zcl utilities](#moduleREST API various zcl utilities)

ParamDescription
type
options
packageIds
currentInstanceNote: 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. It can also be used to calculate the size of the data types This is a utility function which is called from other helper functions using ut current instance. See comments in asUnderlyingZclType for usage instructions.

REST API: various zcl utilities~determineType(db, type, packageIds)

Returns a promise that resolves into an object containing: type: atomicType: Base type for struct is a null.

Kind: inner method of [REST API: various zcl utilities](#moduleREST API various zcl utilities)

ParamType
db*
type*
packageIds*

REST API: various zcl utilities~zcl_data_type_size_and_sign(type, dataType, clusterId, packageIds, context) ⇒

Kind: inner method of [REST API: various zcl utilities](#moduleREST API various zcl utilities)
Returns: The size and sign of a zcl data type

ParamType
type*
dataType*
clusterId*
packageIds*
context*

renderer_api

Copyright (c) 2020 Silicon Labs

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Kind: global variable

GLOBAL_SYMBOL_INFO

Global symbol that carries the API info metadata

Kind: global variable

GLOBAL_SYMBOL_EXECUTE

Global function that can execute the APIs.

Kind: global variable

GLOBAL_SYMBOL_NOTIFY

Global function that can be overloaded by jxbrowser for notifications

Kind: global variable

uri

Copyright (c) 2020 Silicon Labs

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Kind: global constant

dbApi

This module provides queries for discriminators

Kind: global constant

dbApi

This module provides queries for data types

Kind: global constant

dbApi

This module provides queries for numbers

Kind: global constant

dbApi

This module provides queries for strings

Kind: global constant

queryAccess

Copyright (c) 2020 Silicon Labs

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Kind: global constant

queryAttribute

Copyright (c) 2020 Silicon Labs

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Kind: global constant

queryZcl

Copyright (c) 2020 Silicon Labs

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Kind: global constant

queryCommand

Copyright (c) 2021 Silicon Labs

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Kind: global constant

cHelper

Copyright (c) 2020 Silicon Labs

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Kind: global constant

futureKey

Copyright (c) 2021 Silicon Labs

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Kind: global constant

dbEnum

Copyright (c) 2020 Silicon Labs

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Kind: global constant

templateUtil

Copyright (c) 2020 Silicon Labs

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Kind: global constant

templateUtil

Copyright (c) 2020 Silicon Labs

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Kind: global constant

queryZcl

Copyright (c) 2020 Silicon Labs

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Kind: global constant

queryZcl

Copyright (c) 2020 Silicon Labs

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Kind: global constant

queryPackage

Copyright (c) 2020 Silicon Labs

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Kind: global constant

path

Copyright (c) 2020 Silicon Labs

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Kind: global constant

fs

Copyright (c) 2020 Silicon Labs

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Kind: global constant

fs

Copyright (c) 2020 Silicon Labs

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Kind: global constant

dbApi

Copyright (c) 2020 Silicon Labs

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Kind: global constant

rendApi

Copyright (c) 2020 Silicon Labs

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Kind: global constant

env

This file is used specifically and only for development. It installs electron-debug & vue-devtools. There shouldn't be any need to modify this file, but it can be used to extend your development environment.

Kind: global constant

templateUtil

This module provides API to access various iterator utilities that can then be used to build iterator helpers.

Kind: global constant

fs

Copyright (c) 2022 Silicon Labs

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Kind: global constant

queryZcl

Copyright (c) 2020 Silicon Labs

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Kind: global constant

queryZcl

This module provides the APIs for validating inputs to the database, and returning flags indicating if things were successful or not.

Kind: global constant

fs

Copyright (c) 2020 Silicon Labs

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Kind: global constant

fs

Copyright (c) 2020 Silicon Labs

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Kind: global constant

fs

Copyright (c) 2020 Silicon Labs

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Kind: global constant

selectAllDiscriminators(db, packageIds) ⇒

Kind: global function
Returns: all the data type discriminator information

ParamType
db*
packageIds*

selectDataTypeById(db, id) ⇒

Gathers the data type information of an entry based on data type id along with its actual type from disciminator table.

Kind: global function
Returns: Data type information

Param
db
id

selectDataTypeByName(db, name, packageIds) ⇒

Gathers the data type information of an entry based on data type name along with its actual type from disciminator table.

Kind: global function
Returns: Data type information

Param
db
name
packageIds

selectDataTypeByNameAndClusterId(db, name, clusterId, packageIds) ⇒

Gathers the data type information based on data type name and clusterId along with its actual type from disciminator table.

Kind: global function
Returns: Data type information

Param
db
name
clusterId
packageIds

selectAllDataTypes(db, packageId) ⇒

Gathers All the data types

Kind: global function
Returns: All data types

Param
db
packageId

selectSizeFromType(db, packageIds, value) ⇒

Return the size of the given value whether it be a reference to it in the data type table in the form of a number or be it the name of the type in the form if string.

Kind: global function
Returns: The size of the given value

ParamType
db*
packageIds*
value*

selectNumberByName(db, name, packageIds) ⇒

Select an number matched by name.

Kind: global function
Returns: number or undefined

Param
db
name
packageIds

selectNumberByNameAndClusterId(db, name, packageIds) ⇒

Select a number matched by name and clusterId

Kind: global function
Returns: number information or undefined

Param
db
name
packageIds

selectNumberById(db, name) ⇒

Select an number matched by id.

Kind: global function
Returns: number or undefined

Param
db
name

selectAllNumbers(db, packageId) ⇒

Select all numbers.

Kind: global function
Returns: All numbers

Param
db
packageId

selectAllStrings(db, packageId) ⇒

Select all Strings.

Kind: global function
Returns: All Strings

Param
db
packageId

selectStringById(db, packageId) ⇒

Select String by ID.

Kind: global function
Returns: String

Param
db
packageId

selectStringByName(db, name, packageIds) ⇒

Select String by name.

Kind: global function
Returns: String

Param
db
name
packageIds

attributeDefault() ⇒

Valid within a cluster context, requires code.

Kind: global function
Returns: Produces attribute defaults.

if_command_arguments_exist(commandId, argument_return, no_argument_return)

Kind: global function

ParamTypeDescription
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.

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: global function
Returns: Returns content in the handlebar template based on whether the command arguments are present or not.

Param
commandId
options

if_ca_always_present_with_presentif(commandArg, trueReturn, falseReturn) ⇒

Kind: global function
Returns: trueReturn if command argument is always present and there is a presentIf condition else returns false

Param
commandArg
trueReturn
falseReturn

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: global function
Returns: Returns content in the handlebar template based on the command argument having a presentIf condition or not

Param
commandArg
options

if_command_is_not_fixed_length_but_command_argument_is_always_present(command, commandArg, trueReturn, falseReturn) ⇒

Kind: global function
Returns: trueReturn if command is not fixed length but command argument is always present else returns falseReturn

Param
command
commandArg
trueReturn
falseReturn

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: global function
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

if_ca_not_always_present_no_presentif(commandArg, trueReturn, falseReturn) ⇒

Kind: global function
Returns: trueReturn if command argument is not always present and there is no presentIf condition else returns false

Param
commandArg
trueReturn
falseReturn

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: global function
Returns: Returns content in the handlebar template based on the command argument being present and if there is a presentIf condition.

Param
commandArg
options

if_ca_not_always_present_with_presentif(commandArg, trueReturn, falseReturn) ⇒

Kind: global function
Returns: trueReturn if command argument is not always present and there is a presentIf condition else returns false

Param
commandArg
trueReturn
falseReturn

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: global function
Returns: Returns content in the handlebar template based on the command argument being present and if there is a presentIf condition.

Param
commandArg
options

if_command_is_fixed_length(commandId, fixedLengthReturn, notFixedLengthReturn)

Kind: global function

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

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: global function

ParamDescription
commandId
optionsReturns content in the handlebar template based on the command being fixed length or not as shown in the example above.

endpoint_type_count(options) ⇒

Returns number of endpoint types.

Kind: global function
Returns: number of endpoint types

ParamType
options*

endpoint_count(options) ⇒

Returns number of endpoints.

Kind: global function
Returns: number of endpoints

ParamType
options*

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: global function
Returns: Macros that need to be created

endpoint_fixed_endpoint_array(options) ⇒

Creates array of endpointId fields on endpoints

Kind: global function
Returns: C array including the brackets

ParamType
options*

endpoint_fixed_profile_id_array(options) ⇒

Creates array of profileId fields on endpoints

Kind: global function
Returns: C array including the brackets

ParamType
options*

endpoint_fixed_network_array(options) ⇒

Creates array of networkId fields on endpoints

Kind: global function
Returns: C array including the brackets

ParamType
options*

endpoint_fixed_endpoint_type_array(options) ⇒

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

Kind: global function
Returns: C array of indexes, one for each endpoint.

ParamType
options*

endpoint_attribute_manufacturer_codes(options) ⇒

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

Kind: global function
Returns: manufacturer code array

ParamType
options*

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: global function

ParamType
options*

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: global function

collectAttributeSizes(db, zclPackageIds, endpointTypes) ⇒

This function goes over all the attributes and populates sizes.

Kind: global function
Returns: promise that resolves with the passed endpointTypes, after populating the attribute type sizes.

ParamType
db*
zclPackageIds*
endpointTypes*

collectAttributeTypeInfo(db, zclPackageIds, endpointTypes) ⇒

This function goes over all attributes and populates atomic types.

Kind: global function
Returns: promise that resolves with the passed endpointTypes, after populating the attribute atomic types.

ParamType
db*
zclPackageIds*
endpointTypes*

endpoint_config(options) ⇒

Starts the endpoint configuration block., longDefaults: longDefaults

Kind: global function
Returns: a promise of a rendered block

ParamType
options*

ifFuture(options)

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

Kind: global function

ParamType
options*

setFuture(options)

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

Kind: global function

ParamType
options*

future(options)

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

Kind: global function

ParamType
options*

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: global function

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: global function

token_attribute_util(context, options) ⇒

Util function that extracts all the token attribute information.

Kind: global function
Returns: Information on all token attributes in the configuration.

ParamType
context*
options*

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: global function
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.

ParamType
endpointTypeRef*
options*

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: global function
Returns: Token associated clusters for a particular endpoint type or all token associated clusters across endpoints.

ParamType
endpointTypeRef*
options*

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: global function
Returns: all endpoints with token attributes

ParamType
options*

get_cli_size(size, type, allowZclTypes) ⇒

Kind: global function
Returns: The size in bits for a cli type based on allowZclTypes

ParamType
size*
type*
allowZclTypes*

zcl_command_argument_type_to_cli_data_type_util(type, cliPrefix, context, options) ⇒

Kind: global function
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
ParamType
type*
cliPrefix*
context*
options*

zcl_command_argument_type_to_cli_data_type(typeName, options)

Helper that deals with the type of the argument.

Kind: global function

ParamType
typeName*
options*

zcl_command_argument_type_to_zcl_cli_data_type(typeName, options)

Helper that deals with the type of the argument.

Kind: global function

ParamType
typeName*
options*

exportEndpointTypes(db, sessionId) ⇒

Resolves to an array of endpoint types.

Kind: global function
Returns: Promise to retrieve all endpoint types.

ParamType
db*
sessionId*

exportSessionPackages(db, sessionId)

Resolves with data for packages.

Kind: global function

ParamType
db*
sessionId*

exportDataIntoFile(db, sessionId, filePath) ⇒

Toplevel file that takes a given session ID and exports the data into the file

Kind: global function
Returns: A promise that resolves with the path of the file written.

ParamType
db*
sessionId*
filePath*

createStateFromDatabase(db, sessionId) ⇒

Given a database and a session id, this method returns a promise that resolves with a state object that needs to be saved into a file.

Kind: global function
Returns: state object that needs to be saved into a file.

ParamType
db*
sessionId*

locateAttribute(state)

Locates or adds an attribute, and returns it. at contains clusterId, attributeId, isClient, mfgCode and possibly value

Kind: global function

ParamType
state*

parseAttribute(attributeString, [value])

Parses attribute string in a form: cl:0xABCD, at:0xABCD, di: [client|server], mf:0xABCD

Kind: global function

ParamTypeDefault
attributeString*
[value]*

parseZclAfv2Line(state, line)

Logic that parses data out of an ISC file into a java object

Kind: global function

ParamType
state*
line*

parseZclCustomizer(state, line)

Function that deals with the zcl customizer data inside the ISC file

Kind: global function

ParamType
state*
line*

readIscData(filePath, data) ⇒

Toplevel parser that ignore anything except the two setups that are ZCL relevant.

Kind: global function
Returns: promise of read ISC data

ParamType
filePath*
data*

loadEndpointType(db, sessionId, zclPackages, endpointType)

Load individual endpoint types.

Kind: global function

ParamTypeDescription
db*
sessionId*
zclPackages*Array of package IDs for zcl queries.
endpointType*

loadImplementedCommandsForEndpoint(db, zclPackageId, state, commandExtensions, endpointTypeId)

Loads all implemented commands for a single endpoint.

Kind: global function

ParamType
db*
zclPackageId*
state*
commandExtensions*
endpointTypeId*

loadImplementedCommandsExtensions(db, zclPackageId, state, commandExtensions, endpointTypeIdArray)

This method goes over the endpoint type and the state, and enables commands that belong to enabled clusters and are listed in the commandExtensions as “implemented”.

Kind: global function

ParamType
db*
zclPackageId*
state*
commandExtensions*
endpointTypeIdArray*

loadCommands(db, state, sessionId)

This method resolves promises that contain all the queries that are needed to load the attribute state

Kind: global function

ParamType
db*
state*
sessionId*

loadAttributes(db, state, sessionId)

This method resolves promises that contain all the queries that are needed to load the attribute state

Kind: global function

ParamType
db*
state*
sessionId*

loadSessionKeyValues(db, sessionId, keyValues)

Loads the session key values from the keyValues object

Kind: global function

ParamType
db*
sessionId*
keyValues*

iscDataLoader(db, state, sessionId)

Function that actually loads the data out of a state object. Session at this point is blank, and has no packages.

Kind: global function

ParamType
db*
state*
sessionId*

importSessionKeyValues(db, sessionId, keyValuePairs)

Resolves with a promise that imports session key values.

Kind: global function

ParamType
db*
sessionId*
keyValuePairs*

autoLoadPackage(db, pkg, absPath) ⇒

Auto-load package. If succesful it returns an object. Otherwise it throws an exception.

Kind: global function
Returns: object containing packageId and packageType.

ParamType
db*
pkg*
absPath*

convertPackageResult(data) ⇒

Convert the array of results into a more palatable value. Resolves an array of { packageId:, packageType:} objects into { zclPackageId: id, templateIds: [] }

Kind: global function
Returns: an object that contains session ids.

ParamType
data*

jsonDataLoader(db, state, sessionId, packageMatch) ⇒

Given a state object, this method returns a promise that resolves with the succesfull writing into the database.

Kind: global function
Returns: a promise that resolves into a sessionId that was created.

ParamTypeDescription
db*
state*
sessionId*If null, then new session will get created, otherwise it loads the data into an existing session. Previous session data is not deleted.
packageMatch*One of the package match strategies. See dbEnum.packageMatch

readJsonData(filePath, data) ⇒

Parses JSON file and creates a state object out of it, which is passed further down the chain.

Kind: global function
Returns: Promise of parsed JSON object

ParamType
filePath*
data*

readDataFromFile(filePath) ⇒

Reads the data from the file and resolves with the state object if all is good.

Kind: global function
Returns: Promise of file reading.

ParamType
filePath*

importDataFromFile(db, filePath) ⇒

Writes the data from the file into a new session. NOTE: This function does NOT initialize session packages.

Kind: global function
Returns: a promise that resolves with the import result object that contains: sessionId, errors, warnings.

ParamType
db*
filePath*

initSessionTimers()

Start session specific validation.

Kind: global function

deinitSessionTimers(db, session)

Deinitalize all validation timers associated with a specific session.

Kind: global function

Param
db
session

startNormal(uiEnabled, showUrl, uiMode, zapFiles)

Start up application in a normal mode.

Kind: global function

ParamTypeDescription
uiEnabled*
showUrl*
uiMode*
zapFiles*An array of .zap files to open, can be empty.

outputFile(inputFile, outputPattern) ⇒

Returns the output file out of input file and a pattern

Kind: global function
Returns: the path to the output file.

ParamType
inputFile*
outputPattern*

gatherFiles(filesArg, options)

This method gathers all the files to process.

Kind: global function

ParamTypeDescription
filesArg*array of files arguments
options*

startConvert(files, output)

Perform file conversion.

Kind: global function

ParamType
files*
output*

startRegenerateSdk(argv, options)

Performs a full SDK regeneration.

Kind: global function

ParamType
argv*
options*

startAnalyze(paths, [options])

Perform file analysis.

Kind: global function

ParamTypeDefaultDescription
paths*List of paths to analyze
[options]boolean{ log: true, quit: true }

startServer(options) ⇒

Starts zap in a server mode.

Kind: global function
Returns: promise of a startup

ParamType
options*

startSelfCheck()

Start up applicationa in self-check mode.

Kind: global function

startGeneration() ⇒

Performs headless regeneration for given parameters.

Kind: global function
Returns: Nothing, triggers quit function

clearDatabaseFile(path)

Move database file out of the way into the backup location.

Kind: global function

ParamType
path*

shutdown()

Shuts down any servers that might be running.

Kind: global function

startUpSecondaryInstance(argv)

Startup method for the secondary instance.

Kind: global function

ParamType
argv*

startUpMainInstance(quitFunction, argv)

Default startup method.

Kind: global function

ParamType
quitFunction*
argv*

doOpen(menuItem, browserWindow, event)

Perform a file->open operation.

Kind: global function

ParamType
menuItem*
browserWindow*
event*

doSave(browserWindow)

Perform a save, defering to save as if file is not yet selected.

Kind: global function

ParamType
browserWindow*

doSaveAs(menuItem, browserWindow, event)

Perform save as.

Kind: global function

ParamType
menuItem*
browserWindow*
event*

fileSave(db, browserWindow, filePath) ⇒

perform the save.

Kind: global function
Returns: Promise of saving.

ParamType
db*
browserWindow*
filePath*

fileOpen(db, filePaths)

Perform the do open action, possibly reading in multiple files.

Kind: global function

ParamType
db*
filePaths*

toggleMenu(port)

Toggling of menu

Kind: global function

ParamType
port*

initMenu(httpPort)

Initial menu show.

Kind: global function

ParamType
httpPort*

all_user_cluster_commands_helper()

Helper for add_user_cluster_commands that does all the work except the collectBlocks. This allows other iterators to further filter the list before doing collectBlocks.

Kind: global function

initAsyncValidation()

Start session specific validation.

Kind: global function

collectDataFromLibraryXml(ctx) ⇒

Promises to read the properties file, extract all the actual xml files, and resolve with the array of files.

Kind: global function
Returns: Promise of resolved files.

ParamTypeDescription
ctx*Context which contains information about the metadataFiles and data

parseZclFiles(db, ctx) ⇒

Promises to iterate over all the XML files and returns an aggregate promise that will be resolved when all the XML files are done, or rejected if at least one fails.

Kind: global function
Returns: Promise that resolves when all the individual promises of each file pass.

ParamType
db*
ctx*

normalizeHexValue(value) ⇒

The Dotdot ZCL XML doesn‘t use the 0x prefix, but it’s a nice thing to have and Silabs xml does use this so this helper function normalizes the use of hex

TODO: Is this the right thing to do?

Kind: global function
Returns: Either the normalized hex string (with the 0x prefix) or the original

ParamTypeDescription
value*the string value to be normalized

getNumBytesFromShortName(value) ⇒

The Dotdot ZCL XML doesn't have a length but it is embedded in the short name, we can scrape the value to get the size

TODO: Is this the right thing to do?

Kind: global function
Returns: size in bytes or 0 if the # of bytes could not be determined

ParamTypeDescription
value*the string value to be scraped

prepareAttributes(attributes, side) ⇒

Prepare XML attributes for entry into the DB

Kind: global function
Returns: Array containing all data from XML ready to be inserted into the DB.

ParamTypeDescription
attributes*an array of attributes
side*the side the attribute is on either “client” or “server”

prepareCommands(commands, side, types) ⇒

Prepare XML commands for entry into the DB

Kind: global function
Returns: Array containing all data from XML ready to be inserted in to the DB.

ParamTypeDescription
commands*an array of commands
side*the side the command is on either “client” or “server”
types*contained for types, where bitmaps are going to be inserted.

prepareCluster(cluster, isExtension, types) ⇒

Prepare XML cluster for insertion into the database. This method can also prepare clusterExtensions.

Kind: global function
Returns: Object containing all data from XML.

ParamTypeDefaultDescription
cluster*
isExtension*falseif this is an extension or not (there are none in dotdot xml)
types*types object into which cluster can put types it might have

prepareAtomic(type) ⇒

Parses xml type into the atomic object for insertion into the DB

Kind: global function
Returns: object ready for insertion into the DB

ParamTypeDescription
type*an xml object which conforms to the atomic format in the dotdot xml

prepareBitmap(type, isContained) ⇒

Parses xml type into the bitmap object for insertion into the DB

Kind: global function
Returns: object ready for insertion into the DB

ParamTypeDefaultDescription
type*an xml object which conforms to the bitmap format in the dotdot xml
isContained*falsea boolean indicating if this is coming from a contained tag or not

prepareEnum(type) ⇒

Parses xml type into the enum object for insertion into the DB

Kind: global function
Returns: object ready for insertion into the DB

ParamTypeDescription
type*an xml object which conforms to the enum format in the dotdot xml

prepareStruct(type) ⇒

Parses xml type into the struct object for insertion into the DB

Kind: global function
Returns: object ready for insertion into the DB

ParamTypeDescription
type*an xml object which conforms to the struct format in the dotdot xml

prepareTypes(zclTypes, types)

Parses xml types into the types object for insertion into the DB

Kind: global function

ParamTypeDescription
zclTypes*an array of xml types
types*an object which includes arrays for enums, bitmaps etc...

prepareAttributeType(attribute, types, cluster)

Parses xml types into the types object for insertion into the DB

Kind: global function

ParamTypeDescription
attribute*an attribute with the type in it
types*an object which includes arrays for enums, bitmaps etc...
cluster*the cluster that the attribute belongs to (used presently for uniqueness of the type name)

prepareDeviceType(deviceType) ⇒

Preparation step for the device types.

Kind: global function
Returns: an object containing the prepared device types.

ParamType
deviceType*

prepareDataTypeDiscriminator(a) ⇒

Prepare Data Type Discriminator for database table insertion.

Kind: global function
Returns: An Object

ParamType
a*

processDataTypeDiscriminator(db, packageId, zclDataTypes) ⇒

Processes Data Type Discriminator.

Kind: global function
Returns: Promise of inserted Data Type Discriminators.

ParamType
db*
packageId*
zclDataTypes*

prepareDataType(a, dataType, typeMap) ⇒

Prepare Data Types for database table insertion.

Kind: global function
Returns: An Object

ParamType
a*
dataType*
typeMap*

processDataType(db, filePath, packageId, data, dataType) ⇒

Processes Data Type.

Kind: global function
Returns: Promise of inserted Data Types into the Data Type table.

ParamType
db*
filePath*
packageId*
data*
dataType*

prepareNumber(a, dataType) ⇒

Prepare numbers for database table insertion.

Kind: global function
Returns: An Object

ParamType
a*
dataType*

processNumber(db, filePath, packageId, data) ⇒

Processes Numbers.

Kind: global function
Returns: Promise of inserted numbers into the number table.

ParamType
db*
filePath*
packageId*
data*

prepareString(a, dataType) ⇒

Prepare strings for database table insertion.

Kind: global function
Returns: An Object

ParamType
a*
dataType*

processString(db, filePath, packageId, data) ⇒

Processes Strings.

Kind: global function
Returns: Promise of inserted strings into the String table.

ParamType
db*
filePath*
packageId*
data*

prepareEnumsOrBitmaps(a, dataType) ⇒

Prepare enums or bitmaps for database table insertion.

Kind: global function
Returns: An Object

ParamType
a*
dataType*

processEnums(db, filePath, packageId, data) ⇒

Processes the enums.

Kind: global function
Returns: A promise of inserted enums.

ParamType
db*
filePath*
packageId*
data*

processEnumItems(db, filePath, packageId, data) ⇒

Processes the enum Items.

Kind: global function
Returns: A promise of inserted enum items.

ParamType
db*
filePath*
packageId*
data*

processBitmaps(db, filePath, packageId, data) ⇒

Processes the bitmaps.

Kind: global function
Returns: A promise of inserted bitmaps.

ParamType
db*
filePath*
packageId*
data*

processBitmapFields(db, filePath, packageId, data) ⇒

Processes the bitmap fields.

Kind: global function
Returns: A promise of inserted bitmap fields.

ParamType
db*
filePath*
packageId*
data*

prepareStruct2(a, dataType) ⇒

Prepare structs for database table insertion.

Kind: global function
Returns: An Object

ParamType
a*
dataType*

processStruct(db, filePath, packageId, data) ⇒

Processes the structs.

Kind: global function
Returns: A promise of inserted structs.

ParamType
db*
filePath*
packageId*
data*

processStructItems(db, filePath, packageId, data) ⇒

Processes the struct Items.

Kind: global function
Returns: A promise of inserted struct items.

ParamType
db*
filePath*
packageId*
data*

prepareEnumsOrBitmapsAtomic(a, dataType) ⇒

Prepare enums or bitmaps for database table insertion.

Kind: global function
Returns: An Object

ParamType
a*
dataType*

processEnumsFromAtomics(db, filePath, packageId, data) ⇒

Processes the enums.

Kind: global function
Returns: A promise of inserted enums.

ParamType
db*
filePath*
packageId*
data*

processBitmapsFromAtomics(db, filePath, packageId, data) ⇒

Processes the bitmaps.

Kind: global function
Returns: A promise of inserted bitmaps.

ParamType
db*
filePath*
packageId*
data*

loadZclData(db, ctx) ⇒

Promises to iterate over all the XML files and returns an aggregate promise that will be resolved when all the XML files are done, or rejected if at least one fails.

Kind: global function
Returns: Promise that resolves when all the individual promises of each file pass.

ParamType
db*
ctx*

loadIndividualDotDotFile(db, filePath) ⇒ *

TODO This is not supported at this time.

Kind: global function
Returns: * - object w/ following: { packageId: pkgId } or { err: err }

ParamType
db*
filePath*

loadDotdotZcl(db, ctx) ⇒

Toplevel function that loads the xml library file and orchestrates the promise chain.

Kind: global function
Returns: a Promise that resolves with the db.

ParamTypeDescription
db*
ctx*Context of loading.

collectDataFromJsonFile(ctx) ⇒

Promises to read the JSON file and resolve all the data.

Kind: global function
Returns: Promise of resolved file.

ParamTypeDescription
ctx*Context containing information about the file

collectDataFromPropertiesFile(ctx) ⇒

Promises to read the properties file, extract all the actual xml files, and resolve with the array of files.

Kind: global function
Returns: Promise of resolved files.

ParamTypeDescription
ctx*Context which contains information about the propertiesFiles and data

maskToType(mask) ⇒

Silabs XML does not carry types with bitmap fields, but dotdot does, so they are in the schema. Just to put some data in, we differentiate between “bool” and “enum” types here.

Kind: global function
Returns: bool or corresponding enum

ParamType
mask*

prepareAtomic(a)

Prepare atomic to db insertion.

Kind: global function

ParamType
a*

processAtomics(db, filePath, packageId, data) ⇒

Processes atomic types for DB insertion.

Kind: global function
Returns: Promise of inserted bitmaps

ParamType
db*
filePath*
packageId*
data*

prepareClusterGlobalAttribute(cluster) ⇒

Prepares global attribute data.

Kind: global function
Returns: Object containing the data from XML.

ParamType
cluster*

prepareCluster(cluster) ⇒

Prepare XML cluster for insertion into the database. This method can also prepare clusterExtensions.

Kind: global function
Returns: Object containing all data from XML.

ParamType
cluster*

processClusters(db, filePath, packageId, data) ⇒

Process clusters for insertion into the database.

Kind: global function
Returns: Promise of cluster insertion.

ParamType
db*
filePath*
packageId*
data*

processClusterGlobalAttributes(db, filePath, packageId, data) ⇒

Processes global attributes for insertion into the database.

Kind: global function
Returns: Promise of inserted data.

ParamType
db*
filePath*
packageId*
data*

processClusterExtensions(db, filePath, packageId, data) ⇒

Cluster Extension contains attributes and commands in a same way as regular cluster, and it has an attribute code=“0xXYZ” where code is a cluster code.

Kind: global function
Returns: promise to resolve the clusterExtension tags

ParamType
db*
filePath*
packageId*
data*

processGlobals(db, filePath, packageId, data) ⇒

Processes the globals in the XML files. The global tag contains attributes and commands in a same way as cluster or clusterExtension

Kind: global function
Returns: promise to resolve the globals

ParamType
db*
filePath*
packageId*
data*

processDefaultAccess(db, filePath, packageId, defaultAccessList)

Process defaultAccess tag in the XML.

Kind: global function

ParamType
db*
filePath*
packageId*
defaultAccessList*

processAccessControl(db, filePath, packageId, accessControlList)

Process accessControl tag in the XML.

Kind: global function

ParamType
db*
filePath*
packageId*
accessControlList*

processTags(db, filePath, packageId, tags)

Processes the tags in the XML.

Kind: global function

ParamType
db*
filePath*
packageId*
tags*

prepareDomain(domain) ⇒

Convert domain from XMl to domain for DB.

Kind: global function
Returns: Domain object for DB.

ParamType
domain*

processDomains(db, filePath, packageId, data) ⇒

Process domains for insertion.

Kind: global function
Returns: Promise of database insertion of domains.

ParamType
db*
filePath*
packageId*
data*

prepareDataTypeDiscriminator(a) ⇒

Prepare Data Type Discriminator for database table insertion.

Kind: global function
Returns: An Object

ParamType
a*

processDataTypeDiscriminator(db, filePath, zclDataTypes) ⇒

Processes Data Type Discriminator.

Kind: global function
Returns: Promise of inserted Data Type Discriminators.

ParamType
db*
filePath*
zclDataTypes*

prepareDataType(a, dataType, typeMap) ⇒

Prepare Data Types for database table insertion.

Kind: global function
Returns: An Object

ParamType
a*
dataType*
typeMap*

processDataType(db, filePath, packageId, knownPackages, data, dataType) ⇒

Processes Data Type.

Kind: global function
Returns: Promise of inserted Data Types into the Data Type table.

ParamType
db*
filePath*
packageId*
knownPackages*
data*
dataType*

prepareNumber(a, dataType) ⇒

Prepare numbers for database table insertion.

Kind: global function
Returns: An Object

ParamType
a*
dataType*

processNumber(db, filePath, packageId, knownPackages, data) ⇒

Processes Numbers.

Kind: global function
Returns: Promise of inserted numbers into the number table.

ParamType
db*
filePath*
packageId*
knownPackages*
data*

prepareString(a, dataType) ⇒

Prepare strings for database table insertion.

Kind: global function
Returns: An Object

ParamType
a*
dataType*

processString(db, filePath, packageId, knownPackages, data) ⇒

Processes Strings.

Kind: global function
Returns: Promise of inserted strings into the String table.

ParamType
db*
filePath*
packageId*
knownPackages*
data*

prepareEnumOrBitmapAtomic(a, dataType) ⇒

Prepare enums or bitmaps for database table insertion.

Kind: global function
Returns: An Object

ParamType
a*
dataType*

processEnumAtomic(db, filePath, packageId, knownPackages, data) ⇒

Processes the enums.

Kind: global function
Returns: A promise of inserted enums.

ParamType
db*
filePath*
packageId*
knownPackages*
data*

prepareEnumOrBitmap(a, dataType) ⇒

Prepare enums or bitmaps for database table insertion.

Kind: global function
Returns: An Object

ParamType
a*
dataType*

processEnum(db, filePath, packageId, knownPackages, data) ⇒

Processes the enums.

Kind: global function
Returns: A promise of inserted enums.

ParamType
db*
filePath*
packageId*
knownPackages*
data*

processEnumItems(db, filePath, packageId, knownPackages, data) ⇒

Processes the enum Items.

Kind: global function
Returns: A promise of inserted enum items.

ParamType
db*
filePath*
packageId*
knownPackages*
data*

processBitmapAtomic(db, filePath, packageId, knownPackages, data) ⇒

Processes the bitmaps.

Kind: global function
Returns: A promise of inserted bitmaps.

ParamType
db*
filePath*
packageId*
knownPackages*
data*

processBitmap(db, filePath, packageId, knownPackages, data) ⇒

Processes the bitmaps.

Kind: global function
Returns: A promise of inserted bitmaps.

ParamType
db*
filePath*
packageId*
knownPackages*
data*

processBitmapFields(db, filePath, packageId, knownPackages, data) ⇒

Processes the bitmap fields.

Kind: global function
Returns: A promise of inserted bitmap fields.

ParamType
db*
filePath*
packageId*
knownPackages*
data*

prepareStruct(a, dataType) ⇒

Prepare structs for database table insertion.

Kind: global function
Returns: An Object

ParamType
a*
dataType*

processStruct(db, filePath, packageId, knownPackages, data) ⇒

Processes the structs.

Kind: global function
Returns: A promise of inserted structs.

ParamType
db*
filePath*
packageId*
knownPackages*
data*

processStructItems(db, filePath, packageIds, data) ⇒

Processes the struct Items.

Kind: global function
Returns: A promise of inserted struct items.

ParamType
db*
filePath*
packageIds*
data*

prepareDeviceType(deviceType) ⇒

Preparation step for the device types.

Kind: global function
Returns: an object containing the prepared device types.

ParamType
deviceType*

processDeviceTypes(db, filePath, packageId, data) ⇒

Process all device types.

Kind: global function
Returns: Promise of a resolved device types.

ParamType
db*
filePath*
packageId*
data*

processParsedZclData(db, argument) ⇒

After XML parser is done with the barebones parsing, this function branches the individual toplevel tags.

Kind: global function
Returns: promise that resolves when all the subtags are parsed.

ParamType
db*
argument*

parseSingleZclFile(db, packageId, file) ⇒

This function is used for parsing each individual ZCL file at a grouped zcl file package level. This should not be used for custom XML addition due to custom xmls potentially relying on existing packges.

Kind: global function
Returns: A promise for when the last stage of the loading pipeline finishes.

ParamType
db*
packageId*
file*

parseZclFiles(db, packageId, zclFiles, context) ⇒

Promises to iterate over all the XML files and returns an aggregate promise that will be resolved when all the XML files are done, or rejected if at least one fails.

Kind: global function
Returns: Promise that resolves when all the individual promises of each file pass.

ParamType
db*
packageId*
zclFiles*
context*

parseManufacturerData(db, ctx) ⇒

Parses the manufacturers xml.

Kind: global function
Returns: Promise of a parsed manufacturers file.

ParamType
db*
ctx*

parseProfilesData(db, ctx) ⇒

Parses the profiles xml.

Kind: global function
Returns: Promise of a parsed profiles file.

ParamType
db*
ctx*

parseFeatureFlags(db, packageId, featureFlags) ⇒

Inside the zcl.json can be a featureFlags key, which is a general purpose object. It contains keys, that map to objects. Each key is a “package option category”. Key/velues of the object itself, end up in CODE/LABEL combinations.

Kind: global function
Returns: array of feature flags

ParamType
db*
packageId*
featureFlags*

parseUiOptions(db, packageId, featureFlags) ⇒

Inside the zcl.json can be a featureFlags key, which is a general purpose object. It contains keys, that map to objects. Each key is a “package option category”. Key/velues of the object itself, end up in CODE/LABEL combinations.

Kind: global function
Returns: Promise that loads the uiOptions object into the database.

ParamType
db*
packageId*
featureFlags*

parseOptions(db) ⇒

Parses and loads the text and boolean options.

Kind: global function
Returns: promise of parsed options

ParamType
db*

parseTextOptions(db, pkgRef, textOptions) ⇒

Parses the text options.

Kind: global function
Returns: Promise of a parsed text options.

ParamType
db*
pkgRef*
textOptions*

parseBoolOptions(db, pkgRef, booleanCategories) ⇒

Parses the boolean options.

Kind: global function
Returns: Promise of a parsed boolean options.

ParamType
db*
pkgRef*
booleanCategories*

parseDefaults(db, ctx) ⇒

Parses the default values inside the options.

Kind: global function
Returns: Promised of parsed text and bool defaults.

ParamType
db*
ctx*

loadIndividualSilabsFile(db, filePath) ⇒

Parses a single file. This function is used specifically for adding a package through an existing session because of its reliance on relating the new XML content to the packages associated with that session. e.g. for ClusterExtensions.

Kind: global function
Returns: Promise of a loaded file.

ParamType
db*
filePath*

processCustomZclDeviceType(db, ctx) ⇒

If custom device is supported, then this method creates it.

Kind: global function
Returns: context

ParamType
db*
ctx*

loadSilabsZcl(db, ctx) ⇒

Toplevel function that loads the toplevel metafile and orchestrates the promise chain.

Kind: global function
Returns: a Promise that resolves with the db.

ParamTypeDescription
db*
ctx*The context of loading.

recordToplevelPackage(db, metadataFile, crc) ⇒

Records the toplevel package information and resolves into packageId

Kind: global function
Returns: packageId

ParamType
db*
metadataFile*
crc*

recordVersion(db, ctx)

Records the version into the database.

Kind: global function

ParamType
db*
ctx*

loadZclMetafiles(db, metadataFile) ⇒

Toplevel function that loads the zcl file and passes it off to the correct zcl loader.

Kind: global function
Returns: Array of loaded packageIds.

ParamTypeDescription
db*
metadataFile*array of paths

loadZcl(db, metadataFile) ⇒

Loads individual zcl.json metafile.

Kind: global function
Returns: Context object that contains .db and .packageId

ParamType
db*
metadataFile*

loadIndividualFile(db, filePath, sessionId)

Load individual custom XML files.

Kind: global function

ParamTypeDescription
db*
filePath*
sessionId*Current session within which we're loading this file.

qualifyZclFile(db, info, parentPackageId) ⇒

Promises to qualify whether zcl file needs to be reloaded. If yes, the it will resolve with {filePath, data, packageId} If not, then it will resolve with {error}

Kind: global function
Returns: Promise that resolves int he object of data.

ParamType
db*
info*
parentPackageId*

processZclPostLoading(db) ⇒

Promises to perform a post loading step.

Kind: global function
Returns: Promise to deal with the post-loading cleanup.

ParamType
db*

getDiscriminatorMap(db, packageIds) ⇒

Kind: global function
Returns: data type discriminator map

ParamType
db*
packageIds*