Skip to content

Files

Latest commit

 Cannot retrieve latest commit at this time.

History

History
28172 lines (20474 loc) · 1.14 MB
·

api.md

File metadata and controls

28172 lines (20474 loc) · 1.14 MB
·

Modules

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.

Renderer API: Renderer API.

This module provides Renderer API Exports.

REST API: REST API.

This module provides REST API Exports.

IPC Client API: Inter-process communication

This module provides IPC Client functionality.

JS API: low level database access

This module provides generic DB functions for performing SQL queries.

DB API: zcl database access

This module provides cache for commonly used static database queries.

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: attribute queries.

This module provides queries related to attributes.

DB API: zcl database access

This module provides queries for bitmaps.

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: Data type discriminator queries against the database.

This module provides queries for data type discriminator

DB API: Data type queries against the database.

This module provides queries for data types

DB API: device type database access

This module provides queries for device types.

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 enum access

This module provides queries for enums.

DB API: event queries.

This module provides queries related to events.

DB API: feature related queries

This module provides queries for features.

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 database number access

This module provides queries for numbers.

DB API: session related queries.

This module provides package notification related queries.

DB API: package-based queries.

This module provides queries related to packages.

DB API: session related queries.

This module provides session notification related queries.

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: session related queries.

This module provides session related queries.

DB API: zcl database strings access

This module provides queries for strings.

DB API: zcl database access

This module provides queries for enums.

DB API: zcl database access

This module provides a place for creating generic queries which are common across different query files.

DB API: zcl database access

This module provides queries for ZCL static queries.

JS API: generator logic
Templating API: Access helpers

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

Templating API: Attribute helpers

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

Templating API: C formatting helpers

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

Templating API: Command helpers

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

Templating API: Matter endpoint config helpers

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

Templating API: Future helpers

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

Templating API: SDK extension helpers

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

Templating API: C formatting helpers

This module contains the API for accessing SDK extensions.

Templating API: user-data specific helpers

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

Templating API: Token helpers

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

Templating API: toplevel utility helpers

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

Templating API: static zcl helpers

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

Templating API: Zigbee Specific helpers

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

Templating API: Overridable functions.

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

JS API: generator logic
JS API: template iterators.
JS API: generator logic
IDE Integration API: Studio REST API.

This module provides the APIs to Silabs Simplicity Studio's Jetty server.

REST API: user data

This module provides the API to access zcl specific information.

Export API: Exports Data into a file.

This module provides the functionality that reads the ZAP data from a database and exports it into a file.

zap file

Formats ZAP file in a certain format.

Import API: Imports data from a file.

This module provides the functionality that reads a .isc file

Import API: Imports data from a file.

This module provides the functionality that reads a .json(.zap) file

Import API: Imports data from a file.

This file provides the functionality that reads the ZAP data from a JSON file and imports it into a database.

Timer API: initializes times.

This module provides the APIs for initializing timers specifically for sessions.

Startup API: initializes times.

This file contains various startup modes.

watchdog API: initializes times.

This file contains watchdogs.

REST API: admin functions

This module provides the REST API to the admin functions.

REST API: endpoint

This module provides the REST API to the user specific data.

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

This module provides the REST API to the IDE component handling.

REST API: initialization functions

This module provides the REST API to the session initialization

REST API: static zcl functions

This module provides the REST API to the static zcl queries.

REST API: user data

This module provides the REST API to the user specific data.

JS API: Matter specific APIs.

This module contains Matter specific APIs.

JS API: http server

This module provides the HTTP server functionality.

IPC Server API: Inter-process communication

This module provides IPC Server functionality.

JS API: websocket server

This module provides the HTTP server functionality.

JS API: About page

This module provides the About page functionality for ZAP.

JS API: renderer API related utilities
JS API: UI Development

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.

JS API: UI

Main UI

JS API: Menu for ZAP UI

Menu for ZAP UI

JS API: Tray for ZAP UI

Tray for ZAP UI

JS API: Utility module for ZAP UI

Utility module for ZAP UI

JS API: Window module for ZAP UI

Window module for ZAP UI

JS API: Arguments for ZAP

Arguments for ZAP

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: Binary utilities

Binary utilities to deal with hex numbers and such.

JS API: Environment utilities

Environment utilities for ZAP

External API: External API utilities

External helper utilities for ZAP

External API: External API utilities

External Registry utilities for ZAP

External API: External API utilities

External helper utilities for ZAP

JS API: Iterator utilities

This module provides API to access various iterator utilities that can then be used to build iterator helpers.

JS API: post-import.

This module contains the API functions for the post-load scripting functionality.

JS API: post-import.

This module contains the API functions for the post-load scripting functionality.

JS API: SDK utilities
JS API: string utilities
JS API: Studio utilities
JS API: type related utilities
JS API: random utilities
REST API: various zcl utilities

This module provides the API to access various zcl utilities.

Validation API: Validation APIs

This module provides the APIs for validating inputs to the database, and returning flags indicating if things were successful or not.

Validation API: check element conformance

This module provides utilities for checking if elements meet conformance requirements and generate warnings for non-conformance.

Validation API: Evaluate conformance expressions

This module provides utilities for evaluating conformance expressions.

Validation API: Parse conformance data from XML

This module provides utilities for parsing conformance data from XML into expressions.

Validation API: Validation APIs

This module provides the APIs for validating inputs to the database, and returning flags indicating if things were successful or not.

Loader API: Loader APIs

This module provides the APIs for dotdot Loading

Loader API: Loader APIs

This module provides the APIs for new data model loading

Loader API: Loader APIs

This module provides the APIs for ZCL/Data-Model loading.

Loader API: Loader APIs

This module provides the APIs for for common functionality related to loading.

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.

Renderer API: Renderer API.

This module provides Renderer API Exports.

  • [Renderer API: Renderer API.](#module_Renderer API_ Renderer API.)
    • [.GLOBAL_SYMBOL_INFO](#module_Renderer API_ Renderer API..GLOBAL_SYMBOL_INFO)
    • [.GLOBAL_SYMBOL_EXECUTE](#module_Renderer API_ Renderer API..GLOBAL_SYMBOL_EXECUTE)
    • [.GLOBAL_SYMBOL_NOTIFY](#module_Renderer API_ Renderer API..GLOBAL_SYMBOL_NOTIFY)

Renderer API: Renderer API..GLOBAL_SYMBOL_INFO

Global symbol that carries the API info metadata

Kind: static property of [Renderer API: Renderer API.](#module_Renderer API_ Renderer API.)

Renderer API: Renderer API..GLOBAL_SYMBOL_EXECUTE

Global function that can execute the APIs.

Kind: static property of [Renderer API: Renderer API.](#module_Renderer API_ Renderer API.)

Renderer API: Renderer API..GLOBAL_SYMBOL_NOTIFY

Global function that can be overloaded by jxbrowser for notifications

Kind: static property of [Renderer API: Renderer API.](#module_Renderer API_ Renderer API.)

REST API: REST API.

This module provides REST API Exports.

IPC Client API: Inter-process communication

This module provides IPC Client functionality.

  • [IPC Client API: Inter-process communication](#module_IPC Client API_ Inter-process communication)
    • [~log(msg)](#module_IPC Client API_ Inter-process communication..log)
    • [~initAndConnectClient()](#module_IPC Client API_ Inter-process communication..initAndConnectClient) ⇒
    • [~on(eventType, handler)](#module_IPC Client API_ Inter-process communication..on)
    • [~lastPongData()](#module_IPC Client API_ Inter-process communication..lastPongData) ⇒
    • [~isClientConnected()](#module_IPC Client API_ Inter-process communication..isClientConnected) ⇒
    • [~disconnectClient()](#module_IPC Client API_ Inter-process communication..disconnectClient)
    • [~emit(key, object)](#module_IPC Client API_ Inter-process communication..emit)

IPC Client API: Inter-process communication~log(msg)

Log ipc client message

Kind: inner method of [IPC Client API: Inter-process communication](#module_IPC Client API_ Inter-process communication)

Param Type
msg *

IPC Client API: Inter-process communication~initAndConnectClient() ⇒

Initializes and connects a client.

Kind: inner method of [IPC Client API: Inter-process communication](#module_IPC Client API_ Inter-process communication)
Returns: a promise which resolves when client connects

IPC Client API: Inter-process communication~on(eventType, handler)

Register a handler for the event type.

Kind: inner method of [IPC Client API: Inter-process communication](#module_IPC Client API_ Inter-process communication)

Param Type
eventType *
handler *

IPC Client API: Inter-process communication~lastPongData() ⇒

Get the last pong data.

Kind: inner method of [IPC Client API: Inter-process communication](#module_IPC Client API_ Inter-process communication)
Returns: last pong data or null if none is available

IPC Client API: Inter-process communication~isClientConnected() ⇒

Returns true if client is connected.

Kind: inner method of [IPC Client API: Inter-process communication](#module_IPC Client API_ Inter-process communication)
Returns: true if client is connected

IPC Client API: Inter-process communication~disconnectClient()

Disconnects a client asynchronously.

Kind: inner method of [IPC Client API: Inter-process communication](#module_IPC Client API_ Inter-process communication)

IPC Client API: Inter-process communication~emit(key, object)

Sends a message to server.

Kind: inner method of [IPC Client API: Inter-process communication](#module_IPC Client API_ Inter-process communication)

Param Type
key *
object *

JS API: low level database access

This module provides generic DB functions for performing SQL queries.

  • [JS API: low level database access](#module_JS API_ low level database access)
    • [~executeBeginTransaction(db, resolve, reject)](#module_JS API_ low level database access..executeBeginTransaction)
    • [~delayBeginTransaction(db, resolve, reject)](#module_JS API_ low level database access..delayBeginTransaction)
    • [~dbBeginTransaction(db)](#module_JS API_ low level database access..dbBeginTransaction) ⇒
    • [~dbCommit(db)](#module_JS API_ low level database access..dbCommit) ⇒
    • [~isTransactionActive()](#module_JS API_ low level database access..isTransactionActive) ⇒
    • [~dbRollback(db)](#module_JS API_ low level database access..dbRollback) ⇒
    • [~dbRemove(db, query, args)](#module_JS API_ low level database access..dbRemove) ⇒
    • [~dbUpdate(db, query, args)](#module_JS API_ low level database access..dbUpdate) ⇒
    • [~dbInsert(db, query, args)](#module_JS API_ low level database access..dbInsert) ⇒
    • [~dbAll(db, query, args)](#module_JS API_ low level database access..dbAll) ⇒
    • [~dbGet(db, query, args)](#module_JS API_ low level database access..dbGet) ⇒
    • [~dbMultiSelect(db, sql, arrayOfArrays)](#module_JS API_ low level database access..dbMultiSelect)
    • [~dbMultiInsert(db, sql, arrayOfArrays)](#module_JS API_ low level database access..dbMultiInsert) ⇒
    • [~closeDatabase(database)](#module_JS API_ low level database access..closeDatabase) ⇒
    • [~closeDatabaseSync(database)](#module_JS API_ low level database access..closeDatabaseSync)
    • [~initRamDatabase()](#module_JS API_ low level database access..initRamDatabase) ⇒
    • [~initDatabase(sqlitePath)](#module_JS API_ low level database access..initDatabase) ⇒
    • [~insertOrReplaceSetting(db, version)](#module_JS API_ low level database access..insertOrReplaceSetting) ⇒
    • [~updateSetting(db, rows)](#module_JS API_ low level database access..updateSetting) ⇒
    • [~selectSettings(db)](#module_JS API_ low level database access..selectSettings) ⇒
    • [~determineIfSchemaShouldLoad(db, context)](#module_JS API_ low level database access..determineIfSchemaShouldLoad) ⇒
    • [~updateCurrentSchemaCrc(db, filePath, crc)](#module_JS API_ low level database access..updateCurrentSchemaCrc) ⇒
    • [~performSchemaLoad(db, schemaContent)](#module_JS API_ low level database access..performSchemaLoad) ⇒
    • [~loadSchema(db, schemaPath, zapVersion)](#module_JS API_ low level database access..loadSchema) ⇒
    • [~initDatabaseAndLoadSchema(sqliteFile, schemaFile, zapVersion)](#module_JS API_ low level database access..initDatabaseAndLoadSchema) ⇒
    • [~toDbBool(value)](#module_JS API_ low level database access..toDbBool) ⇒
    • [~fromDbBool(value)](#module_JS API_ low level database access..fromDbBool) ⇒
    • [~toInClause(value)](#module_JS API_ low level database access..toInClause) ⇒

JS API: low level database access~executeBeginTransaction(db, resolve, reject)

Begin Database transaction.

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

Param Type
db *
resolve *
reject *

JS API: low level database access~delayBeginTransaction(db, resolve, reject)

Delay database transaction.

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

Param Type
db *
resolve *
reject *

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](#module_JS API_ low level database access)
Returns: A promise that resolves without an argument and rejects with an error from BEGIN TRANSACTION query.

Param Type
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](#module_JS API_ low level database access)
Returns: A promise that resolves without an argument or rejects with an error from COMMIT query.

Param Type
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](#module_JS 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](#module_JS API_ low level database access)
Returns: A promise that resolves without an argument or rejects with an error from ROLLBACK query.

Param Type
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](#module_JS API_ low level database access)
Returns: A promise that resolve with the number of delete rows, or rejects with an error from query.

Param Type
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](#module_JS API_ low level database access)
Returns: A promise that resolves with a number of changed rows, or rejects with an error from the query.

Param Type
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](#module_JS 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.

Param Type
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](#module_JS 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.

Param Type
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](#module_JS 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.

Param Type
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](#module_JS API_ low level database access)

Param Type
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](#module_JS 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.

Param Type
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](#module_JS API_ low level database access)
Returns: A promise that resolves without an argument or rejects with error from the database closing.

Param Type
database *

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

Imediatelly closes the database.

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

Param Type
database *

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

Create in-memory database.

Kind: inner method of [JS API: low level database access](#module_JS 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](#module_JS 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.

Param Type
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](#module_JS 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.

Param Type
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](#module_JS API_ low level database access)
Returns: A promise that resolves with the SETTING table being repopulated

Param Type
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](#module_JS API_ low level database access)
Returns: A promise resolving the entire SETTING table

Param Type
db *

JS API: low level database access~determineIfSchemaShouldLoad(db, context) ⇒

Checks the state of schema.

Kind: inner method of [JS API: low level database access](#module_JS API_ low level database access)
Returns: object containing "mustLoad" and "hasSchema" elements.

Param Type
db *
context *

JS API: low level database access~updateCurrentSchemaCrc(db, filePath, crc) ⇒

Update the CRC of the sql schema file.

Kind: inner method of [JS API: low level database access](#module_JS API_ low level database access)
Returns: promise of insert transaction.

Param Type
db *
filePath *
crc *

JS API: low level database access~performSchemaLoad(db, schemaContent) ⇒

Load SQL Schema

Kind: inner method of [JS API: low level database access](#module_JS API_ low level database access)
Returns: Promise of loaded schema

Param Type
db *
schemaContent *

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](#module_JS API_ low level database access)
Returns: A promise that resolves with the same db that got passed in, or rejects with an error.

Param Type
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](#module_JS API_ low level database access)
Returns: Promise that resolves into the database object.

Param Type
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](#module_JS API_ low level database access)
Returns: Value to be stored into the database.

Param Type
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](#module_JS API_ low level database access)
Returns: value to be used in JS after reading value from database.

Param Type
value *

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

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

Param Type
value *

DB API: zcl database access

This module provides cache for commonly used static database queries.

  • [DB API: zcl database access](#module_DB API_ zcl database access)
    • [~clear()](#module_DB API_ zcl database access..clear)
    • [~put(key, packageId, data)](#module_DB API_ zcl database access..put) ⇒
    • [~get(key, packageId)](#module_DB API_ zcl database access..get) ⇒
    • [~isCached(key, packageId)](#module_DB API_ zcl database access..isCached) ⇒
    • [~cacheQuery(key, packageId)](#module_DB API_ zcl database access..cacheQuery) ⇒
    • [~cacheStats()](#module_DB API_ zcl database access..cacheStats)
    • [~enable()](#module_DB API_ zcl database access..enable)
    • [~disable()](#module_DB API_ zcl database access..disable)
    • [~selectAllAtomics(db, packageId)](#module_DB API_ zcl database access..selectAllAtomics) ⇒
    • [~selectAtomicType(db, packageId, typeName)](#module_DB API_ zcl database access..selectAtomicType)
    • [~selectAtomicById(db, packageId)](#module_DB API_ zcl database access..selectAtomicById)
    • [~isTypeSignedByNameAndPackage(db, name, sessionPackages)](#module_DB API_ zcl database access..isTypeSignedByNameAndPackage) ⇒ Promise.<boolean>
    • [~selectAllBitmaps(db)](#module_DB API_ zcl database access..selectAllBitmaps) ⇒
    • [~selectBitmapByName(db, packageIds, name)](#module_DB API_ zcl database access..selectBitmapByName) ⇒
    • [~selectBitmapByNameAndClusterId(db, name, clusterId, packageIds)](#module_DB API_ zcl database access..selectBitmapByNameAndClusterId) ⇒
    • [~selectBitmapByNameAndClusterName(db, name, clusterName, packageIds)](#module_DB API_ zcl database access..selectBitmapByNameAndClusterName) ⇒
    • [~selectBitmapById(db, id)](#module_DB API_ zcl database access..selectBitmapById) ⇒
    • [~selectSessionClusterByCode(db, sessionId, code, mfgCode)](#module_DB API_ zcl database access..selectSessionClusterByCode) ⇒
    • [~selectAllSessionClusters(db, sessionId)](#module_DB API_ zcl database access..selectAllSessionClusters) ⇒
    • [~selectSessionAttributeByCode(db, sessionId, clusterCode, side, attributeCode, mfgCode)](#module_DB API_ zcl database access..selectSessionAttributeByCode) ⇒
    • [~selectSessionCommandByCode(db, sessionId, clusterCode, commandCode, source)](#module_DB API_ zcl database access..selectSessionCommandByCode) ⇒
    • [~selectAllStructs(db, packageId)](#module_DB API_ zcl database access..selectAllStructs) ⇒
    • [~selectStructById(db, id)](#module_DB API_ zcl database access..selectStructById) ⇒
    • [~selectStructByName(db, name, packageIds)](#module_DB API_ zcl database access..selectStructByName) ⇒
    • [~selectStructByNameAndClusterId(db, name, clusterId, packageIds)](#module_DB API_ zcl database access..selectStructByNameAndClusterId) ⇒
    • [~selectStructByNameAndClusterName(db, name, clusterName, packageIds)](#module_DB API_ zcl database access..selectStructByNameAndClusterName) ⇒
    • [~selectStructsWithClusterAssociation(db, packageIds, groupByStructName)](#module_DB API_ zcl database access..selectStructsWithClusterAssociation) ⇒
    • [~sqlQueryForDataTypeByNameAndClusterId(typeDiscriminator, clusterId, packageIds)](#module_DB API_ zcl database access..sqlQueryForDataTypeByNameAndClusterId) ⇒
    • [~sqlQueryForDataTypeByNameAndClusterName(typeDiscriminator, name, clusterName, packageIds, options)](#module_DB API_ zcl database access..sqlQueryForDataTypeByNameAndClusterName) ⇒
    • [~selectClusterBitmaps(db, packageId, clusterId)](#module_DB API_ zcl database access..selectClusterBitmaps) ⇒
    • [~selectAllBitmapFieldsById(db, id)](#module_DB API_ zcl database access..selectAllBitmapFieldsById) ⇒
    • [~selectAllBitmapFields(db, packageId)](#module_DB API_ zcl database access..selectAllBitmapFields) ⇒
    • [~selectAllDomains(db)](#module_DB API_ zcl database access..selectAllDomains) ⇒
    • [~selectDomainById(db, id)](#module_DB API_ zcl database access..selectDomainById) ⇒
    • [~selectAllStructsWithItemCount(db, packageIds)](#module_DB API_ zcl database access..selectAllStructsWithItemCount) ⇒
    • [~selectStructClusters(db, structId)](#module_DB API_ zcl database access..selectStructClusters) ⇒
    • [~selectEnumClusters(db, enumId)](#module_DB API_ zcl database access..selectEnumClusters) ⇒
    • [~selectBitmapClusters(db, bitmapId)](#module_DB API_ zcl database access..selectBitmapClusters) ⇒
    • [~selectClusterStructsWithItems(db)](#module_DB API_ zcl database access..selectClusterStructsWithItems) ⇒
    • [~selectAllStructsWithItems(db)](#module_DB API_ zcl database access..selectAllStructsWithItems) ⇒
    • [~selectStructsWithItemsImpl(db, packageIds, clusterId)](#module_DB API_ zcl database access..selectStructsWithItemsImpl) ⇒
    • [~selectAllStructItemsById(db, id)](#module_DB API_ zcl database access..selectAllStructItemsById) ⇒
    • [~selectAllStructItemsByStructName(db, name, packageIds, clusterName)](#module_DB API_ zcl database access..selectAllStructItemsByStructName) ⇒
    • [~selectAllClusters(db)](#module_DB API_ zcl database access..selectAllClusters) ⇒
    • [~selectClusterByCode(db, packageId, clusterCode, mfgCode)](#module_DB API_ zcl database access..selectClusterByCode) ⇒
    • [~selectClusterById(db, clusterId, packageId)](#module_DB API_ zcl database access..selectClusterById) ⇒
    • [~selectAttributesByClusterIdIncludingGlobal(db, clusterId, packageIds)](#module_DB API_ zcl database access..selectAttributesByClusterIdIncludingGlobal) ⇒
    • [~selectAttributesByClusterIdAndSideIncludingGlobal(db, clusterId, packageIds, side)](#module_DB API_ zcl database access..selectAttributesByClusterIdAndSideIncludingGlobal) ⇒
    • [~selectAttributesByClusterCodeAndManufacturerCode(db, packageId, clusterCode, manufacturerCode)](#module_DB API_ zcl database access..selectAttributesByClusterCodeAndManufacturerCode) ⇒
    • [~selectAttributeById(db, id)](#module_DB API_ zcl database access..selectAttributeById) ⇒
    • [~selectAttributeByAttributeIdAndClusterRef(db, attributeId, clusterRef)](#module_DB API_ zcl database access..selectAttributeByAttributeIdAndClusterRef)
    • [~selectAllAttributes(db, packageIds)](#module_DB API_ zcl database access..selectAllAttributes) ⇒
    • [~selectAllAttributesBySide(db, side, packageId)](#module_DB API_ zcl database access..selectAllAttributesBySide) ⇒
    • [~selectEndpointTypeClustersByEndpointTypeId(db, endpointTypeId)](#module_DB API_ zcl database access..selectEndpointTypeClustersByEndpointTypeId) ⇒
    • [~selectEndpointTypeAttributesByEndpointId(db, endpointTypeId)](#module_DB API_ zcl database access..selectEndpointTypeAttributesByEndpointId) ⇒
    • [~selectEndpointTypeAttribute(db, endpointTypeId, attributeRef, clusterRef)](#module_DB API_ zcl database access..selectEndpointTypeAttribute) ⇒
    • [~selectEndpointTypeCommandsByEndpointId(db, endpointTypeId)](#module_DB API_ zcl database access..selectEndpointTypeCommandsByEndpointId) ⇒
    • [~selectEndpointTypeEventsByEndpointId(db, endpointTypeId)](#module_DB API_ zcl database access..selectEndpointTypeEventsByEndpointId) ⇒

DB API: zcl database access~clear()

Clears the entire cache.

Kind: inner method of [DB API: zcl database access](#module_DB 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](#module_DB API_ zcl database access)
Returns: Returns true on success.

Param Type
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](#module_DB API_ zcl database access)
Returns: cached object or undefined if none is present or expired.

Param Type
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](#module_DB API_ zcl database access)
Returns: true or false, depending on whether the cache is present.

Param Type
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](#module_DB API_ zcl database access)
Returns: true or false, depending on whether the cache is present.

Param Type
key *
packageId *

DB API: zcl database access~cacheStats()

Returns the cache statistics.

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

DB API: zcl database access~enable()

Enable the Database Query cache

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

DB API: zcl database access~disable()

Disable the database cache

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

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

Get all atomic data type information

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: atomic data types

Param Type
db *
packageId *

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](#module_DB API_ zcl database access)

Param Type
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](#module_DB API_ zcl database access)

Param Type
db *
packageId *

DB API: zcl database access~isTypeSignedByNameAndPackage(db, name, sessionPackages) ⇒ Promise.<boolean>

Checks if a type by a given name is signed.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise.<boolean> - - A promise that resolves to true if the type is signed, false otherwise.

Param Type Description
db object The database connection object.
name string The name of the type.
sessionPackages Array An array of session packages.

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

Retrieves all the bitmaps in the database.

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

Param Type
db *

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

Get bitmap by name from the given package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: promise of bitmap

Param Type
db *
packageIds *
name *

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](#module_DB API_ zcl database access)
Returns: bitmap information or undefined

Param Type
db *
name *
clusterId *
packageIds *

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

Select a bitmap matched by name and cluster name Note: Use selectBitmapByNameAndClusterId but this was needed for backwards compatibility.

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

Param Type
db *
name *
clusterName *
packageIds *

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

Get Bitmap information by Bitmap ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of bitmap

Param Type
db *
id *

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

Returns the cluster available to this session by the code.

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

Param Type
db *
sessionId *
code *
mfgCode *

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](#module_DB API_ zcl database access)
Returns: all the cluster objects for a given session.

Param Type
db *
sessionId *

DB API: zcl database access~selectSessionAttributeByCode(db, sessionId, clusterCode, side, attributeCode, mfgCode) ⇒

Returns the attribute available to this session by the code.

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

Param Type
db *
sessionId *
clusterCode *
side *
attributeCode *
mfgCode *

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

Returns the command available to this session by the code.

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

Param Type
db *
sessionId *
clusterCode *
commandCode *
source *

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

Get all structs from a given package ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of Structs

Param Type
db *
packageId *

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

Get struct details from the given struct ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of Struct

Param Type
db *
id *

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

Get Struct details from the given struct name and package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of Struct

Param Type
db *
name *
packageIds *

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](#module_DB API_ zcl database access)
Returns: struct information or undefined

Param Type
db *
name *
clusterId *
packageIds *

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

Select a struct matched by name and cluster name Note: Use selectStructByNameAndClusterId but this was needed for backwards compatibility.

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

Param Type
db *
name *
clusterName *
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](#module_DB API_ zcl database access)
Returns: structs which have an association with clusters

Param Type
db *
packageIds *
groupByStructName *

DB API: zcl database access~sqlQueryForDataTypeByNameAndClusterId(typeDiscriminator, clusterId, packageIds) ⇒

Formulate a sqlite query string for a data type from the given cluster ID and package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: SQLite query string

Param Type Default
typeDiscriminator *
clusterId *
packageIds *

DB API: zcl database access~sqlQueryForDataTypeByNameAndClusterName(typeDiscriminator, name, clusterName, packageIds, options) ⇒

Formulate a sqlite query string for a data type from the given cluster name and package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: SQLite query string

Param Type Description
typeDiscriminator *
name * data type name
clusterName *
packageIds *
options *

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](#module_DB API_ zcl database access)
Returns: cluster-related bitmaps

Param Type
db *
packageId *
clusterId *

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

Get bitmap fields from the given bitmap ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of bitmap fields

Param Type
db *
id *

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

Get all bitmap fields from the given package ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of bitmap fields

Param Type
db *
packageId *

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

Retrieves all the domains in the database.

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

Param Type
db *

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

Get Domain details from the given domain ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of domain

Param Type
db *
id *

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](#module_DB API_ zcl database access)
Returns: Promise that resolves with the rows of structs.

Param Type
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](#module_DB API_ zcl database access)
Returns: clusters

Param Type
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](#module_DB API_ zcl database access)
Returns: clusters

Param Type
db *
enumId *

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

Returns an array of clusters that bitmap belongs to.

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

Param Type
db *
bitmapId *

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](#module_DB API_ zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.

Param Type
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](#module_DB API_ zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.

Param Type
db *

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

Get Struct details along with its struct items.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: struct details

Param Type
db *
packageIds *
clusterId *

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

Get struct item details from the given struct item ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of Stuct Items

Param Type
db *
id *

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

Retrieves the struct items based on struct and cluster name. Note: By default clusterName is null.

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

Param Default
db
name
packageIds
clusterName

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

Retrieves all the clusters in the database.

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

Param Type
db *

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

Finds cluster by code.

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

Param Type Default Description
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](#module_DB API_ zcl database access)
Returns: promise that resolves into a cluster object

Param Type
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](#module_DB API_ zcl database access)
Returns: promise of a list of attributes, including global attributes

Param Type
db *
clusterId *
packageIds *

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

Get attribute details from the given information.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of attribute details

Param Type
db *
clusterId *
packageIds *
side *

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](#module_DB API_ zcl database access)
Returns: promise that resolves into attributes.

Param Type
db *
packageId *
clusterCode *
manufacturerCode *

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

Get attribute details from the given attribute ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of attribute

Param Type
db *
id *

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](#module_DB API_ zcl database access)

Param Type
db *
attributeId *
clusterRef *

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

Get all attributes from the given package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of attributes

Param Type
db *
packageIds *

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

Query for attributes by side.

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

Param Type
db *
side *
packageId *

DB API: zcl database access~selectEndpointTypeClustersByEndpointTypeId(db, endpointTypeId) ⇒

Get the endpoint type cluster details from the given endpoint type ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type clusters.

Param Type
db *
endpointTypeId *

DB API: zcl database access~selectEndpointTypeAttributesByEndpointId(db, endpointTypeId) ⇒

Get the endpoint type attribute details from the given endpoint type ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type attributes.

Param Type
db *
endpointTypeId *

DB API: zcl database access~selectEndpointTypeAttribute(db, endpointTypeId, attributeRef, clusterRef) ⇒

Get the endpoint type attribute details from the given details.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type attribute.

Param Type
db *
endpointTypeId *
attributeRef *
clusterRef *

DB API: zcl database access~selectEndpointTypeCommandsByEndpointId(db, endpointTypeId) ⇒

Get the endpoint type command details from the given endpoint type ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type commands

Param Type
db *
endpointTypeId *

DB API: zcl database access~selectEndpointTypeEventsByEndpointId(db, endpointTypeId) ⇒

Get endpoint type events from the given endpoint type ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type events

Param Type
db *
endpointTypeId *

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](#module_DB API_ zcl database access)
    • [~clear()](#module_DB API_ zcl database access..clear)
    • [~put(key, packageId, data)](#module_DB API_ zcl database access..put) ⇒
    • [~get(key, packageId)](#module_DB API_ zcl database access..get) ⇒
    • [~isCached(key, packageId)](#module_DB API_ zcl database access..isCached) ⇒
    • [~cacheQuery(key, packageId)](#module_DB API_ zcl database access..cacheQuery) ⇒
    • [~cacheStats()](#module_DB API_ zcl database access..cacheStats)
    • [~enable()](#module_DB API_ zcl database access..enable)
    • [~disable()](#module_DB API_ zcl database access..disable)
    • [~selectAllAtomics(db, packageId)](#module_DB API_ zcl database access..selectAllAtomics) ⇒
    • [~selectAtomicType(db, packageId, typeName)](#module_DB API_ zcl database access..selectAtomicType)
    • [~selectAtomicById(db, packageId)](#module_DB API_ zcl database access..selectAtomicById)
    • [~isTypeSignedByNameAndPackage(db, name, sessionPackages)](#module_DB API_ zcl database access..isTypeSignedByNameAndPackage) ⇒ Promise.<boolean>
    • [~selectAllBitmaps(db)](#module_DB API_ zcl database access..selectAllBitmaps) ⇒
    • [~selectBitmapByName(db, packageIds, name)](#module_DB API_ zcl database access..selectBitmapByName) ⇒
    • [~selectBitmapByNameAndClusterId(db, name, clusterId, packageIds)](#module_DB API_ zcl database access..selectBitmapByNameAndClusterId) ⇒
    • [~selectBitmapByNameAndClusterName(db, name, clusterName, packageIds)](#module_DB API_ zcl database access..selectBitmapByNameAndClusterName) ⇒
    • [~selectBitmapById(db, id)](#module_DB API_ zcl database access..selectBitmapById) ⇒
    • [~selectSessionClusterByCode(db, sessionId, code, mfgCode)](#module_DB API_ zcl database access..selectSessionClusterByCode) ⇒
    • [~selectAllSessionClusters(db, sessionId)](#module_DB API_ zcl database access..selectAllSessionClusters) ⇒
    • [~selectSessionAttributeByCode(db, sessionId, clusterCode, side, attributeCode, mfgCode)](#module_DB API_ zcl database access..selectSessionAttributeByCode) ⇒
    • [~selectSessionCommandByCode(db, sessionId, clusterCode, commandCode, source)](#module_DB API_ zcl database access..selectSessionCommandByCode) ⇒
    • [~selectAllStructs(db, packageId)](#module_DB API_ zcl database access..selectAllStructs) ⇒
    • [~selectStructById(db, id)](#module_DB API_ zcl database access..selectStructById) ⇒
    • [~selectStructByName(db, name, packageIds)](#module_DB API_ zcl database access..selectStructByName) ⇒
    • [~selectStructByNameAndClusterId(db, name, clusterId, packageIds)](#module_DB API_ zcl database access..selectStructByNameAndClusterId) ⇒
    • [~selectStructByNameAndClusterName(db, name, clusterName, packageIds)](#module_DB API_ zcl database access..selectStructByNameAndClusterName) ⇒
    • [~selectStructsWithClusterAssociation(db, packageIds, groupByStructName)](#module_DB API_ zcl database access..selectStructsWithClusterAssociation) ⇒
    • [~sqlQueryForDataTypeByNameAndClusterId(typeDiscriminator, clusterId, packageIds)](#module_DB API_ zcl database access..sqlQueryForDataTypeByNameAndClusterId) ⇒
    • [~sqlQueryForDataTypeByNameAndClusterName(typeDiscriminator, name, clusterName, packageIds, options)](#module_DB API_ zcl database access..sqlQueryForDataTypeByNameAndClusterName) ⇒
    • [~selectClusterBitmaps(db, packageId, clusterId)](#module_DB API_ zcl database access..selectClusterBitmaps) ⇒
    • [~selectAllBitmapFieldsById(db, id)](#module_DB API_ zcl database access..selectAllBitmapFieldsById) ⇒
    • [~selectAllBitmapFields(db, packageId)](#module_DB API_ zcl database access..selectAllBitmapFields) ⇒
    • [~selectAllDomains(db)](#module_DB API_ zcl database access..selectAllDomains) ⇒
    • [~selectDomainById(db, id)](#module_DB API_ zcl database access..selectDomainById) ⇒
    • [~selectAllStructsWithItemCount(db, packageIds)](#module_DB API_ zcl database access..selectAllStructsWithItemCount) ⇒
    • [~selectStructClusters(db, structId)](#module_DB API_ zcl database access..selectStructClusters) ⇒
    • [~selectEnumClusters(db, enumId)](#module_DB API_ zcl database access..selectEnumClusters) ⇒
    • [~selectBitmapClusters(db, bitmapId)](#module_DB API_ zcl database access..selectBitmapClusters) ⇒
    • [~selectClusterStructsWithItems(db)](#module_DB API_ zcl database access..selectClusterStructsWithItems) ⇒
    • [~selectAllStructsWithItems(db)](#module_DB API_ zcl database access..selectAllStructsWithItems) ⇒
    • [~selectStructsWithItemsImpl(db, packageIds, clusterId)](#module_DB API_ zcl database access..selectStructsWithItemsImpl) ⇒
    • [~selectAllStructItemsById(db, id)](#module_DB API_ zcl database access..selectAllStructItemsById) ⇒
    • [~selectAllStructItemsByStructName(db, name, packageIds, clusterName)](#module_DB API_ zcl database access..selectAllStructItemsByStructName) ⇒
    • [~selectAllClusters(db)](#module_DB API_ zcl database access..selectAllClusters) ⇒
    • [~selectClusterByCode(db, packageId, clusterCode, mfgCode)](#module_DB API_ zcl database access..selectClusterByCode) ⇒
    • [~selectClusterById(db, clusterId, packageId)](#module_DB API_ zcl database access..selectClusterById) ⇒
    • [~selectAttributesByClusterIdIncludingGlobal(db, clusterId, packageIds)](#module_DB API_ zcl database access..selectAttributesByClusterIdIncludingGlobal) ⇒
    • [~selectAttributesByClusterIdAndSideIncludingGlobal(db, clusterId, packageIds, side)](#module_DB API_ zcl database access..selectAttributesByClusterIdAndSideIncludingGlobal) ⇒
    • [~selectAttributesByClusterCodeAndManufacturerCode(db, packageId, clusterCode, manufacturerCode)](#module_DB API_ zcl database access..selectAttributesByClusterCodeAndManufacturerCode) ⇒
    • [~selectAttributeById(db, id)](#module_DB API_ zcl database access..selectAttributeById) ⇒
    • [~selectAttributeByAttributeIdAndClusterRef(db, attributeId, clusterRef)](#module_DB API_ zcl database access..selectAttributeByAttributeIdAndClusterRef)
    • [~selectAllAttributes(db, packageIds)](#module_DB API_ zcl database access..selectAllAttributes) ⇒
    • [~selectAllAttributesBySide(db, side, packageId)](#module_DB API_ zcl database access..selectAllAttributesBySide) ⇒
    • [~selectEndpointTypeClustersByEndpointTypeId(db, endpointTypeId)](#module_DB API_ zcl database access..selectEndpointTypeClustersByEndpointTypeId) ⇒
    • [~selectEndpointTypeAttributesByEndpointId(db, endpointTypeId)](#module_DB API_ zcl database access..selectEndpointTypeAttributesByEndpointId) ⇒
    • [~selectEndpointTypeAttribute(db, endpointTypeId, attributeRef, clusterRef)](#module_DB API_ zcl database access..selectEndpointTypeAttribute) ⇒
    • [~selectEndpointTypeCommandsByEndpointId(db, endpointTypeId)](#module_DB API_ zcl database access..selectEndpointTypeCommandsByEndpointId) ⇒
    • [~selectEndpointTypeEventsByEndpointId(db, endpointTypeId)](#module_DB API_ zcl database access..selectEndpointTypeEventsByEndpointId) ⇒

DB API: zcl database access~clear()

Clears the entire cache.

Kind: inner method of [DB API: zcl database access](#module_DB 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](#module_DB API_ zcl database access)
Returns: Returns true on success.

Param Type
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](#module_DB API_ zcl database access)
Returns: cached object or undefined if none is present or expired.

Param Type
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](#module_DB API_ zcl database access)
Returns: true or false, depending on whether the cache is present.

Param Type
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](#module_DB API_ zcl database access)
Returns: true or false, depending on whether the cache is present.

Param Type
key *
packageId *

DB API: zcl database access~cacheStats()

Returns the cache statistics.

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

DB API: zcl database access~enable()

Enable the Database Query cache

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

DB API: zcl database access~disable()

Disable the database cache

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

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

Get all atomic data type information

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: atomic data types

Param Type
db *
packageId *

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](#module_DB API_ zcl database access)

Param Type
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](#module_DB API_ zcl database access)

Param Type
db *
packageId *

DB API: zcl database access~isTypeSignedByNameAndPackage(db, name, sessionPackages) ⇒ Promise.<boolean>

Checks if a type by a given name is signed.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise.<boolean> - - A promise that resolves to true if the type is signed, false otherwise.

Param Type Description
db object The database connection object.
name string The name of the type.
sessionPackages Array An array of session packages.

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

Retrieves all the bitmaps in the database.

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

Param Type
db *

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

Get bitmap by name from the given package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: promise of bitmap

Param Type
db *
packageIds *
name *

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](#module_DB API_ zcl database access)
Returns: bitmap information or undefined

Param Type
db *
name *
clusterId *
packageIds *

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

Select a bitmap matched by name and cluster name Note: Use selectBitmapByNameAndClusterId but this was needed for backwards compatibility.

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

Param Type
db *
name *
clusterName *
packageIds *

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

Get Bitmap information by Bitmap ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of bitmap

Param Type
db *
id *

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

Returns the cluster available to this session by the code.

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

Param Type
db *
sessionId *
code *
mfgCode *

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](#module_DB API_ zcl database access)
Returns: all the cluster objects for a given session.

Param Type
db *
sessionId *

DB API: zcl database access~selectSessionAttributeByCode(db, sessionId, clusterCode, side, attributeCode, mfgCode) ⇒

Returns the attribute available to this session by the code.

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

Param Type
db *
sessionId *
clusterCode *
side *
attributeCode *
mfgCode *

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

Returns the command available to this session by the code.

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

Param Type
db *
sessionId *
clusterCode *
commandCode *
source *

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

Get all structs from a given package ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of Structs

Param Type
db *
packageId *

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

Get struct details from the given struct ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of Struct

Param Type
db *
id *

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

Get Struct details from the given struct name and package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of Struct

Param Type
db *
name *
packageIds *

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](#module_DB API_ zcl database access)
Returns: struct information or undefined

Param Type
db *
name *
clusterId *
packageIds *

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

Select a struct matched by name and cluster name Note: Use selectStructByNameAndClusterId but this was needed for backwards compatibility.

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

Param Type
db *
name *
clusterName *
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](#module_DB API_ zcl database access)
Returns: structs which have an association with clusters

Param Type
db *
packageIds *
groupByStructName *

DB API: zcl database access~sqlQueryForDataTypeByNameAndClusterId(typeDiscriminator, clusterId, packageIds) ⇒

Formulate a sqlite query string for a data type from the given cluster ID and package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: SQLite query string

Param Type Default
typeDiscriminator *
clusterId *
packageIds *

DB API: zcl database access~sqlQueryForDataTypeByNameAndClusterName(typeDiscriminator, name, clusterName, packageIds, options) ⇒

Formulate a sqlite query string for a data type from the given cluster name and package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: SQLite query string

Param Type Description
typeDiscriminator *
name * data type name
clusterName *
packageIds *
options *

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](#module_DB API_ zcl database access)
Returns: cluster-related bitmaps

Param Type
db *
packageId *
clusterId *

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

Get bitmap fields from the given bitmap ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of bitmap fields

Param Type
db *
id *

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

Get all bitmap fields from the given package ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of bitmap fields

Param Type
db *
packageId *

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

Retrieves all the domains in the database.

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

Param Type
db *

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

Get Domain details from the given domain ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of domain

Param Type
db *
id *

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](#module_DB API_ zcl database access)
Returns: Promise that resolves with the rows of structs.

Param Type
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](#module_DB API_ zcl database access)
Returns: clusters

Param Type
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](#module_DB API_ zcl database access)
Returns: clusters

Param Type
db *
enumId *

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

Returns an array of clusters that bitmap belongs to.

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

Param Type
db *
bitmapId *

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](#module_DB API_ zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.

Param Type
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](#module_DB API_ zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.

Param Type
db *

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

Get Struct details along with its struct items.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: struct details

Param Type
db *
packageIds *
clusterId *

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

Get struct item details from the given struct item ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of Stuct Items

Param Type
db *
id *

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

Retrieves the struct items based on struct and cluster name. Note: By default clusterName is null.

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

Param Default
db
name
packageIds
clusterName

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

Retrieves all the clusters in the database.

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

Param Type
db *

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

Finds cluster by code.

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

Param Type Default Description
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](#module_DB API_ zcl database access)
Returns: promise that resolves into a cluster object

Param Type
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](#module_DB API_ zcl database access)
Returns: promise of a list of attributes, including global attributes

Param Type
db *
clusterId *
packageIds *

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

Get attribute details from the given information.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of attribute details

Param Type
db *
clusterId *
packageIds *
side *

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](#module_DB API_ zcl database access)
Returns: promise that resolves into attributes.

Param Type
db *
packageId *
clusterCode *
manufacturerCode *

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

Get attribute details from the given attribute ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of attribute

Param Type
db *
id *

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](#module_DB API_ zcl database access)

Param Type
db *
attributeId *
clusterRef *

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

Get all attributes from the given package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of attributes

Param Type
db *
packageIds *

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

Query for attributes by side.

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

Param Type
db *
side *
packageId *

DB API: zcl database access~selectEndpointTypeClustersByEndpointTypeId(db, endpointTypeId) ⇒

Get the endpoint type cluster details from the given endpoint type ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type clusters.

Param Type
db *
endpointTypeId *

DB API: zcl database access~selectEndpointTypeAttributesByEndpointId(db, endpointTypeId) ⇒

Get the endpoint type attribute details from the given endpoint type ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type attributes.

Param Type
db *
endpointTypeId *

DB API: zcl database access~selectEndpointTypeAttribute(db, endpointTypeId, attributeRef, clusterRef) ⇒

Get the endpoint type attribute details from the given details.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type attribute.

Param Type
db *
endpointTypeId *
attributeRef *
clusterRef *

DB API: zcl database access~selectEndpointTypeCommandsByEndpointId(db, endpointTypeId) ⇒

Get the endpoint type command details from the given endpoint type ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type commands

Param Type
db *
endpointTypeId *

DB API: zcl database access~selectEndpointTypeEventsByEndpointId(db, endpointTypeId) ⇒

Get endpoint type events from the given endpoint type ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type events

Param Type
db *
endpointTypeId *

DB API: attribute queries.

This module provides queries related to attributes.

DB API: zcl database access

This module provides queries for bitmaps.

  • [DB API: zcl database access](#module_DB API_ zcl database access)
    • [~clear()](#module_DB API_ zcl database access..clear)
    • [~put(key, packageId, data)](#module_DB API_ zcl database access..put) ⇒
    • [~get(key, packageId)](#module_DB API_ zcl database access..get) ⇒
    • [~isCached(key, packageId)](#module_DB API_ zcl database access..isCached) ⇒
    • [~cacheQuery(key, packageId)](#module_DB API_ zcl database access..cacheQuery) ⇒
    • [~cacheStats()](#module_DB API_ zcl database access..cacheStats)
    • [~enable()](#module_DB API_ zcl database access..enable)
    • [~disable()](#module_DB API_ zcl database access..disable)
    • [~selectAllAtomics(db, packageId)](#module_DB API_ zcl database access..selectAllAtomics) ⇒
    • [~selectAtomicType(db, packageId, typeName)](#module_DB API_ zcl database access..selectAtomicType)
    • [~selectAtomicById(db, packageId)](#module_DB API_ zcl database access..selectAtomicById)
    • [~isTypeSignedByNameAndPackage(db, name, sessionPackages)](#module_DB API_ zcl database access..isTypeSignedByNameAndPackage) ⇒ Promise.<boolean>
    • [~selectAllBitmaps(db)](#module_DB API_ zcl database access..selectAllBitmaps) ⇒
    • [~selectBitmapByName(db, packageIds, name)](#module_DB API_ zcl database access..selectBitmapByName) ⇒
    • [~selectBitmapByNameAndClusterId(db, name, clusterId, packageIds)](#module_DB API_ zcl database access..selectBitmapByNameAndClusterId) ⇒
    • [~selectBitmapByNameAndClusterName(db, name, clusterName, packageIds)](#module_DB API_ zcl database access..selectBitmapByNameAndClusterName) ⇒
    • [~selectBitmapById(db, id)](#module_DB API_ zcl database access..selectBitmapById) ⇒
    • [~selectSessionClusterByCode(db, sessionId, code, mfgCode)](#module_DB API_ zcl database access..selectSessionClusterByCode) ⇒
    • [~selectAllSessionClusters(db, sessionId)](#module_DB API_ zcl database access..selectAllSessionClusters) ⇒
    • [~selectSessionAttributeByCode(db, sessionId, clusterCode, side, attributeCode, mfgCode)](#module_DB API_ zcl database access..selectSessionAttributeByCode) ⇒
    • [~selectSessionCommandByCode(db, sessionId, clusterCode, commandCode, source)](#module_DB API_ zcl database access..selectSessionCommandByCode) ⇒
    • [~selectAllStructs(db, packageId)](#module_DB API_ zcl database access..selectAllStructs) ⇒
    • [~selectStructById(db, id)](#module_DB API_ zcl database access..selectStructById) ⇒
    • [~selectStructByName(db, name, packageIds)](#module_DB API_ zcl database access..selectStructByName) ⇒
    • [~selectStructByNameAndClusterId(db, name, clusterId, packageIds)](#module_DB API_ zcl database access..selectStructByNameAndClusterId) ⇒
    • [~selectStructByNameAndClusterName(db, name, clusterName, packageIds)](#module_DB API_ zcl database access..selectStructByNameAndClusterName) ⇒
    • [~selectStructsWithClusterAssociation(db, packageIds, groupByStructName)](#module_DB API_ zcl database access..selectStructsWithClusterAssociation) ⇒
    • [~sqlQueryForDataTypeByNameAndClusterId(typeDiscriminator, clusterId, packageIds)](#module_DB API_ zcl database access..sqlQueryForDataTypeByNameAndClusterId) ⇒
    • [~sqlQueryForDataTypeByNameAndClusterName(typeDiscriminator, name, clusterName, packageIds, options)](#module_DB API_ zcl database access..sqlQueryForDataTypeByNameAndClusterName) ⇒
    • [~selectClusterBitmaps(db, packageId, clusterId)](#module_DB API_ zcl database access..selectClusterBitmaps) ⇒
    • [~selectAllBitmapFieldsById(db, id)](#module_DB API_ zcl database access..selectAllBitmapFieldsById) ⇒
    • [~selectAllBitmapFields(db, packageId)](#module_DB API_ zcl database access..selectAllBitmapFields) ⇒
    • [~selectAllDomains(db)](#module_DB API_ zcl database access..selectAllDomains) ⇒
    • [~selectDomainById(db, id)](#module_DB API_ zcl database access..selectDomainById) ⇒
    • [~selectAllStructsWithItemCount(db, packageIds)](#module_DB API_ zcl database access..selectAllStructsWithItemCount) ⇒
    • [~selectStructClusters(db, structId)](#module_DB API_ zcl database access..selectStructClusters) ⇒
    • [~selectEnumClusters(db, enumId)](#module_DB API_ zcl database access..selectEnumClusters) ⇒
    • [~selectBitmapClusters(db, bitmapId)](#module_DB API_ zcl database access..selectBitmapClusters) ⇒
    • [~selectClusterStructsWithItems(db)](#module_DB API_ zcl database access..selectClusterStructsWithItems) ⇒
    • [~selectAllStructsWithItems(db)](#module_DB API_ zcl database access..selectAllStructsWithItems) ⇒
    • [~selectStructsWithItemsImpl(db, packageIds, clusterId)](#module_DB API_ zcl database access..selectStructsWithItemsImpl) ⇒
    • [~selectAllStructItemsById(db, id)](#module_DB API_ zcl database access..selectAllStructItemsById) ⇒
    • [~selectAllStructItemsByStructName(db, name, packageIds, clusterName)](#module_DB API_ zcl database access..selectAllStructItemsByStructName) ⇒
    • [~selectAllClusters(db)](#module_DB API_ zcl database access..selectAllClusters) ⇒
    • [~selectClusterByCode(db, packageId, clusterCode, mfgCode)](#module_DB API_ zcl database access..selectClusterByCode) ⇒
    • [~selectClusterById(db, clusterId, packageId)](#module_DB API_ zcl database access..selectClusterById) ⇒
    • [~selectAttributesByClusterIdIncludingGlobal(db, clusterId, packageIds)](#module_DB API_ zcl database access..selectAttributesByClusterIdIncludingGlobal) ⇒
    • [~selectAttributesByClusterIdAndSideIncludingGlobal(db, clusterId, packageIds, side)](#module_DB API_ zcl database access..selectAttributesByClusterIdAndSideIncludingGlobal) ⇒
    • [~selectAttributesByClusterCodeAndManufacturerCode(db, packageId, clusterCode, manufacturerCode)](#module_DB API_ zcl database access..selectAttributesByClusterCodeAndManufacturerCode) ⇒
    • [~selectAttributeById(db, id)](#module_DB API_ zcl database access..selectAttributeById) ⇒
    • [~selectAttributeByAttributeIdAndClusterRef(db, attributeId, clusterRef)](#module_DB API_ zcl database access..selectAttributeByAttributeIdAndClusterRef)
    • [~selectAllAttributes(db, packageIds)](#module_DB API_ zcl database access..selectAllAttributes) ⇒
    • [~selectAllAttributesBySide(db, side, packageId)](#module_DB API_ zcl database access..selectAllAttributesBySide) ⇒
    • [~selectEndpointTypeClustersByEndpointTypeId(db, endpointTypeId)](#module_DB API_ zcl database access..selectEndpointTypeClustersByEndpointTypeId) ⇒
    • [~selectEndpointTypeAttributesByEndpointId(db, endpointTypeId)](#module_DB API_ zcl database access..selectEndpointTypeAttributesByEndpointId) ⇒
    • [~selectEndpointTypeAttribute(db, endpointTypeId, attributeRef, clusterRef)](#module_DB API_ zcl database access..selectEndpointTypeAttribute) ⇒
    • [~selectEndpointTypeCommandsByEndpointId(db, endpointTypeId)](#module_DB API_ zcl database access..selectEndpointTypeCommandsByEndpointId) ⇒
    • [~selectEndpointTypeEventsByEndpointId(db, endpointTypeId)](#module_DB API_ zcl database access..selectEndpointTypeEventsByEndpointId) ⇒

DB API: zcl database access~clear()

Clears the entire cache.

Kind: inner method of [DB API: zcl database access](#module_DB 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](#module_DB API_ zcl database access)
Returns: Returns true on success.

Param Type
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](#module_DB API_ zcl database access)
Returns: cached object or undefined if none is present or expired.

Param Type
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](#module_DB API_ zcl database access)
Returns: true or false, depending on whether the cache is present.

Param Type
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](#module_DB API_ zcl database access)
Returns: true or false, depending on whether the cache is present.

Param Type
key *
packageId *

DB API: zcl database access~cacheStats()

Returns the cache statistics.

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

DB API: zcl database access~enable()

Enable the Database Query cache

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

DB API: zcl database access~disable()

Disable the database cache

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

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

Get all atomic data type information

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: atomic data types

Param Type
db *
packageId *

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](#module_DB API_ zcl database access)

Param Type
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](#module_DB API_ zcl database access)

Param Type
db *
packageId *

DB API: zcl database access~isTypeSignedByNameAndPackage(db, name, sessionPackages) ⇒ Promise.<boolean>

Checks if a type by a given name is signed.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise.<boolean> - - A promise that resolves to true if the type is signed, false otherwise.

Param Type Description
db object The database connection object.
name string The name of the type.
sessionPackages Array An array of session packages.

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

Retrieves all the bitmaps in the database.

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

Param Type
db *

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

Get bitmap by name from the given package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: promise of bitmap

Param Type
db *
packageIds *
name *

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](#module_DB API_ zcl database access)
Returns: bitmap information or undefined

Param Type
db *
name *
clusterId *
packageIds *

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

Select a bitmap matched by name and cluster name Note: Use selectBitmapByNameAndClusterId but this was needed for backwards compatibility.

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

Param Type
db *
name *
clusterName *
packageIds *

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

Get Bitmap information by Bitmap ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of bitmap

Param Type
db *
id *

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

Returns the cluster available to this session by the code.

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

Param Type
db *
sessionId *
code *
mfgCode *

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](#module_DB API_ zcl database access)
Returns: all the cluster objects for a given session.

Param Type
db *
sessionId *

DB API: zcl database access~selectSessionAttributeByCode(db, sessionId, clusterCode, side, attributeCode, mfgCode) ⇒

Returns the attribute available to this session by the code.

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

Param Type
db *
sessionId *
clusterCode *
side *
attributeCode *
mfgCode *

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

Returns the command available to this session by the code.

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

Param Type
db *
sessionId *
clusterCode *
commandCode *
source *

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

Get all structs from a given package ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of Structs

Param Type
db *
packageId *

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

Get struct details from the given struct ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of Struct

Param Type
db *
id *

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

Get Struct details from the given struct name and package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of Struct

Param Type
db *
name *
packageIds *

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](#module_DB API_ zcl database access)
Returns: struct information or undefined

Param Type
db *
name *
clusterId *
packageIds *

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

Select a struct matched by name and cluster name Note: Use selectStructByNameAndClusterId but this was needed for backwards compatibility.

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

Param Type
db *
name *
clusterName *
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](#module_DB API_ zcl database access)
Returns: structs which have an association with clusters

Param Type
db *
packageIds *
groupByStructName *

DB API: zcl database access~sqlQueryForDataTypeByNameAndClusterId(typeDiscriminator, clusterId, packageIds) ⇒

Formulate a sqlite query string for a data type from the given cluster ID and package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: SQLite query string

Param Type Default
typeDiscriminator *
clusterId *
packageIds *

DB API: zcl database access~sqlQueryForDataTypeByNameAndClusterName(typeDiscriminator, name, clusterName, packageIds, options) ⇒

Formulate a sqlite query string for a data type from the given cluster name and package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: SQLite query string

Param Type Description
typeDiscriminator *
name * data type name
clusterName *
packageIds *
options *

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](#module_DB API_ zcl database access)
Returns: cluster-related bitmaps

Param Type
db *
packageId *
clusterId *

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

Get bitmap fields from the given bitmap ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of bitmap fields

Param Type
db *
id *

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

Get all bitmap fields from the given package ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of bitmap fields

Param Type
db *
packageId *

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

Retrieves all the domains in the database.

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

Param Type
db *

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

Get Domain details from the given domain ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of domain

Param Type
db *
id *

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](#module_DB API_ zcl database access)
Returns: Promise that resolves with the rows of structs.

Param Type
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](#module_DB API_ zcl database access)
Returns: clusters

Param Type
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](#module_DB API_ zcl database access)
Returns: clusters

Param Type
db *
enumId *

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

Returns an array of clusters that bitmap belongs to.

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

Param Type
db *
bitmapId *

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](#module_DB API_ zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.

Param Type
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](#module_DB API_ zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.

Param Type
db *

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

Get Struct details along with its struct items.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: struct details

Param Type
db *
packageIds *
clusterId *

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

Get struct item details from the given struct item ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of Stuct Items

Param Type
db *
id *

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

Retrieves the struct items based on struct and cluster name. Note: By default clusterName is null.

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

Param Default
db
name
packageIds
clusterName

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

Retrieves all the clusters in the database.

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

Param Type
db *

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

Finds cluster by code.

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

Param Type Default Description
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](#module_DB API_ zcl database access)
Returns: promise that resolves into a cluster object

Param Type
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](#module_DB API_ zcl database access)
Returns: promise of a list of attributes, including global attributes

Param Type
db *
clusterId *
packageIds *

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

Get attribute details from the given information.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of attribute details

Param Type
db *
clusterId *
packageIds *
side *

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](#module_DB API_ zcl database access)
Returns: promise that resolves into attributes.

Param Type
db *
packageId *
clusterCode *
manufacturerCode *

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

Get attribute details from the given attribute ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of attribute

Param Type
db *
id *

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](#module_DB API_ zcl database access)

Param Type
db *
attributeId *
clusterRef *

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

Get all attributes from the given package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of attributes

Param Type
db *
packageIds *

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

Query for attributes by side.

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

Param Type
db *
side *
packageId *

DB API: zcl database access~selectEndpointTypeClustersByEndpointTypeId(db, endpointTypeId) ⇒

Get the endpoint type cluster details from the given endpoint type ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type clusters.

Param Type
db *
endpointTypeId *

DB API: zcl database access~selectEndpointTypeAttributesByEndpointId(db, endpointTypeId) ⇒

Get the endpoint type attribute details from the given endpoint type ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type attributes.

Param Type
db *
endpointTypeId *

DB API: zcl database access~selectEndpointTypeAttribute(db, endpointTypeId, attributeRef, clusterRef) ⇒

Get the endpoint type attribute details from the given details.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type attribute.

Param Type
db *
endpointTypeId *
attributeRef *
clusterRef *

DB API: zcl database access~selectEndpointTypeCommandsByEndpointId(db, endpointTypeId) ⇒

Get the endpoint type command details from the given endpoint type ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type commands

Param Type
db *
endpointTypeId *

DB API: zcl database access~selectEndpointTypeEventsByEndpointId(db, endpointTypeId) ⇒

Get endpoint type events from the given endpoint type ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type events

Param Type
db *
endpointTypeId *

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: Data type discriminator queries against the database.

This module provides queries for data type discriminator

DB API: Data type queries against the database.

This module provides queries for data types

DB API: device type database access

This module provides queries for device types.

  • [DB API: device type database access](#module_DB API_ device type database access)
    • [~selectAllDeviceTypes(db, packageId)](#module_DB API_ device type database access..selectAllDeviceTypes) ⇒
    • [~selectDeviceTypeById(db, id)](#module_DB API_ device type database access..selectDeviceTypeById) ⇒
    • [~selectDeviceTypeByCodeAndName(db, packageId, code, name)](#module_DB API_ device type database access..selectDeviceTypeByCodeAndName) ⇒
    • [~selectDeviceTypeByCode(db, packageId, code)](#module_DB API_ device type database access..selectDeviceTypeByCode) ⇒
    • [~selectDeviceTypeClustersByDeviceTypeRef(db, deviceTypeRef)](#module_DB API_ device type database access..selectDeviceTypeClustersByDeviceTypeRef) ⇒
    • [~selectDeviceTypeClusterByDeviceTypeClusterId(db, deviceTypeClusterId)](#module_DB API_ device type database access..selectDeviceTypeClusterByDeviceTypeClusterId) ⇒
    • [~selectDeviceTypeAttributesByDeviceTypeRef(db, deviceTypeRef)](#module_DB API_ device type database access..selectDeviceTypeAttributesByDeviceTypeRef) ⇒
    • [~selectDeviceTypeCommandsByDeviceTypeRef(db, deviceTypeRef)](#module_DB API_ device type database access..selectDeviceTypeCommandsByDeviceTypeRef) ⇒
    • [~updateClusterReferencesForDeviceTypeClusters(db, packageId, sessionPackages)](#module_DB API_ device type database access..updateClusterReferencesForDeviceTypeClusters) ⇒
    • [~updateAttributeReferencesForDeviceTypeReferences(db, packageId, sessionPackages)](#module_DB API_ device type database access..updateAttributeReferencesForDeviceTypeReferences) ⇒
    • [~updateCommandReferencesForDeviceTypeReferences(db, packageId, sessionPackages)](#module_DB API_ device type database access..updateCommandReferencesForDeviceTypeReferences) ⇒
    • [~updateFeatureReferencesForDeviceTypeReferences(db, packageId)](#module_DB API_ device type database access..updateFeatureReferencesForDeviceTypeReferences) ⇒
    • [~updateDeviceTypeEntityReferences(db)](#module_DB API_ device type database access..updateDeviceTypeEntityReferences) ⇒
    • [~updateDeviceTypeReferencesForCustomXml(db, packageId, sessionPackages, sessionId)](#module_DB API_ device type database access..updateDeviceTypeReferencesForCustomXml) ⇒
    • [~deleteUnlinkedDeviceTypeClusters(db, packageId)](#module_DB API_ device type database access..deleteUnlinkedDeviceTypeClusters)
    • [~warnUnlinkedDeviceTypeClusters(db, packageId, sessionId)](#module_DB API_ device type database access..warnUnlinkedDeviceTypeClusters)
    • [~selectDeviceTypesWithCompositionByEndpointTypeId(db, endpointTypeId)](#module_DB API_ device type database access..selectDeviceTypesWithCompositionByEndpointTypeId) ⇒ Promise.<Array>
    • [~selectDeviceTypesByEndpointTypeId(db, endpointTypeId)](#module_DB API_ device type database access..selectDeviceTypesByEndpointTypeId) ⇒
    • [~selectDeviceTypeFeaturesByEndpointTypeIdAndClusterId(db, endpointTypeId, clusterId)](#module_DB API_ device type database access..selectDeviceTypeFeaturesByEndpointTypeIdAndClusterId) ⇒

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

Retrieves all the device types in the database.

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

Param Type
db *
packageId *

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](#module_DB API_ device type database access)
Returns: Device type

Param Type
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](#module_DB API_ device type database access)
Returns: Device type

Param Type
db *
packageId *
code *
name *

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

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

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

Param Type
db *
packageId *
code *

DB API: device type database access~selectDeviceTypeClustersByDeviceTypeRef(db, deviceTypeRef) ⇒

Get all device type clusters from a given device type ID.

Kind: inner method of [DB API: device type database access](#module_DB API_ device type database access)
Returns: Promise of device type clusters

Param Type
db *
deviceTypeRef *

DB API: device type database access~selectDeviceTypeClusterByDeviceTypeClusterId(db, deviceTypeClusterId) ⇒

Get device type cluster details from the device type cluster ID.

Kind: inner method of [DB API: device type database access](#module_DB API_ device type database access)
Returns: Promise of device type cluster

Param Type
db *
deviceTypeClusterId *

DB API: device type database access~selectDeviceTypeAttributesByDeviceTypeRef(db, deviceTypeRef) ⇒

Get all device type commands from a given device type ID.

Kind: inner method of [DB API: device type database access](#module_DB API_ device type database access)
Returns: Promise of device type attributes

Param Type
db *
deviceTypeRef *

DB API: device type database access~selectDeviceTypeCommandsByDeviceTypeRef(db, deviceTypeRef) ⇒

Get all device type commands from a given device type ID.

Kind: inner method of [DB API: device type database access](#module_DB API_ device type database access)
Returns: Promise of device type commands

Param Type
db *
deviceTypeRef *

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

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

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

Param Type Default Description
db *
packageId *
sessionPackages * (if processing custom xml file it might need to reference clusters from primary zcl or other custom xml)

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

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

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

Param Type Default Description
db *
packageId *
sessionPackages * (if processing custom xml file it might need to reference attributes from primary zcl or other custom xml)

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

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

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

Param Type Default Description
db *
packageId *
sessionPackages * (if processing custom xml file it might need to reference commands from primary zcl or other custom xml)

DB API: device type database access~updateFeatureReferencesForDeviceTypeReferences(db, packageId) ⇒

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

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

Param Type
db *
packageId *

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](#module_DB API_ device type database access)
Returns: promise of completed linking

Param Type
db *

DB API: device type database access~updateDeviceTypeReferencesForCustomXml(db, packageId, sessionPackages, sessionId) ⇒

Device types defined in custom xml files might refer to cluster, commands and attributes from the primary zcl file and other custom xml in the session.

This method returns the promise of linking the device type entities to the correct foreign keys in such cases.

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

Param Type
db *
packageId *
sessionPackages *
sessionId *

DB API: device type database access~deleteUnlinkedDeviceTypeClusters(db, packageId)

This method deletes all device type clusters that are not linked to any cluster.

Kind: inner method of [DB API: device type database access](#module_DB API_ device type database access)

Param Type
db *
packageId *

DB API: device type database access~warnUnlinkedDeviceTypeClusters(db, packageId, sessionId)

This method adds warnings for all device type clusters that are not linked to any cluster.

Kind: inner method of [DB API: device type database access](#module_DB API_ device type database access)

Param Type
db *
packageId *
sessionId *

DB API: device type database access~selectDeviceTypesWithCompositionByEndpointTypeId(db, endpointTypeId) ⇒ Promise.<Array>

Asynchronously selects device types with their compositions by a specific endpoint type ID.

This function queries the database for device types associated with a given endpoint type ID, including details about the device type and any endpoint compositions linked to it.

Kind: inner method of [DB API: device type database access](#module_DB API_ device type database access)
Returns: Promise.<Array> - A promise that resolves with an array of device types and their compositions.

Param Type Description
db Object The database connection object.
endpointTypeId number The ID of the endpoint type used to filter the device types.

DB API: device type database access~selectDeviceTypesByEndpointTypeId(db, endpointTypeId) ⇒

Retrieves the zcl device type information based on an endpoint type id

Kind: inner method of [DB API: device type database access](#module_DB API_ device type database access)
Returns: promise with zcl device type information based on endpoint type id

Param Type
db *
endpointTypeId *

DB API: device type database access~selectDeviceTypeFeaturesByEndpointTypeIdAndClusterId(db, endpointTypeId, clusterId) ⇒

Retrieves the device type features associated to an endpoint type id and cluster id Note: Use clusterId as 'all' to get all features for an endpoint type id.

Kind: inner method of [DB API: device type database access](#module_DB API_ device type database access)
Returns: promise with zcl device type feature information based on endpoint type id and cluster id

Param Type
db *
endpointTypeId *
clusterId *

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 enum access

This module provides queries for enums.

  • [DB API: zcl database enum access](#module_DB API_ zcl database enum access)
    • [~selectAllEnums(db, packageId)](#module_DB API_ zcl database enum access..selectAllEnums) ⇒
    • [~selectClusterEnums(db, packageId, clusterId)](#module_DB API_ zcl database enum access..selectClusterEnums) ⇒
    • [~selectAllEnumItemsById(db, id)](#module_DB API_ zcl database enum access..selectAllEnumItemsById) ⇒
    • [~selectAllEnumItems(db, packageId)](#module_DB API_ zcl database enum access..selectAllEnumItems) ⇒
    • [~selectEnumById(db, id)](#module_DB API_ zcl database enum access..selectEnumById) ⇒
    • [~selectEnumByName(db, name, packageIds)](#module_DB API_ zcl database enum access..selectEnumByName) ⇒
    • [~selectEnumByNameAndClusterId(db, name, clusterId, packageIds)](#module_DB API_ zcl database enum access..selectEnumByNameAndClusterId) ⇒
    • [~selectEnumByNameAndClusterName(db, name, clusterName, packageIds)](#module_DB API_ zcl database enum access..selectEnumByNameAndClusterName) ⇒

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

Retrieves all the enums in the database.

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

Param Type
db *
packageId *

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

Retrieves all the enums with cluster references in the database.

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

Param Type
db *
packageId *
clusterId *

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

Returns an enum by ID.

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

Param Type
db *
id *

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

Select all enum items in a package.

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

Param Type
db *
packageId *

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

Select an enum matched by its primary key.

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

Param Type
db *
id *

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

Select an enum matched by name.

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

Param Type
db *
name *
packageIds *

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

Select an enum matched by name and clusterId.

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

Param Type
db *
name *
clusterId *
packageIds *

DB API: zcl database enum access~selectEnumByNameAndClusterName(db, name, clusterName, packageIds) ⇒

Select a enum matched by name and cluster name Note: Use selectEnumByNameAndClusterId but this was needed for backwards compatibility.

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

Param Type
db *
name *
clusterName *
packageIds *

DB API: event queries.

This module provides queries related to events.

DB API: feature related queries

This module provides queries for features.

  • [DB API: feature related queries](#module_DB API_ feature related queries)
    • [~getFeaturesByDeviceTypeRefs(db, deviceTypeRefs, endpointTypeRef)](#module_DB API_ feature related queries..getFeaturesByDeviceTypeRefs) ⇒
    • [~selectAllFeatures(db, packageIds)](#module_DB API_ feature related queries..selectAllFeatures) ⇒
    • [~selectFeaturesByClusterId(db, clusterId)](#module_DB API_ feature related queries..selectFeaturesByClusterId) ⇒
    • [~checkIfConformanceDataExist(db)](#module_DB API_ feature related queries..checkIfConformanceDataExist) ⇒

DB API: feature related queries~getFeaturesByDeviceTypeRefs(db, deviceTypeRefs, endpointTypeRef) ⇒

Get all device type features associated with a list of device type refs and an endpoint. Join ENDPOINT_TYPE_ATTRIBUTE and ATTRIBUTE table to get featureMap attribute associated with the feature, so the frontend could get and set featureMap bit easier. Only return features with cluster on the side specified in the device type.

Kind: inner method of [DB API: feature related queries](#module_DB API_ feature related queries)
Returns: All feature information and device type conformance with associated device type, cluster, and featureMap attribute details

Param Type
db *
deviceTypeRefs *
endpointTypeRef *

DB API: feature related queries~selectAllFeatures(db, packageIds) ⇒

Retrieves all features from given package ids.

Kind: inner method of [DB API: feature related queries](#module_DB API_ feature related queries)
Returns: promise of an array of features

Param Type
db *
packageIds *

DB API: feature related queries~selectFeaturesByClusterId(db, clusterId) ⇒

Retrieves features for a given cluster Id.

Kind: inner method of [DB API: feature related queries](#module_DB API_ feature related queries)
Returns: promise of an array of features in the cluster

Param Type
db *
clusterId *

DB API: feature related queries~checkIfConformanceDataExist(db) ⇒

Check if any non-empty conformance data exist in ATTRIBUTE, COMMAND, and DEVICE_TYPE_FEATURE table.

Kind: inner method of [DB API: feature related queries](#module_DB API_ feature related queries)
Returns: boolean value indicating if conformance data exists

Param Type
db *

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](#module_DB API_ zcl loading queries)
    • [~attributeMap(clusterId, packageId, attributes)](#module_DB API_ zcl loading queries..attributeMap) ⇒
    • [~eventMap(clusterId, packageId, events)](#module_DB API_ zcl loading queries..eventMap) ⇒
    • [~commandMap(clusterId, packageId, commands)](#module_DB API_ zcl loading queries..commandMap) ⇒
    • [~fieldMap(eventId, packageId, fields)](#module_DB API_ zcl loading queries..fieldMap) ⇒
    • [~argMap(cmdId, packageId, args)](#module_DB API_ zcl loading queries..argMap) ⇒
    • [~filterDuplicates(db, packageId, data, keys, elementName)](#module_DB API_ zcl loading queries..filterDuplicates) ⇒ Array
    • [~insertAttributeAccessData(db, packageId, accessData)](#module_DB API_ zcl loading queries..insertAttributeAccessData) ⇒
    • [~insertCommandAccessData(db, packageId, accessData)](#module_DB API_ zcl loading queries..insertCommandAccessData) ⇒
    • [~insertEventAccessData(db, packageId, accessData)](#module_DB API_ zcl loading queries..insertEventAccessData) ⇒
    • [~insertAttributes(db, packageId, attributes)](#module_DB API_ zcl loading queries..insertAttributes) ⇒
    • [~insertAttributeMappings(db, data)](#module_DB API_ zcl loading queries..insertAttributeMappings) ⇒
    • [~insertEvents(db, packageId, events)](#module_DB API_ zcl loading queries..insertEvents) ⇒
    • [~insertCommands(db, packageId, commands)](#module_DB API_ zcl loading queries..insertCommands) ⇒
    • [~insertGlobals(db, packageId, data)](#module_DB API_ zcl loading queries..insertGlobals) ⇒
    • [~insertClusterExtensions(db, packageId, data)](#module_DB API_ zcl loading queries..insertClusterExtensions) ⇒
    • [~insertClusters(db, packageId, data)](#module_DB API_ zcl loading queries..insertClusters) ⇒
    • [~insertFeatures(db, packageId, data)](#module_DB API_ zcl loading queries..insertFeatures) ⇒
    • [~insertTags(db, packageId, data)](#module_DB API_ zcl loading queries..insertTags) ⇒
    • [~insertDomains(db, packageId, data)](#module_DB API_ zcl loading queries..insertDomains) ⇒
    • [~insertSpecs(db, packageId, data)](#module_DB API_ zcl loading queries..insertSpecs) ⇒
    • [~insertGlobalAttributeDefault(db, packageId, clusterData)](#module_DB API_ zcl loading queries..insertGlobalAttributeDefault) ⇒
    • [~insertAtomics(db, packageId, data)](#module_DB API_ zcl loading queries..insertAtomics)
    • [~insertEndpointComposition(db, composition, context)](#module_DB API_ zcl loading queries..insertEndpointComposition) ⇒
    • [~getEndpointCompositionIdByCode(db, deviceType)](#module_DB API_ zcl loading queries..getEndpointCompositionIdByCode) ⇒ Promise.<(number|null)>
    • [~insertDeviceComposition(db, deviceType, endpointCompositionId)](#module_DB API_ zcl loading queries..insertDeviceComposition) ⇒ Promise
    • [~insertDeviceTypes(db, packageId, data)](#module_DB API_ zcl loading queries..insertDeviceTypes) ⇒
    • [~reloadDeviceTypes(db, packageId, data, sessionPackages)](#module_DB API_ zcl loading queries..reloadDeviceTypes)
    • [~isDeviceTypeClusterInsertRequired(db, deviceTypeId, clusterName, packageId, sessionPackages)](#module_DB API_ zcl loading queries..isDeviceTypeClusterInsertRequired) ⇒ Promise.<boolean>
    • [~insertDeviceTypeFeatures(db, dtClusterRefDataPairs)](#module_DB API_ zcl loading queries..insertDeviceTypeFeatures)
    • [~insertDeviceTypeAttributes(db, dtClusterRefDataPairs)](#module_DB API_ zcl loading queries..insertDeviceTypeAttributes)
    • [~insertDeviceTypeCommands(db, dtClusterRefDataPairs)](#module_DB API_ zcl loading queries..insertDeviceTypeCommands)
    • [~insertAccessOperations(db, packageId, operations)](#module_DB API_ zcl loading queries..insertAccessOperations) ⇒
    • [~insertAccessRoles(db, packageId, roles)](#module_DB API_ zcl loading queries..insertAccessRoles) ⇒
    • [~insertAccessModifiers(db, packageId, modifiers)](#module_DB API_ zcl loading queries..insertAccessModifiers) ⇒
    • [~createAccessRows(db, packageId, data)](#module_DB API_ zcl loading queries..createAccessRows)
    • [~insertDefaultAccess(db, packageId, defaultAccess)](#module_DB API_ zcl loading queries..insertDefaultAccess)
    • [~updateDataTypeClusterReferences(db, packageId)](#module_DB API_ zcl loading queries..updateDataTypeClusterReferences) ⇒
    • [~insertDataTypeDiscriminator(db, packageId, data)](#module_DB API_ zcl loading queries..insertDataTypeDiscriminator)
    • [~insertDataType(db, packageId, data)](#module_DB API_ zcl loading queries..insertDataType)
    • [~insertNumber(db, packageId, data)](#module_DB API_ zcl loading queries..insertNumber)
    • [~insertString(db, packageId, data)](#module_DB API_ zcl loading queries..insertString)
    • [~insertEnumAtomic(db, packageId, data)](#module_DB API_ zcl loading queries..insertEnumAtomic)
    • [~insertEnum(db, packageIds, data)](#module_DB API_ zcl loading queries..insertEnum)
    • [~insertEnumItems(db, packageId, knownPackages, data)](#module_DB API_ zcl loading queries..insertEnumItems)
    • [~insertBitmapAtomic(db, packageId, data)](#module_DB API_ zcl loading queries..insertBitmapAtomic)
    • [~insertBitmap(db, packageIds, data)](#module_DB API_ zcl loading queries..insertBitmap)
    • [~insertBitmapFields(db, packageId, knownPackages, data)](#module_DB API_ zcl loading queries..insertBitmapFields)
    • [~insertStruct(db, packageIds, data)](#module_DB API_ zcl loading queries..insertStruct)
    • [~insertStructItems(db, packageIds, data)](#module_DB API_ zcl loading queries..insertStructItems)

DB API: zcl loading queries~attributeMap(clusterId, packageId, attributes) ⇒

Transforms the array of attributes in a certain format and returns it.

Kind: inner method of [DB API: zcl loading queries](#module_DB API_ zcl loading queries)
Returns: Array of attribute details

Param Type
clusterId *
packageId *
attributes *

DB API: zcl loading queries~eventMap(clusterId, packageId, events) ⇒

Transforms the array of events in a certain format and returns it.

Kind: inner method of [DB API: zcl loading queries](#module_DB API_ zcl loading queries)
Returns: Array of event details

Param Type
clusterId *
packageId *
events *

DB API: zcl loading queries~commandMap(clusterId, packageId, commands) ⇒

Transforms the array of commands in a certain format and returns it.

Kind: inner method of [DB API: zcl loading queries](#module_DB API_ zcl loading queries)
Returns: Array of command details

Param Type
clusterId *
packageId *
commands *

DB API: zcl loading queries~fieldMap(eventId, packageId, fields) ⇒

Transforms the array of event fields in a certain format and returns it.

Kind: inner method of [DB API: zcl loading queries](#module_DB API_ zcl loading queries)
Returns: Array of event field details

Param Type
eventId *
packageId *
fields *

DB API: zcl loading queries~argMap(cmdId, packageId, args) ⇒

Transforms the array of command args in a certain format and returns it.

Kind: inner method of [DB API: zcl loading queries](#module_DB API_ zcl loading queries)
Returns: Array of command arg details

Param Type
cmdId *
packageId *
args *

DB API: zcl loading queries~filterDuplicates(db, packageId, data, keys, elementName) ⇒ Array

Filters out duplicates in an array of objects based on specified keys and logs a warning for each duplicate found. This function is used to filter out duplicates in command, attribute, and event data before inserting into the database. Treats null and 0 as equivalent.

Kind: inner method of [DB API: zcl loading queries](#module_DB API_ zcl loading queries)
Returns: Array - - Array of unique objects (duplicates removed).

Param Type Description
db *
packageId *
data Array Array of objects.
keys Array Array of keys to compare for duplicates (e.g., ['code', 'manufacturerCode']).
elementName *

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

access data is array of objects, containing id/op/role/modifier. Insert attribute access data.

Kind: inner method of [DB API: zcl loading queries](#module_DB API_ zcl loading queries)
Returns: Promise of insert on attribute access

Param Type
db *
packageId *
accessData *

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

access data is array of objects, containing id/op/role/modifier. Insert command access data.

Kind: inner method of [DB API: zcl loading queries](#module_DB API_ zcl loading queries)
Returns: Promise of insert on command access

Param Type
db *
packageId *
accessData *

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

access data is array of objects, containing id/op/role/modifier. Insert event access data.

Kind: inner method of [DB API: zcl loading queries](#module_DB API_ zcl loading queries)
Returns: Promise of insert on event access

Param Type
db *
packageId *
accessData *

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

Insert attribute details.

Kind: inner method of [DB API: zcl loading queries](#module_DB API_ zcl loading queries)
Returns: None

Param Type
db *
packageId *
attributes *

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

Load the attribute mapping table with associated attributes

Kind: inner method of [DB API: zcl loading queries](#module_DB API_ zcl loading queries)
Returns: attribute mapping ids of the associated attributes

Param Type
db *
data *

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

Insert event details.

Kind: inner method of [DB API: zcl loading queries](#module_DB API_ zcl loading queries)
Returns: None

Param Type
db *
packageId *
events *

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

Insert command details

Kind: inner method of [DB API: zcl loading queries](#module_DB API_ zcl loading queries)
Returns: None

Param Type
db *
packageId *
commands *

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

Inserts globals into the database.

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

Param Type
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](#module_DB API_ zcl loading queries)
Returns: Promise of cluster extension insertion.

Param Type
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](#module_DB API_ zcl loading queries)
Returns: Promise of cluster insertion.

Param Type Description
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~insertFeatures(db, packageId, data) ⇒

Inserts features into the database.

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

Param Type
db *
packageId *
data *

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](#module_DB API_ zcl loading queries)
Returns: A promise that resolves with array of rowids.

Param Type
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](#module_DB API_ zcl loading queries)
Returns: A promise that resolves with an array of rowids of all inserted domains.

Param Type Description
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](#module_DB API_ zcl loading queries)
Returns: Promise of insertion.

Param Type Description
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](#module_DB API_ zcl loading queries)
Returns: Promise of data insertion.

Param Type Description
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](#module_DB API_ zcl loading queries)

Param Type
db *
packageId *
data *

DB API: zcl loading queries~insertEndpointComposition(db, composition, context) ⇒

Inserts endpoint composition data into the database based on the context's mandatory device type. This function checks if the context's mandatory device type matches the composition code. If they match, it performs an insert operation with a specific type from dbEnum.mandatoryDeviceType. If they do not match, it performs an insert with the composition's type.

Kind: inner method of [DB API: zcl loading queries](#module_DB API_ zcl loading queries)
Returns: A promise resolved with the result of the database insert operation.

Param Type Description
db * The database connection object.
composition * The composition data to be inserted.
context * The context containing the mandatory device type to check against.

DB API: zcl loading queries~getEndpointCompositionIdByCode(db, deviceType) ⇒ Promise.<(number|null)>

Retrieves the endpoint composition ID for a given device type code.

Kind: inner method of [DB API: zcl loading queries](#module_DB API_ zcl loading queries)
Returns: Promise.<(number|null)> - - A promise that resolves to the endpoint composition ID or null if not found.

Param Type Description
db * The database connection object.
deviceType Object The device type object containing the code.

DB API: zcl loading queries~insertDeviceComposition(db, deviceType, endpointCompositionId) ⇒ Promise

Inserts device composition records for each deviceType into the DEVICE_COMPOSITION table for all endpoints in the deviceType, including endpoint-specific constraint and conformance values.

This function constructs an SQL INSERT query to add a new record to the DEVICE_COMPOSITION table for each deviceType in each endpoint. It handles the insertion of the device code, endpoint composition reference, conformance, and constraint values. Note that the "CONSTRAINT" column name is escaped with double quotes to avoid conflicts with the SQL reserved keyword.

Kind: inner method of [DB API: zcl loading queries](#module_DB API_ zcl loading queries)
Returns: Promise - A promise that resolves when all insertions are complete.

Param Type Description
db Object The database connection object.
deviceType Object The device type object containing the data to be inserted.
endpointCompositionId number The ID of the endpoint composition.

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

Inserts device types into the database.

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

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

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

Reloads device types into the database. This function is responsible for inserting new device type entities as required when a previously loaded custom xml file (containing a device type) is added to a session.

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

Param Type
db *
packageId *
data *
sessionPackages *

DB API: zcl loading queries~isDeviceTypeClusterInsertRequired(db, deviceTypeId, clusterName, packageId, sessionPackages) ⇒ Promise.<boolean>

Checks if a device type cluster insert is required on device type reload.

Kind: inner method of [DB API: zcl loading queries](#module_DB API_ zcl loading queries)
Returns: Promise.<boolean> - - Returns true if the insert is required, false otherwise.

Param Type
db *
deviceTypeId *
clusterName *
packageId *
sessionPackages *

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

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

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

Param Type
db *
dtClusterRefDataPairs *

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](#module_DB API_ zcl loading queries)

Param Type
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](#module_DB API_ zcl loading queries)

Param Type
db *
dtClusterRefDataPairs *

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

Insert into Access operation Table.

Kind: inner method of [DB API: zcl loading queries](#module_DB API_ zcl loading queries)
Returns: Promise of Access Operation insert operation.

Param Type
db *
packageId *
operations *

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

Insert into Access Role Table.

Kind: inner method of [DB API: zcl loading queries](#module_DB API_ zcl loading queries)
Returns: Promise of Access Role insert operation.

Param Type
db *
packageId *
roles *

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

Insert into Access Modifier Table.

Kind: inner method of [DB API: zcl loading queries](#module_DB API_ zcl loading queries)
Returns: Promise of Access Modifier insert operation.

Param Type
db *
packageId *
modifiers *

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

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

Param Type Description
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](#module_DB API_ zcl loading queries)

Param Type
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](#module_DB API_ zcl loading queries)
Returns: promise which updates cluster references for data types

Param Type
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](#module_DB API_ zcl loading queries)

Param Type
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](#module_DB API_ zcl loading queries)

Param Type Description
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](#module_DB API_ zcl loading queries)

Param Type
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](#module_DB API_ zcl loading queries)

Param Type
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](#module_DB API_ zcl loading queries)

Param Type
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](#module_DB API_ zcl loading queries)

Param Type
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](#module_DB API_ zcl loading queries)

Param Type
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](#module_DB API_ zcl loading queries)

Param Type
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](#module_DB API_ zcl loading queries)

Param Type
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](#module_DB API_ zcl loading queries)

Param Type
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](#module_DB API_ zcl loading queries)

Param Type
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](#module_DB API_ zcl loading queries)

Param Type
db *
packageIds *
data *

DB API: zcl database number access

This module provides queries for numbers.

  • [DB API: zcl database number access](#module_DB API_ zcl database number access)
    • [~selectNumberByName(db, name, packageIds)](#module_DB API_ zcl database number access..selectNumberByName) ⇒
    • [~selectNumberByNameAndClusterId(db, name, packageIds)](#module_DB API_ zcl database number access..selectNumberByNameAndClusterId) ⇒
    • [~selectNumberById(db, name)](#module_DB API_ zcl database number access..selectNumberById) ⇒
    • [~selectAllNumbers(db, packageId)](#module_DB API_ zcl database number access..selectAllNumbers) ⇒

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

Select an number matched by name.

Kind: inner method of [DB API: zcl database number access](#module_DB API_ zcl database number access)
Returns: number or undefined

Param
db
name
packageIds

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

Select a number matched by name and clusterId

Kind: inner method of [DB API: zcl database number access](#module_DB API_ zcl database number access)
Returns: number information or undefined

Param
db
name
packageIds

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

Select an number matched by id.

Kind: inner method of [DB API: zcl database number access](#module_DB API_ zcl database number access)
Returns: number or undefined

Param
db
name

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

Select all numbers.

Kind: inner method of [DB API: zcl database number access](#module_DB API_ zcl database number access)
Returns: All numbers

Param
db
packageId

DB API: session related queries.

This module provides package notification related queries.

DB API: package-based queries.

This module provides queries related to packages.

DB API: session related queries.

This module provides session notification related queries.

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](#module_DB API_ zcl database access)
    • [~clear()](#module_DB API_ zcl database access..clear)
    • [~put(key, packageId, data)](#module_DB API_ zcl database access..put) ⇒
    • [~get(key, packageId)](#module_DB API_ zcl database access..get) ⇒
    • [~isCached(key, packageId)](#module_DB API_ zcl database access..isCached) ⇒
    • [~cacheQuery(key, packageId)](#module_DB API_ zcl database access..cacheQuery) ⇒
    • [~cacheStats()](#module_DB API_ zcl database access..cacheStats)
    • [~enable()](#module_DB API_ zcl database access..enable)
    • [~disable()](#module_DB API_ zcl database access..disable)
    • [~selectAllAtomics(db, packageId)](#module_DB API_ zcl database access..selectAllAtomics) ⇒
    • [~selectAtomicType(db, packageId, typeName)](#module_DB API_ zcl database access..selectAtomicType)
    • [~selectAtomicById(db, packageId)](#module_DB API_ zcl database access..selectAtomicById)
    • [~isTypeSignedByNameAndPackage(db, name, sessionPackages)](#module_DB API_ zcl database access..isTypeSignedByNameAndPackage) ⇒ Promise.<boolean>
    • [~selectAllBitmaps(db)](#module_DB API_ zcl database access..selectAllBitmaps) ⇒
    • [~selectBitmapByName(db, packageIds, name)](#module_DB API_ zcl database access..selectBitmapByName) ⇒
    • [~selectBitmapByNameAndClusterId(db, name, clusterId, packageIds)](#module_DB API_ zcl database access..selectBitmapByNameAndClusterId) ⇒
    • [~selectBitmapByNameAndClusterName(db, name, clusterName, packageIds)](#module_DB API_ zcl database access..selectBitmapByNameAndClusterName) ⇒
    • [~selectBitmapById(db, id)](#module_DB API_ zcl database access..selectBitmapById) ⇒
    • [~selectSessionClusterByCode(db, sessionId, code, mfgCode)](#module_DB API_ zcl database access..selectSessionClusterByCode) ⇒
    • [~selectAllSessionClusters(db, sessionId)](#module_DB API_ zcl database access..selectAllSessionClusters) ⇒
    • [~selectSessionAttributeByCode(db, sessionId, clusterCode, side, attributeCode, mfgCode)](#module_DB API_ zcl database access..selectSessionAttributeByCode) ⇒
    • [~selectSessionCommandByCode(db, sessionId, clusterCode, commandCode, source)](#module_DB API_ zcl database access..selectSessionCommandByCode) ⇒
    • [~selectAllStructs(db, packageId)](#module_DB API_ zcl database access..selectAllStructs) ⇒
    • [~selectStructById(db, id)](#module_DB API_ zcl database access..selectStructById) ⇒
    • [~selectStructByName(db, name, packageIds)](#module_DB API_ zcl database access..selectStructByName) ⇒
    • [~selectStructByNameAndClusterId(db, name, clusterId, packageIds)](#module_DB API_ zcl database access..selectStructByNameAndClusterId) ⇒
    • [~selectStructByNameAndClusterName(db, name, clusterName, packageIds)](#module_DB API_ zcl database access..selectStructByNameAndClusterName) ⇒
    • [~selectStructsWithClusterAssociation(db, packageIds, groupByStructName)](#module_DB API_ zcl database access..selectStructsWithClusterAssociation) ⇒
    • [~sqlQueryForDataTypeByNameAndClusterId(typeDiscriminator, clusterId, packageIds)](#module_DB API_ zcl database access..sqlQueryForDataTypeByNameAndClusterId) ⇒
    • [~sqlQueryForDataTypeByNameAndClusterName(typeDiscriminator, name, clusterName, packageIds, options)](#module_DB API_ zcl database access..sqlQueryForDataTypeByNameAndClusterName) ⇒
    • [~selectClusterBitmaps(db, packageId, clusterId)](#module_DB API_ zcl database access..selectClusterBitmaps) ⇒
    • [~selectAllBitmapFieldsById(db, id)](#module_DB API_ zcl database access..selectAllBitmapFieldsById) ⇒
    • [~selectAllBitmapFields(db, packageId)](#module_DB API_ zcl database access..selectAllBitmapFields) ⇒
    • [~selectAllDomains(db)](#module_DB API_ zcl database access..selectAllDomains) ⇒
    • [~selectDomainById(db, id)](#module_DB API_ zcl database access..selectDomainById) ⇒
    • [~selectAllStructsWithItemCount(db, packageIds)](#module_DB API_ zcl database access..selectAllStructsWithItemCount) ⇒
    • [~selectStructClusters(db, structId)](#module_DB API_ zcl database access..selectStructClusters) ⇒
    • [~selectEnumClusters(db, enumId)](#module_DB API_ zcl database access..selectEnumClusters) ⇒
    • [~selectBitmapClusters(db, bitmapId)](#module_DB API_ zcl database access..selectBitmapClusters) ⇒
    • [~selectClusterStructsWithItems(db)](#module_DB API_ zcl database access..selectClusterStructsWithItems) ⇒
    • [~selectAllStructsWithItems(db)](#module_DB API_ zcl database access..selectAllStructsWithItems) ⇒
    • [~selectStructsWithItemsImpl(db, packageIds, clusterId)](#module_DB API_ zcl database access..selectStructsWithItemsImpl) ⇒
    • [~selectAllStructItemsById(db, id)](#module_DB API_ zcl database access..selectAllStructItemsById) ⇒
    • [~selectAllStructItemsByStructName(db, name, packageIds, clusterName)](#module_DB API_ zcl database access..selectAllStructItemsByStructName) ⇒
    • [~selectAllClusters(db)](#module_DB API_ zcl database access..selectAllClusters) ⇒
    • [~selectClusterByCode(db, packageId, clusterCode, mfgCode)](#module_DB API_ zcl database access..selectClusterByCode) ⇒
    • [~selectClusterById(db, clusterId, packageId)](#module_DB API_ zcl database access..selectClusterById) ⇒
    • [~selectAttributesByClusterIdIncludingGlobal(db, clusterId, packageIds)](#module_DB API_ zcl database access..selectAttributesByClusterIdIncludingGlobal) ⇒
    • [~selectAttributesByClusterIdAndSideIncludingGlobal(db, clusterId, packageIds, side)](#module_DB API_ zcl database access..selectAttributesByClusterIdAndSideIncludingGlobal) ⇒
    • [~selectAttributesByClusterCodeAndManufacturerCode(db, packageId, clusterCode, manufacturerCode)](#module_DB API_ zcl database access..selectAttributesByClusterCodeAndManufacturerCode) ⇒
    • [~selectAttributeById(db, id)](#module_DB API_ zcl database access..selectAttributeById) ⇒
    • [~selectAttributeByAttributeIdAndClusterRef(db, attributeId, clusterRef)](#module_DB API_ zcl database access..selectAttributeByAttributeIdAndClusterRef)
    • [~selectAllAttributes(db, packageIds)](#module_DB API_ zcl database access..selectAllAttributes) ⇒
    • [~selectAllAttributesBySide(db, side, packageId)](#module_DB API_ zcl database access..selectAllAttributesBySide) ⇒
    • [~selectEndpointTypeClustersByEndpointTypeId(db, endpointTypeId)](#module_DB API_ zcl database access..selectEndpointTypeClustersByEndpointTypeId) ⇒
    • [~selectEndpointTypeAttributesByEndpointId(db, endpointTypeId)](#module_DB API_ zcl database access..selectEndpointTypeAttributesByEndpointId) ⇒
    • [~selectEndpointTypeAttribute(db, endpointTypeId, attributeRef, clusterRef)](#module_DB API_ zcl database access..selectEndpointTypeAttribute) ⇒
    • [~selectEndpointTypeCommandsByEndpointId(db, endpointTypeId)](#module_DB API_ zcl database access..selectEndpointTypeCommandsByEndpointId) ⇒
    • [~selectEndpointTypeEventsByEndpointId(db, endpointTypeId)](#module_DB API_ zcl database access..selectEndpointTypeEventsByEndpointId) ⇒

DB API: zcl database access~clear()

Clears the entire cache.

Kind: inner method of [DB API: zcl database access](#module_DB 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](#module_DB API_ zcl database access)
Returns: Returns true on success.

Param Type
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](#module_DB API_ zcl database access)
Returns: cached object or undefined if none is present or expired.

Param Type
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](#module_DB API_ zcl database access)
Returns: true or false, depending on whether the cache is present.

Param Type
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](#module_DB API_ zcl database access)
Returns: true or false, depending on whether the cache is present.

Param Type
key *
packageId *

DB API: zcl database access~cacheStats()

Returns the cache statistics.

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

DB API: zcl database access~enable()

Enable the Database Query cache

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

DB API: zcl database access~disable()

Disable the database cache

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

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

Get all atomic data type information

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: atomic data types

Param Type
db *
packageId *

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](#module_DB API_ zcl database access)

Param Type
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](#module_DB API_ zcl database access)

Param Type
db *
packageId *

DB API: zcl database access~isTypeSignedByNameAndPackage(db, name, sessionPackages) ⇒ Promise.<boolean>

Checks if a type by a given name is signed.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise.<boolean> - - A promise that resolves to true if the type is signed, false otherwise.

Param Type Description
db object The database connection object.
name string The name of the type.
sessionPackages Array An array of session packages.

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

Retrieves all the bitmaps in the database.

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

Param Type
db *

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

Get bitmap by name from the given package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: promise of bitmap

Param Type
db *
packageIds *
name *

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](#module_DB API_ zcl database access)
Returns: bitmap information or undefined

Param Type
db *
name *
clusterId *
packageIds *

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

Select a bitmap matched by name and cluster name Note: Use selectBitmapByNameAndClusterId but this was needed for backwards compatibility.

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

Param Type
db *
name *
clusterName *
packageIds *

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

Get Bitmap information by Bitmap ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of bitmap

Param Type
db *
id *

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

Returns the cluster available to this session by the code.

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

Param Type
db *
sessionId *
code *
mfgCode *

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](#module_DB API_ zcl database access)
Returns: all the cluster objects for a given session.

Param Type
db *
sessionId *

DB API: zcl database access~selectSessionAttributeByCode(db, sessionId, clusterCode, side, attributeCode, mfgCode) ⇒

Returns the attribute available to this session by the code.

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

Param Type
db *
sessionId *
clusterCode *
side *
attributeCode *
mfgCode *

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

Returns the command available to this session by the code.

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

Param Type
db *
sessionId *
clusterCode *
commandCode *
source *

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

Get all structs from a given package ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of Structs

Param Type
db *
packageId *

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

Get struct details from the given struct ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of Struct

Param Type
db *
id *

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

Get Struct details from the given struct name and package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of Struct

Param Type
db *
name *
packageIds *

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](#module_DB API_ zcl database access)
Returns: struct information or undefined

Param Type
db *
name *
clusterId *
packageIds *

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

Select a struct matched by name and cluster name Note: Use selectStructByNameAndClusterId but this was needed for backwards compatibility.

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

Param Type
db *
name *
clusterName *
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](#module_DB API_ zcl database access)
Returns: structs which have an association with clusters

Param Type
db *
packageIds *
groupByStructName *

DB API: zcl database access~sqlQueryForDataTypeByNameAndClusterId(typeDiscriminator, clusterId, packageIds) ⇒

Formulate a sqlite query string for a data type from the given cluster ID and package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: SQLite query string

Param Type Default
typeDiscriminator *
clusterId *
packageIds *

DB API: zcl database access~sqlQueryForDataTypeByNameAndClusterName(typeDiscriminator, name, clusterName, packageIds, options) ⇒

Formulate a sqlite query string for a data type from the given cluster name and package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: SQLite query string

Param Type Description
typeDiscriminator *
name * data type name
clusterName *
packageIds *
options *

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](#module_DB API_ zcl database access)
Returns: cluster-related bitmaps

Param Type
db *
packageId *
clusterId *

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

Get bitmap fields from the given bitmap ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of bitmap fields

Param Type
db *
id *

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

Get all bitmap fields from the given package ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of bitmap fields

Param Type
db *
packageId *

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

Retrieves all the domains in the database.

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

Param Type
db *

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

Get Domain details from the given domain ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of domain

Param Type
db *
id *

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](#module_DB API_ zcl database access)
Returns: Promise that resolves with the rows of structs.

Param Type
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](#module_DB API_ zcl database access)
Returns: clusters

Param Type
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](#module_DB API_ zcl database access)
Returns: clusters

Param Type
db *
enumId *

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

Returns an array of clusters that bitmap belongs to.

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

Param Type
db *
bitmapId *

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](#module_DB API_ zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.

Param Type
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](#module_DB API_ zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.

Param Type
db *

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

Get Struct details along with its struct items.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: struct details

Param Type
db *
packageIds *
clusterId *

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

Get struct item details from the given struct item ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of Stuct Items

Param Type
db *
id *

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

Retrieves the struct items based on struct and cluster name. Note: By default clusterName is null.

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

Param Default
db
name
packageIds
clusterName

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

Retrieves all the clusters in the database.

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

Param Type
db *

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

Finds cluster by code.

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

Param Type Default Description
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](#module_DB API_ zcl database access)
Returns: promise that resolves into a cluster object

Param Type
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](#module_DB API_ zcl database access)
Returns: promise of a list of attributes, including global attributes

Param Type
db *
clusterId *
packageIds *

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

Get attribute details from the given information.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of attribute details

Param Type
db *
clusterId *
packageIds *
side *

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](#module_DB API_ zcl database access)
Returns: promise that resolves into attributes.

Param Type
db *
packageId *
clusterCode *
manufacturerCode *

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

Get attribute details from the given attribute ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of attribute

Param Type
db *
id *

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](#module_DB API_ zcl database access)

Param Type
db *
attributeId *
clusterRef *

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

Get all attributes from the given package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of attributes

Param Type
db *
packageIds *

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

Query for attributes by side.

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

Param Type
db *
side *
packageId *

DB API: zcl database access~selectEndpointTypeClustersByEndpointTypeId(db, endpointTypeId) ⇒

Get the endpoint type cluster details from the given endpoint type ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type clusters.

Param Type
db *
endpointTypeId *

DB API: zcl database access~selectEndpointTypeAttributesByEndpointId(db, endpointTypeId) ⇒

Get the endpoint type attribute details from the given endpoint type ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type attributes.

Param Type
db *
endpointTypeId *

DB API: zcl database access~selectEndpointTypeAttribute(db, endpointTypeId, attributeRef, clusterRef) ⇒

Get the endpoint type attribute details from the given details.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type attribute.

Param Type
db *
endpointTypeId *
attributeRef *
clusterRef *

DB API: zcl database access~selectEndpointTypeCommandsByEndpointId(db, endpointTypeId) ⇒

Get the endpoint type command details from the given endpoint type ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type commands

Param Type
db *
endpointTypeId *

DB API: zcl database access~selectEndpointTypeEventsByEndpointId(db, endpointTypeId) ⇒

Get endpoint type events from the given endpoint type ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type events

Param Type
db *
endpointTypeId *

DB API: session related queries.

This module provides session related queries.

DB API: zcl database strings access

This module provides queries for strings.

  • [DB API: zcl database strings access](#module_DB API_ zcl database strings access)
    • [~selectAllStrings(db, packageId)](#module_DB API_ zcl database strings access..selectAllStrings) ⇒
    • [~selectStringById(db, packageId)](#module_DB API_ zcl database strings access..selectStringById) ⇒
    • [~selectStringByName(db, name, packageIds)](#module_DB API_ zcl database strings access..selectStringByName) ⇒

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

Select all Strings.

Kind: inner method of [DB API: zcl database strings access](#module_DB API_ zcl database strings access)
Returns: All Strings

Param
db
packageId

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

Select String by ID.

Kind: inner method of [DB API: zcl database strings access](#module_DB API_ zcl database strings access)
Returns: String

Param
db
packageId

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

Select String by name.

Kind: inner method of [DB API: zcl database strings access](#module_DB API_ zcl database strings access)
Returns: String

Param
db
name
packageIds

DB API: zcl database access

This module provides queries for enums.

  • [DB API: zcl database access](#module_DB API_ zcl database access)
    • [~clear()](#module_DB API_ zcl database access..clear)
    • [~put(key, packageId, data)](#module_DB API_ zcl database access..put) ⇒
    • [~get(key, packageId)](#module_DB API_ zcl database access..get) ⇒
    • [~isCached(key, packageId)](#module_DB API_ zcl database access..isCached) ⇒
    • [~cacheQuery(key, packageId)](#module_DB API_ zcl database access..cacheQuery) ⇒
    • [~cacheStats()](#module_DB API_ zcl database access..cacheStats)
    • [~enable()](#module_DB API_ zcl database access..enable)
    • [~disable()](#module_DB API_ zcl database access..disable)
    • [~selectAllAtomics(db, packageId)](#module_DB API_ zcl database access..selectAllAtomics) ⇒
    • [~selectAtomicType(db, packageId, typeName)](#module_DB API_ zcl database access..selectAtomicType)
    • [~selectAtomicById(db, packageId)](#module_DB API_ zcl database access..selectAtomicById)
    • [~isTypeSignedByNameAndPackage(db, name, sessionPackages)](#module_DB API_ zcl database access..isTypeSignedByNameAndPackage) ⇒ Promise.<boolean>
    • [~selectAllBitmaps(db)](#module_DB API_ zcl database access..selectAllBitmaps) ⇒
    • [~selectBitmapByName(db, packageIds, name)](#module_DB API_ zcl database access..selectBitmapByName) ⇒
    • [~selectBitmapByNameAndClusterId(db, name, clusterId, packageIds)](#module_DB API_ zcl database access..selectBitmapByNameAndClusterId) ⇒
    • [~selectBitmapByNameAndClusterName(db, name, clusterName, packageIds)](#module_DB API_ zcl database access..selectBitmapByNameAndClusterName) ⇒
    • [~selectBitmapById(db, id)](#module_DB API_ zcl database access..selectBitmapById) ⇒
    • [~selectSessionClusterByCode(db, sessionId, code, mfgCode)](#module_DB API_ zcl database access..selectSessionClusterByCode) ⇒
    • [~selectAllSessionClusters(db, sessionId)](#module_DB API_ zcl database access..selectAllSessionClusters) ⇒
    • [~selectSessionAttributeByCode(db, sessionId, clusterCode, side, attributeCode, mfgCode)](#module_DB API_ zcl database access..selectSessionAttributeByCode) ⇒
    • [~selectSessionCommandByCode(db, sessionId, clusterCode, commandCode, source)](#module_DB API_ zcl database access..selectSessionCommandByCode) ⇒
    • [~selectAllStructs(db, packageId)](#module_DB API_ zcl database access..selectAllStructs) ⇒
    • [~selectStructById(db, id)](#module_DB API_ zcl database access..selectStructById) ⇒
    • [~selectStructByName(db, name, packageIds)](#module_DB API_ zcl database access..selectStructByName) ⇒
    • [~selectStructByNameAndClusterId(db, name, clusterId, packageIds)](#module_DB API_ zcl database access..selectStructByNameAndClusterId) ⇒
    • [~selectStructByNameAndClusterName(db, name, clusterName, packageIds)](#module_DB API_ zcl database access..selectStructByNameAndClusterName) ⇒
    • [~selectStructsWithClusterAssociation(db, packageIds, groupByStructName)](#module_DB API_ zcl database access..selectStructsWithClusterAssociation) ⇒
    • [~sqlQueryForDataTypeByNameAndClusterId(typeDiscriminator, clusterId, packageIds)](#module_DB API_ zcl database access..sqlQueryForDataTypeByNameAndClusterId) ⇒
    • [~sqlQueryForDataTypeByNameAndClusterName(typeDiscriminator, name, clusterName, packageIds, options)](#module_DB API_ zcl database access..sqlQueryForDataTypeByNameAndClusterName) ⇒
    • [~selectClusterBitmaps(db, packageId, clusterId)](#module_DB API_ zcl database access..selectClusterBitmaps) ⇒
    • [~selectAllBitmapFieldsById(db, id)](#module_DB API_ zcl database access..selectAllBitmapFieldsById) ⇒
    • [~selectAllBitmapFields(db, packageId)](#module_DB API_ zcl database access..selectAllBitmapFields) ⇒
    • [~selectAllDomains(db)](#module_DB API_ zcl database access..selectAllDomains) ⇒
    • [~selectDomainById(db, id)](#module_DB API_ zcl database access..selectDomainById) ⇒
    • [~selectAllStructsWithItemCount(db, packageIds)](#module_DB API_ zcl database access..selectAllStructsWithItemCount) ⇒
    • [~selectStructClusters(db, structId)](#module_DB API_ zcl database access..selectStructClusters) ⇒
    • [~selectEnumClusters(db, enumId)](#module_DB API_ zcl database access..selectEnumClusters) ⇒
    • [~selectBitmapClusters(db, bitmapId)](#module_DB API_ zcl database access..selectBitmapClusters) ⇒
    • [~selectClusterStructsWithItems(db)](#module_DB API_ zcl database access..selectClusterStructsWithItems) ⇒
    • [~selectAllStructsWithItems(db)](#module_DB API_ zcl database access..selectAllStructsWithItems) ⇒
    • [~selectStructsWithItemsImpl(db, packageIds, clusterId)](#module_DB API_ zcl database access..selectStructsWithItemsImpl) ⇒
    • [~selectAllStructItemsById(db, id)](#module_DB API_ zcl database access..selectAllStructItemsById) ⇒
    • [~selectAllStructItemsByStructName(db, name, packageIds, clusterName)](#module_DB API_ zcl database access..selectAllStructItemsByStructName) ⇒
    • [~selectAllClusters(db)](#module_DB API_ zcl database access..selectAllClusters) ⇒
    • [~selectClusterByCode(db, packageId, clusterCode, mfgCode)](#module_DB API_ zcl database access..selectClusterByCode) ⇒
    • [~selectClusterById(db, clusterId, packageId)](#module_DB API_ zcl database access..selectClusterById) ⇒
    • [~selectAttributesByClusterIdIncludingGlobal(db, clusterId, packageIds)](#module_DB API_ zcl database access..selectAttributesByClusterIdIncludingGlobal) ⇒
    • [~selectAttributesByClusterIdAndSideIncludingGlobal(db, clusterId, packageIds, side)](#module_DB API_ zcl database access..selectAttributesByClusterIdAndSideIncludingGlobal) ⇒
    • [~selectAttributesByClusterCodeAndManufacturerCode(db, packageId, clusterCode, manufacturerCode)](#module_DB API_ zcl database access..selectAttributesByClusterCodeAndManufacturerCode) ⇒
    • [~selectAttributeById(db, id)](#module_DB API_ zcl database access..selectAttributeById) ⇒
    • [~selectAttributeByAttributeIdAndClusterRef(db, attributeId, clusterRef)](#module_DB API_ zcl database access..selectAttributeByAttributeIdAndClusterRef)
    • [~selectAllAttributes(db, packageIds)](#module_DB API_ zcl database access..selectAllAttributes) ⇒
    • [~selectAllAttributesBySide(db, side, packageId)](#module_DB API_ zcl database access..selectAllAttributesBySide) ⇒
    • [~selectEndpointTypeClustersByEndpointTypeId(db, endpointTypeId)](#module_DB API_ zcl database access..selectEndpointTypeClustersByEndpointTypeId) ⇒
    • [~selectEndpointTypeAttributesByEndpointId(db, endpointTypeId)](#module_DB API_ zcl database access..selectEndpointTypeAttributesByEndpointId) ⇒
    • [~selectEndpointTypeAttribute(db, endpointTypeId, attributeRef, clusterRef)](#module_DB API_ zcl database access..selectEndpointTypeAttribute) ⇒
    • [~selectEndpointTypeCommandsByEndpointId(db, endpointTypeId)](#module_DB API_ zcl database access..selectEndpointTypeCommandsByEndpointId) ⇒
    • [~selectEndpointTypeEventsByEndpointId(db, endpointTypeId)](#module_DB API_ zcl database access..selectEndpointTypeEventsByEndpointId) ⇒

DB API: zcl database access~clear()

Clears the entire cache.

Kind: inner method of [DB API: zcl database access](#module_DB 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](#module_DB API_ zcl database access)
Returns: Returns true on success.

Param Type
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](#module_DB API_ zcl database access)
Returns: cached object or undefined if none is present or expired.

Param Type
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](#module_DB API_ zcl database access)
Returns: true or false, depending on whether the cache is present.

Param Type
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](#module_DB API_ zcl database access)
Returns: true or false, depending on whether the cache is present.

Param Type
key *
packageId *

DB API: zcl database access~cacheStats()

Returns the cache statistics.

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

DB API: zcl database access~enable()

Enable the Database Query cache

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

DB API: zcl database access~disable()

Disable the database cache

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

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

Get all atomic data type information

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: atomic data types

Param Type
db *
packageId *

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](#module_DB API_ zcl database access)

Param Type
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](#module_DB API_ zcl database access)

Param Type
db *
packageId *

DB API: zcl database access~isTypeSignedByNameAndPackage(db, name, sessionPackages) ⇒ Promise.<boolean>

Checks if a type by a given name is signed.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise.<boolean> - - A promise that resolves to true if the type is signed, false otherwise.

Param Type Description
db object The database connection object.
name string The name of the type.
sessionPackages Array An array of session packages.

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

Retrieves all the bitmaps in the database.

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

Param Type
db *

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

Get bitmap by name from the given package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: promise of bitmap

Param Type
db *
packageIds *
name *

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](#module_DB API_ zcl database access)
Returns: bitmap information or undefined

Param Type
db *
name *
clusterId *
packageIds *

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

Select a bitmap matched by name and cluster name Note: Use selectBitmapByNameAndClusterId but this was needed for backwards compatibility.

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

Param Type
db *
name *
clusterName *
packageIds *

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

Get Bitmap information by Bitmap ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of bitmap

Param Type
db *
id *

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

Returns the cluster available to this session by the code.

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

Param Type
db *
sessionId *
code *
mfgCode *

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](#module_DB API_ zcl database access)
Returns: all the cluster objects for a given session.

Param Type
db *
sessionId *

DB API: zcl database access~selectSessionAttributeByCode(db, sessionId, clusterCode, side, attributeCode, mfgCode) ⇒

Returns the attribute available to this session by the code.

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

Param Type
db *
sessionId *
clusterCode *
side *
attributeCode *
mfgCode *

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

Returns the command available to this session by the code.

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

Param Type
db *
sessionId *
clusterCode *
commandCode *
source *

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

Get all structs from a given package ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of Structs

Param Type
db *
packageId *

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

Get struct details from the given struct ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of Struct

Param Type
db *
id *

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

Get Struct details from the given struct name and package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of Struct

Param Type
db *
name *
packageIds *

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](#module_DB API_ zcl database access)
Returns: struct information or undefined

Param Type
db *
name *
clusterId *
packageIds *

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

Select a struct matched by name and cluster name Note: Use selectStructByNameAndClusterId but this was needed for backwards compatibility.

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

Param Type
db *
name *
clusterName *
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](#module_DB API_ zcl database access)
Returns: structs which have an association with clusters

Param Type
db *
packageIds *
groupByStructName *

DB API: zcl database access~sqlQueryForDataTypeByNameAndClusterId(typeDiscriminator, clusterId, packageIds) ⇒

Formulate a sqlite query string for a data type from the given cluster ID and package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: SQLite query string

Param Type Default
typeDiscriminator *
clusterId *
packageIds *

DB API: zcl database access~sqlQueryForDataTypeByNameAndClusterName(typeDiscriminator, name, clusterName, packageIds, options) ⇒

Formulate a sqlite query string for a data type from the given cluster name and package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: SQLite query string

Param Type Description
typeDiscriminator *
name * data type name
clusterName *
packageIds *
options *

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](#module_DB API_ zcl database access)
Returns: cluster-related bitmaps

Param Type
db *
packageId *
clusterId *

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

Get bitmap fields from the given bitmap ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of bitmap fields

Param Type
db *
id *

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

Get all bitmap fields from the given package ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of bitmap fields

Param Type
db *
packageId *

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

Retrieves all the domains in the database.

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

Param Type
db *

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

Get Domain details from the given domain ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of domain

Param Type
db *
id *

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](#module_DB API_ zcl database access)
Returns: Promise that resolves with the rows of structs.

Param Type
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](#module_DB API_ zcl database access)
Returns: clusters

Param Type
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](#module_DB API_ zcl database access)
Returns: clusters

Param Type
db *
enumId *

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

Returns an array of clusters that bitmap belongs to.

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

Param Type
db *
bitmapId *

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](#module_DB API_ zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.

Param Type
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](#module_DB API_ zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.

Param Type
db *

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

Get Struct details along with its struct items.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: struct details

Param Type
db *
packageIds *
clusterId *

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

Get struct item details from the given struct item ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of Stuct Items

Param Type
db *
id *

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

Retrieves the struct items based on struct and cluster name. Note: By default clusterName is null.

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

Param Default
db
name
packageIds
clusterName

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

Retrieves all the clusters in the database.

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

Param Type
db *

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

Finds cluster by code.

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

Param Type Default Description
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](#module_DB API_ zcl database access)
Returns: promise that resolves into a cluster object

Param Type
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](#module_DB API_ zcl database access)
Returns: promise of a list of attributes, including global attributes

Param Type
db *
clusterId *
packageIds *

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

Get attribute details from the given information.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of attribute details

Param Type
db *
clusterId *
packageIds *
side *

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](#module_DB API_ zcl database access)
Returns: promise that resolves into attributes.

Param Type
db *
packageId *
clusterCode *
manufacturerCode *

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

Get attribute details from the given attribute ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of attribute

Param Type
db *
id *

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](#module_DB API_ zcl database access)

Param Type
db *
attributeId *
clusterRef *

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

Get all attributes from the given package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of attributes

Param Type
db *
packageIds *

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

Query for attributes by side.

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

Param Type
db *
side *
packageId *

DB API: zcl database access~selectEndpointTypeClustersByEndpointTypeId(db, endpointTypeId) ⇒

Get the endpoint type cluster details from the given endpoint type ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type clusters.

Param Type
db *
endpointTypeId *

DB API: zcl database access~selectEndpointTypeAttributesByEndpointId(db, endpointTypeId) ⇒

Get the endpoint type attribute details from the given endpoint type ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type attributes.

Param Type
db *
endpointTypeId *

DB API: zcl database access~selectEndpointTypeAttribute(db, endpointTypeId, attributeRef, clusterRef) ⇒

Get the endpoint type attribute details from the given details.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type attribute.

Param Type
db *
endpointTypeId *
attributeRef *
clusterRef *

DB API: zcl database access~selectEndpointTypeCommandsByEndpointId(db, endpointTypeId) ⇒

Get the endpoint type command details from the given endpoint type ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type commands

Param Type
db *
endpointTypeId *

DB API: zcl database access~selectEndpointTypeEventsByEndpointId(db, endpointTypeId) ⇒

Get endpoint type events from the given endpoint type ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type events

Param Type
db *
endpointTypeId *

DB API: zcl database access

This module provides a place for creating generic queries which are common across different query files.

  • [DB API: zcl database access](#module_DB API_ zcl database access)
    • [~clear()](#module_DB API_ zcl database access..clear)
    • [~put(key, packageId, data)](#module_DB API_ zcl database access..put) ⇒
    • [~get(key, packageId)](#module_DB API_ zcl database access..get) ⇒
    • [~isCached(key, packageId)](#module_DB API_ zcl database access..isCached) ⇒
    • [~cacheQuery(key, packageId)](#module_DB API_ zcl database access..cacheQuery) ⇒
    • [~cacheStats()](#module_DB API_ zcl database access..cacheStats)
    • [~enable()](#module_DB API_ zcl database access..enable)
    • [~disable()](#module_DB API_ zcl database access..disable)
    • [~selectAllAtomics(db, packageId)](#module_DB API_ zcl database access..selectAllAtomics) ⇒
    • [~selectAtomicType(db, packageId, typeName)](#module_DB API_ zcl database access..selectAtomicType)
    • [~selectAtomicById(db, packageId)](#module_DB API_ zcl database access..selectAtomicById)
    • [~isTypeSignedByNameAndPackage(db, name, sessionPackages)](#module_DB API_ zcl database access..isTypeSignedByNameAndPackage) ⇒ Promise.<boolean>
    • [~selectAllBitmaps(db)](#module_DB API_ zcl database access..selectAllBitmaps) ⇒
    • [~selectBitmapByName(db, packageIds, name)](#module_DB API_ zcl database access..selectBitmapByName) ⇒
    • [~selectBitmapByNameAndClusterId(db, name, clusterId, packageIds)](#module_DB API_ zcl database access..selectBitmapByNameAndClusterId) ⇒
    • [~selectBitmapByNameAndClusterName(db, name, clusterName, packageIds)](#module_DB API_ zcl database access..selectBitmapByNameAndClusterName) ⇒
    • [~selectBitmapById(db, id)](#module_DB API_ zcl database access..selectBitmapById) ⇒
    • [~selectSessionClusterByCode(db, sessionId, code, mfgCode)](#module_DB API_ zcl database access..selectSessionClusterByCode) ⇒
    • [~selectAllSessionClusters(db, sessionId)](#module_DB API_ zcl database access..selectAllSessionClusters) ⇒
    • [~selectSessionAttributeByCode(db, sessionId, clusterCode, side, attributeCode, mfgCode)](#module_DB API_ zcl database access..selectSessionAttributeByCode) ⇒
    • [~selectSessionCommandByCode(db, sessionId, clusterCode, commandCode, source)](#module_DB API_ zcl database access..selectSessionCommandByCode) ⇒
    • [~selectAllStructs(db, packageId)](#module_DB API_ zcl database access..selectAllStructs) ⇒
    • [~selectStructById(db, id)](#module_DB API_ zcl database access..selectStructById) ⇒
    • [~selectStructByName(db, name, packageIds)](#module_DB API_ zcl database access..selectStructByName) ⇒
    • [~selectStructByNameAndClusterId(db, name, clusterId, packageIds)](#module_DB API_ zcl database access..selectStructByNameAndClusterId) ⇒
    • [~selectStructByNameAndClusterName(db, name, clusterName, packageIds)](#module_DB API_ zcl database access..selectStructByNameAndClusterName) ⇒
    • [~selectStructsWithClusterAssociation(db, packageIds, groupByStructName)](#module_DB API_ zcl database access..selectStructsWithClusterAssociation) ⇒
    • [~sqlQueryForDataTypeByNameAndClusterId(typeDiscriminator, clusterId, packageIds)](#module_DB API_ zcl database access..sqlQueryForDataTypeByNameAndClusterId) ⇒
    • [~sqlQueryForDataTypeByNameAndClusterName(typeDiscriminator, name, clusterName, packageIds, options)](#module_DB API_ zcl database access..sqlQueryForDataTypeByNameAndClusterName) ⇒
    • [~selectClusterBitmaps(db, packageId, clusterId)](#module_DB API_ zcl database access..selectClusterBitmaps) ⇒
    • [~selectAllBitmapFieldsById(db, id)](#module_DB API_ zcl database access..selectAllBitmapFieldsById) ⇒
    • [~selectAllBitmapFields(db, packageId)](#module_DB API_ zcl database access..selectAllBitmapFields) ⇒
    • [~selectAllDomains(db)](#module_DB API_ zcl database access..selectAllDomains) ⇒
    • [~selectDomainById(db, id)](#module_DB API_ zcl database access..selectDomainById) ⇒
    • [~selectAllStructsWithItemCount(db, packageIds)](#module_DB API_ zcl database access..selectAllStructsWithItemCount) ⇒
    • [~selectStructClusters(db, structId)](#module_DB API_ zcl database access..selectStructClusters) ⇒
    • [~selectEnumClusters(db, enumId)](#module_DB API_ zcl database access..selectEnumClusters) ⇒
    • [~selectBitmapClusters(db, bitmapId)](#module_DB API_ zcl database access..selectBitmapClusters) ⇒
    • [~selectClusterStructsWithItems(db)](#module_DB API_ zcl database access..selectClusterStructsWithItems) ⇒
    • [~selectAllStructsWithItems(db)](#module_DB API_ zcl database access..selectAllStructsWithItems) ⇒
    • [~selectStructsWithItemsImpl(db, packageIds, clusterId)](#module_DB API_ zcl database access..selectStructsWithItemsImpl) ⇒
    • [~selectAllStructItemsById(db, id)](#module_DB API_ zcl database access..selectAllStructItemsById) ⇒
    • [~selectAllStructItemsByStructName(db, name, packageIds, clusterName)](#module_DB API_ zcl database access..selectAllStructItemsByStructName) ⇒
    • [~selectAllClusters(db)](#module_DB API_ zcl database access..selectAllClusters) ⇒
    • [~selectClusterByCode(db, packageId, clusterCode, mfgCode)](#module_DB API_ zcl database access..selectClusterByCode) ⇒
    • [~selectClusterById(db, clusterId, packageId)](#module_DB API_ zcl database access..selectClusterById) ⇒
    • [~selectAttributesByClusterIdIncludingGlobal(db, clusterId, packageIds)](#module_DB API_ zcl database access..selectAttributesByClusterIdIncludingGlobal) ⇒
    • [~selectAttributesByClusterIdAndSideIncludingGlobal(db, clusterId, packageIds, side)](#module_DB API_ zcl database access..selectAttributesByClusterIdAndSideIncludingGlobal) ⇒
    • [~selectAttributesByClusterCodeAndManufacturerCode(db, packageId, clusterCode, manufacturerCode)](#module_DB API_ zcl database access..selectAttributesByClusterCodeAndManufacturerCode) ⇒
    • [~selectAttributeById(db, id)](#module_DB API_ zcl database access..selectAttributeById) ⇒
    • [~selectAttributeByAttributeIdAndClusterRef(db, attributeId, clusterRef)](#module_DB API_ zcl database access..selectAttributeByAttributeIdAndClusterRef)
    • [~selectAllAttributes(db, packageIds)](#module_DB API_ zcl database access..selectAllAttributes) ⇒
    • [~selectAllAttributesBySide(db, side, packageId)](#module_DB API_ zcl database access..selectAllAttributesBySide) ⇒
    • [~selectEndpointTypeClustersByEndpointTypeId(db, endpointTypeId)](#module_DB API_ zcl database access..selectEndpointTypeClustersByEndpointTypeId) ⇒
    • [~selectEndpointTypeAttributesByEndpointId(db, endpointTypeId)](#module_DB API_ zcl database access..selectEndpointTypeAttributesByEndpointId) ⇒
    • [~selectEndpointTypeAttribute(db, endpointTypeId, attributeRef, clusterRef)](#module_DB API_ zcl database access..selectEndpointTypeAttribute) ⇒
    • [~selectEndpointTypeCommandsByEndpointId(db, endpointTypeId)](#module_DB API_ zcl database access..selectEndpointTypeCommandsByEndpointId) ⇒
    • [~selectEndpointTypeEventsByEndpointId(db, endpointTypeId)](#module_DB API_ zcl database access..selectEndpointTypeEventsByEndpointId) ⇒

DB API: zcl database access~clear()

Clears the entire cache.

Kind: inner method of [DB API: zcl database access](#module_DB 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](#module_DB API_ zcl database access)
Returns: Returns true on success.

Param Type
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](#module_DB API_ zcl database access)
Returns: cached object or undefined if none is present or expired.

Param Type
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](#module_DB API_ zcl database access)
Returns: true or false, depending on whether the cache is present.

Param Type
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](#module_DB API_ zcl database access)
Returns: true or false, depending on whether the cache is present.

Param Type
key *
packageId *

DB API: zcl database access~cacheStats()

Returns the cache statistics.

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

DB API: zcl database access~enable()

Enable the Database Query cache

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

DB API: zcl database access~disable()

Disable the database cache

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

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

Get all atomic data type information

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: atomic data types

Param Type
db *
packageId *

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](#module_DB API_ zcl database access)

Param Type
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](#module_DB API_ zcl database access)

Param Type
db *
packageId *

DB API: zcl database access~isTypeSignedByNameAndPackage(db, name, sessionPackages) ⇒ Promise.<boolean>

Checks if a type by a given name is signed.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise.<boolean> - - A promise that resolves to true if the type is signed, false otherwise.

Param Type Description
db object The database connection object.
name string The name of the type.
sessionPackages Array An array of session packages.

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

Retrieves all the bitmaps in the database.

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

Param Type
db *

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

Get bitmap by name from the given package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: promise of bitmap

Param Type
db *
packageIds *
name *

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](#module_DB API_ zcl database access)
Returns: bitmap information or undefined

Param Type
db *
name *
clusterId *
packageIds *

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

Select a bitmap matched by name and cluster name Note: Use selectBitmapByNameAndClusterId but this was needed for backwards compatibility.

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

Param Type
db *
name *
clusterName *
packageIds *

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

Get Bitmap information by Bitmap ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of bitmap

Param Type
db *
id *

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

Returns the cluster available to this session by the code.

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

Param Type
db *
sessionId *
code *
mfgCode *

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](#module_DB API_ zcl database access)
Returns: all the cluster objects for a given session.

Param Type
db *
sessionId *

DB API: zcl database access~selectSessionAttributeByCode(db, sessionId, clusterCode, side, attributeCode, mfgCode) ⇒

Returns the attribute available to this session by the code.

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

Param Type
db *
sessionId *
clusterCode *
side *
attributeCode *
mfgCode *

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

Returns the command available to this session by the code.

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

Param Type
db *
sessionId *
clusterCode *
commandCode *
source *

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

Get all structs from a given package ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of Structs

Param Type
db *
packageId *

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

Get struct details from the given struct ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of Struct

Param Type
db *
id *

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

Get Struct details from the given struct name and package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of Struct

Param Type
db *
name *
packageIds *

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](#module_DB API_ zcl database access)
Returns: struct information or undefined

Param Type
db *
name *
clusterId *
packageIds *

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

Select a struct matched by name and cluster name Note: Use selectStructByNameAndClusterId but this was needed for backwards compatibility.

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

Param Type
db *
name *
clusterName *
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](#module_DB API_ zcl database access)
Returns: structs which have an association with clusters

Param Type
db *
packageIds *
groupByStructName *

DB API: zcl database access~sqlQueryForDataTypeByNameAndClusterId(typeDiscriminator, clusterId, packageIds) ⇒

Formulate a sqlite query string for a data type from the given cluster ID and package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: SQLite query string

Param Type Default
typeDiscriminator *
clusterId *
packageIds *

DB API: zcl database access~sqlQueryForDataTypeByNameAndClusterName(typeDiscriminator, name, clusterName, packageIds, options) ⇒

Formulate a sqlite query string for a data type from the given cluster name and package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: SQLite query string

Param Type Description
typeDiscriminator *
name * data type name
clusterName *
packageIds *
options *

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](#module_DB API_ zcl database access)
Returns: cluster-related bitmaps

Param Type
db *
packageId *
clusterId *

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

Get bitmap fields from the given bitmap ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of bitmap fields

Param Type
db *
id *

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

Get all bitmap fields from the given package ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of bitmap fields

Param Type
db *
packageId *

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

Retrieves all the domains in the database.

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

Param Type
db *

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

Get Domain details from the given domain ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of domain

Param Type
db *
id *

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](#module_DB API_ zcl database access)
Returns: Promise that resolves with the rows of structs.

Param Type
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](#module_DB API_ zcl database access)
Returns: clusters

Param Type
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](#module_DB API_ zcl database access)
Returns: clusters

Param Type
db *
enumId *

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

Returns an array of clusters that bitmap belongs to.

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

Param Type
db *
bitmapId *

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](#module_DB API_ zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.

Param Type
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](#module_DB API_ zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.

Param Type
db *

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

Get Struct details along with its struct items.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: struct details

Param Type
db *
packageIds *
clusterId *

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

Get struct item details from the given struct item ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of Stuct Items

Param Type
db *
id *

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

Retrieves the struct items based on struct and cluster name. Note: By default clusterName is null.

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

Param Default
db
name
packageIds
clusterName

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

Retrieves all the clusters in the database.

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

Param Type
db *

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

Finds cluster by code.

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

Param Type Default Description
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](#module_DB API_ zcl database access)
Returns: promise that resolves into a cluster object

Param Type
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](#module_DB API_ zcl database access)
Returns: promise of a list of attributes, including global attributes

Param Type
db *
clusterId *
packageIds *

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

Get attribute details from the given information.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of attribute details

Param Type
db *
clusterId *
packageIds *
side *

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](#module_DB API_ zcl database access)
Returns: promise that resolves into attributes.

Param Type
db *
packageId *
clusterCode *
manufacturerCode *

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

Get attribute details from the given attribute ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of attribute

Param Type
db *
id *

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](#module_DB API_ zcl database access)

Param Type
db *
attributeId *
clusterRef *

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

Get all attributes from the given package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of attributes

Param Type
db *
packageIds *

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

Query for attributes by side.

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

Param Type
db *
side *
packageId *

DB API: zcl database access~selectEndpointTypeClustersByEndpointTypeId(db, endpointTypeId) ⇒

Get the endpoint type cluster details from the given endpoint type ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type clusters.

Param Type
db *
endpointTypeId *

DB API: zcl database access~selectEndpointTypeAttributesByEndpointId(db, endpointTypeId) ⇒

Get the endpoint type attribute details from the given endpoint type ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type attributes.

Param Type
db *
endpointTypeId *

DB API: zcl database access~selectEndpointTypeAttribute(db, endpointTypeId, attributeRef, clusterRef) ⇒

Get the endpoint type attribute details from the given details.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type attribute.

Param Type
db *
endpointTypeId *
attributeRef *
clusterRef *

DB API: zcl database access~selectEndpointTypeCommandsByEndpointId(db, endpointTypeId) ⇒

Get the endpoint type command details from the given endpoint type ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type commands

Param Type
db *
endpointTypeId *

DB API: zcl database access~selectEndpointTypeEventsByEndpointId(db, endpointTypeId) ⇒

Get endpoint type events from the given endpoint type ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type events

Param Type
db *
endpointTypeId *

DB API: zcl database access

This module provides queries for ZCL static queries.

  • [DB API: zcl database access](#module_DB API_ zcl database access)
    • [~clear()](#module_DB API_ zcl database access..clear)
    • [~put(key, packageId, data)](#module_DB API_ zcl database access..put) ⇒
    • [~get(key, packageId)](#module_DB API_ zcl database access..get) ⇒
    • [~isCached(key, packageId)](#module_DB API_ zcl database access..isCached) ⇒
    • [~cacheQuery(key, packageId)](#module_DB API_ zcl database access..cacheQuery) ⇒
    • [~cacheStats()](#module_DB API_ zcl database access..cacheStats)
    • [~enable()](#module_DB API_ zcl database access..enable)
    • [~disable()](#module_DB API_ zcl database access..disable)
    • [~selectAllAtomics(db, packageId)](#module_DB API_ zcl database access..selectAllAtomics) ⇒
    • [~selectAtomicType(db, packageId, typeName)](#module_DB API_ zcl database access..selectAtomicType)
    • [~selectAtomicById(db, packageId)](#module_DB API_ zcl database access..selectAtomicById)
    • [~isTypeSignedByNameAndPackage(db, name, sessionPackages)](#module_DB API_ zcl database access..isTypeSignedByNameAndPackage) ⇒ Promise.<boolean>
    • [~selectAllBitmaps(db)](#module_DB API_ zcl database access..selectAllBitmaps) ⇒
    • [~selectBitmapByName(db, packageIds, name)](#module_DB API_ zcl database access..selectBitmapByName) ⇒
    • [~selectBitmapByNameAndClusterId(db, name, clusterId, packageIds)](#module_DB API_ zcl database access..selectBitmapByNameAndClusterId) ⇒
    • [~selectBitmapByNameAndClusterName(db, name, clusterName, packageIds)](#module_DB API_ zcl database access..selectBitmapByNameAndClusterName) ⇒
    • [~selectBitmapById(db, id)](#module_DB API_ zcl database access..selectBitmapById) ⇒
    • [~selectSessionClusterByCode(db, sessionId, code, mfgCode)](#module_DB API_ zcl database access..selectSessionClusterByCode) ⇒
    • [~selectAllSessionClusters(db, sessionId)](#module_DB API_ zcl database access..selectAllSessionClusters) ⇒
    • [~selectSessionAttributeByCode(db, sessionId, clusterCode, side, attributeCode, mfgCode)](#module_DB API_ zcl database access..selectSessionAttributeByCode) ⇒
    • [~selectSessionCommandByCode(db, sessionId, clusterCode, commandCode, source)](#module_DB API_ zcl database access..selectSessionCommandByCode) ⇒
    • [~selectAllStructs(db, packageId)](#module_DB API_ zcl database access..selectAllStructs) ⇒
    • [~selectStructById(db, id)](#module_DB API_ zcl database access..selectStructById) ⇒
    • [~selectStructByName(db, name, packageIds)](#module_DB API_ zcl database access..selectStructByName) ⇒
    • [~selectStructByNameAndClusterId(db, name, clusterId, packageIds)](#module_DB API_ zcl database access..selectStructByNameAndClusterId) ⇒
    • [~selectStructByNameAndClusterName(db, name, clusterName, packageIds)](#module_DB API_ zcl database access..selectStructByNameAndClusterName) ⇒
    • [~selectStructsWithClusterAssociation(db, packageIds, groupByStructName)](#module_DB API_ zcl database access..selectStructsWithClusterAssociation) ⇒
    • [~sqlQueryForDataTypeByNameAndClusterId(typeDiscriminator, clusterId, packageIds)](#module_DB API_ zcl database access..sqlQueryForDataTypeByNameAndClusterId) ⇒
    • [~sqlQueryForDataTypeByNameAndClusterName(typeDiscriminator, name, clusterName, packageIds, options)](#module_DB API_ zcl database access..sqlQueryForDataTypeByNameAndClusterName) ⇒
    • [~selectClusterBitmaps(db, packageId, clusterId)](#module_DB API_ zcl database access..selectClusterBitmaps) ⇒
    • [~selectAllBitmapFieldsById(db, id)](#module_DB API_ zcl database access..selectAllBitmapFieldsById) ⇒
    • [~selectAllBitmapFields(db, packageId)](#module_DB API_ zcl database access..selectAllBitmapFields) ⇒
    • [~selectAllDomains(db)](#module_DB API_ zcl database access..selectAllDomains) ⇒
    • [~selectDomainById(db, id)](#module_DB API_ zcl database access..selectDomainById) ⇒
    • [~selectAllStructsWithItemCount(db, packageIds)](#module_DB API_ zcl database access..selectAllStructsWithItemCount) ⇒
    • [~selectStructClusters(db, structId)](#module_DB API_ zcl database access..selectStructClusters) ⇒
    • [~selectEnumClusters(db, enumId)](#module_DB API_ zcl database access..selectEnumClusters) ⇒
    • [~selectBitmapClusters(db, bitmapId)](#module_DB API_ zcl database access..selectBitmapClusters) ⇒
    • [~selectClusterStructsWithItems(db)](#module_DB API_ zcl database access..selectClusterStructsWithItems) ⇒
    • [~selectAllStructsWithItems(db)](#module_DB API_ zcl database access..selectAllStructsWithItems) ⇒
    • [~selectStructsWithItemsImpl(db, packageIds, clusterId)](#module_DB API_ zcl database access..selectStructsWithItemsImpl) ⇒
    • [~selectAllStructItemsById(db, id)](#module_DB API_ zcl database access..selectAllStructItemsById) ⇒
    • [~selectAllStructItemsByStructName(db, name, packageIds, clusterName)](#module_DB API_ zcl database access..selectAllStructItemsByStructName) ⇒
    • [~selectAllClusters(db)](#module_DB API_ zcl database access..selectAllClusters) ⇒
    • [~selectClusterByCode(db, packageId, clusterCode, mfgCode)](#module_DB API_ zcl database access..selectClusterByCode) ⇒
    • [~selectClusterById(db, clusterId, packageId)](#module_DB API_ zcl database access..selectClusterById) ⇒
    • [~selectAttributesByClusterIdIncludingGlobal(db, clusterId, packageIds)](#module_DB API_ zcl database access..selectAttributesByClusterIdIncludingGlobal) ⇒
    • [~selectAttributesByClusterIdAndSideIncludingGlobal(db, clusterId, packageIds, side)](#module_DB API_ zcl database access..selectAttributesByClusterIdAndSideIncludingGlobal) ⇒
    • [~selectAttributesByClusterCodeAndManufacturerCode(db, packageId, clusterCode, manufacturerCode)](#module_DB API_ zcl database access..selectAttributesByClusterCodeAndManufacturerCode) ⇒
    • [~selectAttributeById(db, id)](#module_DB API_ zcl database access..selectAttributeById) ⇒
    • [~selectAttributeByAttributeIdAndClusterRef(db, attributeId, clusterRef)](#module_DB API_ zcl database access..selectAttributeByAttributeIdAndClusterRef)
    • [~selectAllAttributes(db, packageIds)](#module_DB API_ zcl database access..selectAllAttributes) ⇒
    • [~selectAllAttributesBySide(db, side, packageId)](#module_DB API_ zcl database access..selectAllAttributesBySide) ⇒
    • [~selectEndpointTypeClustersByEndpointTypeId(db, endpointTypeId)](#module_DB API_ zcl database access..selectEndpointTypeClustersByEndpointTypeId) ⇒
    • [~selectEndpointTypeAttributesByEndpointId(db, endpointTypeId)](#module_DB API_ zcl database access..selectEndpointTypeAttributesByEndpointId) ⇒
    • [~selectEndpointTypeAttribute(db, endpointTypeId, attributeRef, clusterRef)](#module_DB API_ zcl database access..selectEndpointTypeAttribute) ⇒
    • [~selectEndpointTypeCommandsByEndpointId(db, endpointTypeId)](#module_DB API_ zcl database access..selectEndpointTypeCommandsByEndpointId) ⇒
    • [~selectEndpointTypeEventsByEndpointId(db, endpointTypeId)](#module_DB API_ zcl database access..selectEndpointTypeEventsByEndpointId) ⇒

DB API: zcl database access~clear()

Clears the entire cache.

Kind: inner method of [DB API: zcl database access](#module_DB 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](#module_DB API_ zcl database access)
Returns: Returns true on success.

Param Type
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](#module_DB API_ zcl database access)
Returns: cached object or undefined if none is present or expired.

Param Type
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](#module_DB API_ zcl database access)
Returns: true or false, depending on whether the cache is present.

Param Type
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](#module_DB API_ zcl database access)
Returns: true or false, depending on whether the cache is present.

Param Type
key *
packageId *

DB API: zcl database access~cacheStats()

Returns the cache statistics.

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

DB API: zcl database access~enable()

Enable the Database Query cache

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

DB API: zcl database access~disable()

Disable the database cache

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

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

Get all atomic data type information

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: atomic data types

Param Type
db *
packageId *

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](#module_DB API_ zcl database access)

Param Type
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](#module_DB API_ zcl database access)

Param Type
db *
packageId *

DB API: zcl database access~isTypeSignedByNameAndPackage(db, name, sessionPackages) ⇒ Promise.<boolean>

Checks if a type by a given name is signed.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise.<boolean> - - A promise that resolves to true if the type is signed, false otherwise.

Param Type Description
db object The database connection object.
name string The name of the type.
sessionPackages Array An array of session packages.

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

Retrieves all the bitmaps in the database.

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

Param Type
db *

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

Get bitmap by name from the given package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: promise of bitmap

Param Type
db *
packageIds *
name *

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](#module_DB API_ zcl database access)
Returns: bitmap information or undefined

Param Type
db *
name *
clusterId *
packageIds *

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

Select a bitmap matched by name and cluster name Note: Use selectBitmapByNameAndClusterId but this was needed for backwards compatibility.

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

Param Type
db *
name *
clusterName *
packageIds *

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

Get Bitmap information by Bitmap ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of bitmap

Param Type
db *
id *

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

Returns the cluster available to this session by the code.

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

Param Type
db *
sessionId *
code *
mfgCode *

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](#module_DB API_ zcl database access)
Returns: all the cluster objects for a given session.

Param Type
db *
sessionId *

DB API: zcl database access~selectSessionAttributeByCode(db, sessionId, clusterCode, side, attributeCode, mfgCode) ⇒

Returns the attribute available to this session by the code.

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

Param Type
db *
sessionId *
clusterCode *
side *
attributeCode *
mfgCode *

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

Returns the command available to this session by the code.

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

Param Type
db *
sessionId *
clusterCode *
commandCode *
source *

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

Get all structs from a given package ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of Structs

Param Type
db *
packageId *

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

Get struct details from the given struct ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of Struct

Param Type
db *
id *

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

Get Struct details from the given struct name and package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of Struct

Param Type
db *
name *
packageIds *

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](#module_DB API_ zcl database access)
Returns: struct information or undefined

Param Type
db *
name *
clusterId *
packageIds *

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

Select a struct matched by name and cluster name Note: Use selectStructByNameAndClusterId but this was needed for backwards compatibility.

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

Param Type
db *
name *
clusterName *
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](#module_DB API_ zcl database access)
Returns: structs which have an association with clusters

Param Type
db *
packageIds *
groupByStructName *

DB API: zcl database access~sqlQueryForDataTypeByNameAndClusterId(typeDiscriminator, clusterId, packageIds) ⇒

Formulate a sqlite query string for a data type from the given cluster ID and package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: SQLite query string

Param Type Default
typeDiscriminator *
clusterId *
packageIds *

DB API: zcl database access~sqlQueryForDataTypeByNameAndClusterName(typeDiscriminator, name, clusterName, packageIds, options) ⇒

Formulate a sqlite query string for a data type from the given cluster name and package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: SQLite query string

Param Type Description
typeDiscriminator *
name * data type name
clusterName *
packageIds *
options *

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](#module_DB API_ zcl database access)
Returns: cluster-related bitmaps

Param Type
db *
packageId *
clusterId *

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

Get bitmap fields from the given bitmap ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of bitmap fields

Param Type
db *
id *

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

Get all bitmap fields from the given package ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of bitmap fields

Param Type
db *
packageId *

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

Retrieves all the domains in the database.

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

Param Type
db *

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

Get Domain details from the given domain ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of domain

Param Type
db *
id *

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](#module_DB API_ zcl database access)
Returns: Promise that resolves with the rows of structs.

Param Type
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](#module_DB API_ zcl database access)
Returns: clusters

Param Type
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](#module_DB API_ zcl database access)
Returns: clusters

Param Type
db *
enumId *

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

Returns an array of clusters that bitmap belongs to.

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

Param Type
db *
bitmapId *

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](#module_DB API_ zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.

Param Type
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](#module_DB API_ zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.

Param Type
db *

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

Get Struct details along with its struct items.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: struct details

Param Type
db *
packageIds *
clusterId *

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

Get struct item details from the given struct item ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of Stuct Items

Param Type
db *
id *

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

Retrieves the struct items based on struct and cluster name. Note: By default clusterName is null.

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

Param Default
db
name
packageIds
clusterName

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

Retrieves all the clusters in the database.

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

Param Type
db *

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

Finds cluster by code.

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

Param Type Default Description
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](#module_DB API_ zcl database access)
Returns: promise that resolves into a cluster object

Param Type
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](#module_DB API_ zcl database access)
Returns: promise of a list of attributes, including global attributes

Param Type
db *
clusterId *
packageIds *

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

Get attribute details from the given information.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of attribute details

Param Type
db *
clusterId *
packageIds *
side *

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](#module_DB API_ zcl database access)
Returns: promise that resolves into attributes.

Param Type
db *
packageId *
clusterCode *
manufacturerCode *

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

Get attribute details from the given attribute ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of attribute

Param Type
db *
id *

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](#module_DB API_ zcl database access)

Param Type
db *
attributeId *
clusterRef *

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

Get all attributes from the given package IDs.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of attributes

Param Type
db *
packageIds *

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

Query for attributes by side.

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

Param Type
db *
side *
packageId *

DB API: zcl database access~selectEndpointTypeClustersByEndpointTypeId(db, endpointTypeId) ⇒

Get the endpoint type cluster details from the given endpoint type ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type clusters.

Param Type
db *
endpointTypeId *

DB API: zcl database access~selectEndpointTypeAttributesByEndpointId(db, endpointTypeId) ⇒

Get the endpoint type attribute details from the given endpoint type ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type attributes.

Param Type
db *
endpointTypeId *

DB API: zcl database access~selectEndpointTypeAttribute(db, endpointTypeId, attributeRef, clusterRef) ⇒

Get the endpoint type attribute details from the given details.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type attribute.

Param Type
db *
endpointTypeId *
attributeRef *
clusterRef *

DB API: zcl database access~selectEndpointTypeCommandsByEndpointId(db, endpointTypeId) ⇒

Get the endpoint type command details from the given endpoint type ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type commands

Param Type
db *
endpointTypeId *

DB API: zcl database access~selectEndpointTypeEventsByEndpointId(db, endpointTypeId) ⇒

Get endpoint type events from the given endpoint type ID.

Kind: inner method of [DB API: zcl database access](#module_DB API_ zcl database access)
Returns: Promise of endpoint type events

Param Type
db *
endpointTypeId *

JS API: generator logic

  • [JS API: generator logic](#module_JS API_ generator logic)
    • [~findAndReadJsonFiles(obj, basePath)](#module_JS API_ generator logic..findAndReadJsonFiles) ⇒ Promise.<string>
    • [~loadGenTemplateFromFile(templatePath)](#module_JS API_ generator logic..loadGenTemplateFromFile) ⇒
    • [~recordPackageIfNonexistent(db, packagePath, parentId, packageType, version, category, description)](#module_JS API_ generator logic..recordPackageIfNonexistent) ⇒
    • [~loadTemplateOptionsFromJsonFile(db, packageId, category, externalPath)](#module_JS API_ generator logic..loadTemplateOptionsFromJsonFile) ⇒
    • [~recordTemplatesPackage(context, isTopLevelPackageInSync)](#module_JS API_ generator logic..recordTemplatesPackage) ⇒
    • [~decodePackageExtensionEntity(entityType, entity)](#module_JS API_ generator logic..decodePackageExtensionEntity) ⇒
    • [~loadZclExtensions(zclExt)](#module_JS API_ generator logic..loadZclExtensions) ⇒
    • [~loadTemplates(db, genTemplatesJsonArray)](#module_JS API_ generator logic..loadTemplates)
    • [~loadGenTemplatesJsonFile(db, genTemplatesJson)](#module_JS API_ generator logic..loadGenTemplatesJsonFile) ⇒
    • [~retrievePackageMetaInfo(db, genTemplatesPkgId)](#module_JS API_ generator logic..retrievePackageMetaInfo) ⇒
    • [~generateAllTemplates(genResult, genTemplateJsonPkg, generateOnly)](#module_JS API_ generator logic..generateAllTemplates) ⇒
    • [~generateSingleTemplate(genResult, singleTemplatePkg)](#module_JS API_ generator logic..generateSingleTemplate) ⇒
    • [~generate(db, sessionId, templatePackageId, templateGeneratorOptions, options)](#module_JS API_ generator logic..generate) ⇒
    • [~writeFileWithBackup(fileName, content, doBackup)](#module_JS API_ generator logic..writeFileWithBackup) ⇒
    • [~generateGenerationContent(genResult)](#module_JS API_ generator logic..generateGenerationContent)
    • [~generateAndWriteFiles(db, sessionId, packageId, outputDirectory)](#module_JS API_ generator logic..generateAndWriteFiles) ⇒
    • [~createGenerationLog(logFile, genData)](#module_JS API_ generator logic..createGenerationLog)
    • [~postProcessGeneratedFiles(outputDirectory, genResult)](#module_JS API_ generator logic..postProcessGeneratedFiles) ⇒
    • [~contentIndexer(content)](#module_JS API_ generator logic..contentIndexer)
    • [~generateSingleFileForPreview(db, sessionId, fileName)](#module_JS API_ generator logic..generateSingleFileForPreview) ⇒
    • [~produceCompiledTemplate(singleTemplatePkg)](#module_JS API_ generator logic..produceCompiledTemplate) ⇒
    • [~produceIterativeContent(hb, metaInfo, db, sessionId, singleTemplatePkg, genTemplateJsonPackage, options)](#module_JS API_ generator logic..produceIterativeContent) ⇒
    • [~produceContent(hb, metaInfo, db, sessionId, singlePkg, overridePath:)](#module_JS API_ generator logic..produceContent) ⇒
    • [~wrapOverridable(originalFn, overrideFn)](#module_JS API_ generator logic..wrapOverridable) ⇒
    • [~loadOverridable(path)](#module_JS API_ generator logic..loadOverridable)
    • [~loadPartial(hb, name, data)](#module_JS API_ generator logic..loadPartial)
    • [~helperWrapper(wrappedHelper)](#module_JS API_ generator logic..helperWrapper) ⇒
    • [~loadHelper(hb, helpers, context)](#module_JS API_ generator logic..loadHelper)
    • [~allBuiltInHelpers()](#module_JS API_ generator logic..allBuiltInHelpers) ⇒
    • [~findHelperPackageByAlias(alias)](#module_JS API_ generator logic..findHelperPackageByAlias) ⇒
    • [~initializeBuiltInHelpersForPackage()](#module_JS API_ generator logic..initializeBuiltInHelpersForPackage)
    • [~hbInstance()](#module_JS API_ generator logic..hbInstance) ⇒
    • [~makeSynchronizablePromise(promise)](#module_JS API_ generator logic..makeSynchronizablePromise)
    • [~collectBlocks(resultArray, options, context)](#module_JS API_ generator logic..collectBlocks) ⇒
    • [~ensureZclPackageId(context)](#module_JS API_ generator logic..ensureZclPackageId) ⇒
    • [~ensureZclPackageIds(context)](#module_JS API_ generator logic..ensureZclPackageIds) ⇒
    • [~ensureTemplatePackageCategory(context)](#module_JS API_ generator logic..ensureTemplatePackageCategory) ⇒
    • [~ensureTemplatePackageId(context)](#module_JS API_ generator logic..ensureTemplatePackageId) ⇒
    • [~ensureEndpointTypeIds(context)](#module_JS API_ generator logic..ensureEndpointTypeIds) ⇒
    • [~ensureZclClusterSdkExtensions(context, templatePackageId)](#module_JS API_ generator logic..ensureZclClusterSdkExtensions) ⇒
    • [~ensureZclDeviceTypeSdkExtensions(context, templatePackageId)](#module_JS API_ generator logic..ensureZclDeviceTypeSdkExtensions) ⇒
    • [~ensureZclAttributeSdkExtensions(context, templatePackageId)](#module_JS API_ generator logic..ensureZclAttributeSdkExtensions) ⇒
    • [~ensureZclAttributeTypeSdkExtensions(context, templatePackageId)](#module_JS API_ generator logic..ensureZclAttributeTypeSdkExtensions) ⇒
    • [~ensureZclCommandSdkExtensions(context, templatePackageId)](#module_JS API_ generator logic..ensureZclCommandSdkExtensions) ⇒
    • [~ensureZclEventSdkExtensions(context, templatePackageId)](#module_JS API_ generator logic..ensureZclEventSdkExtensions) ⇒
    • [~templatePromise(global, promise)](#module_JS API_ generator logic..templatePromise)
    • [~deprecatedHelper(fn, explanation)](#module_JS API_ generator logic..deprecatedHelper) ⇒

JS API: generator logic~findAndReadJsonFiles(obj, basePath) ⇒ Promise.<string>

Finds and reads JSON files referenced in a nested object.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: Promise.<string> - - A promise that resolves to the concatenated content of all JSON files.

Param Type Description
obj Object The object to search for JSON file references.
basePath string The base directory to resolve relative paths.

JS API: generator logic~loadGenTemplateFromFile(templatePath) ⇒

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

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

Param Type
templatePath *

JS API: generator logic~recordPackageIfNonexistent(db, packagePath, parentId, packageType, version, category, description) ⇒

Inserts the package details when they do not exist.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: Promise of package insertion

Param Type
db *
packagePath *
parentId *
packageType *
version *
category *
description *

JS API: generator logic~loadTemplateOptionsFromJsonFile(db, packageId, category, externalPath) ⇒

Insert the template options from the json meta data file.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: Promise of inserted template options

Param Type
db *
packageId *
category *
externalPath *

JS API: generator logic~recordTemplatesPackage(context, isTopLevelPackageInSync) ⇒

Given a loading context and whether the package is in sync, 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](#module_JS API_ generator logic)
Returns: promise that resolves with the same context passed in, except packageId added to it

Param Type
context *
isTopLevelPackageInSync *

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](#module_JS API_ generator logic)
Returns: object that can be used for database injection

Param Type
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](#module_JS API_ generator logic)
Returns: Promise of loading the zcl extensions.

Param Type
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](#module_JS API_ generator logic)

Param Type
db *
genTemplatesJsonArray *

JS API: generator logic~loadGenTemplatesJsonFile(db, genTemplatesJson) ⇒

Main API async function to load templates from a gen-template.json file.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: the loading context, contains: db, path, crc, packageId and templateData, or error

Param Type Description
db * Database
genTemplatesJson * Path to the JSON file or an array of paths to JSON file

JS API: generator logic~retrievePackageMetaInfo(db, genTemplatesPkgId) ⇒

Get the package information from the given package ID.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: package information

Param Type
db *
genTemplatesPkgId *

JS API: generator logic~generateAllTemplates(genResult, genTemplateJsonPkg, generateOnly) ⇒

Generates all the templates inside a toplevel package.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: Promise that resolves with genResult, that contains all the generated templates, keyed by their 'output'

Param Type Description
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](#module_JS API_ generator logic)
Returns: promise that resolves with the genResult, with newly generated content added.

Param Type Description
genResult *
singleTemplatePkg * Single template package.

JS API: generator logic~generate(db, sessionId, templatePackageId, templateGeneratorOptions, options) ⇒

Main API async function to generate stuff.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: Promise that resolves into a generation result.Promise that resolves into a generation result.

Param Type Description
db * Database
sessionId *
templatePackageId * packageId Template package id. It can be either single template or gen template json.
templateGeneratorOptions *
options *

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](#module_JS API_ generator logic)
Returns: promise of a written file.

Param Type
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](#module_JS API_ generator logic)

Param Type
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](#module_JS API_ generator logic)
Returns: a promise which will resolve when all the files are written.

Param Type
db *
sessionId *
packageId *
outputDirectory *

JS API: generator logic~createGenerationLog(logFile, genData)

Create a generation log.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)

Param Type
logFile *
genData *

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](#module_JS API_ generator logic)
Returns: promise of a dealt-with post processing actions

Param Type
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](#module_JS API_ generator logic)

Param Type Description
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](#module_JS API_ generator logic)
Returns: promise that resolves into a preview object.

Param Type
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](#module_JS API_ generator logic)
Returns: templates

Param Type
singleTemplatePkg *

JS API: generator logic~produceIterativeContent(hb, metaInfo, db, sessionId, singleTemplatePkg, genTemplateJsonPackage, options) ⇒

This function is reached if the template is an "iterative one", meaning it has the iterator set to one of the valid options.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: Promise that resolves into an array of key/content/stats objects.

Param Type
hb *
metaInfo *
db *
sessionId *
singleTemplatePkg *
genTemplateJsonPackage *
options *

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](#module_JS API_ generator logic)
Returns: Promise that resolves into an array of key/content/stats objects.

Param Type Description
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](#module_JS API_ generator logic)
Returns: result from override function, unless it throws an exception, in which case return result from original function.

Param Type
originalFn *
overrideFn *

JS API: generator logic~loadOverridable(path)

This function is responsible to load the overridable function container.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)

Param Type Description
path * of the override file

JS API: generator logic~loadPartial(hb, name, data)

Function that loads the partials.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)

Param Type
hb *
name *
data *

JS API: generator logic~helperWrapper(wrappedHelper) ⇒

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: function

Param Type
wrappedHelper *

JS API: generator logic~loadHelper(hb, helpers, context)

Function that loads the helpers.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)

Param Type Default Description
hb *
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.
context *

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](#module_JS 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](#module_JS API_ generator logic)
Returns: Helper package or undefined if none was found.

Param Type
alias *

JS API: generator logic~initializeBuiltInHelpersForPackage()

Global helper initialization

Kind: inner method of [JS API: generator logic](#module_JS 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](#module_JS 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](#module_JS API_ generator logic)

Param Type
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](#module_JS API_ generator logic)
Returns: Promise that resolves with a content string.

Param Type Description
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](#module_JS API_ generator logic)
Returns: promise that resolves with the package id.

Param Type
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](#module_JS API_ generator logic)
Returns: promise that resolves with a list of package id.

Param Type
context *

JS API: generator logic~ensureTemplatePackageCategory(context) ⇒

Returns a package category of the toplevel template package from context.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: proimise that resolves into a package category

Param Type
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](#module_JS API_ generator logic)
Returns: promise that resolves with the package id.

Param Type
context *

JS API: generator logic~ensureEndpointTypeIds(context) ⇒

Populate the endpoint type ids into the global context.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: endpoint type ids

Param Type
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](#module_JS API_ generator logic)
Returns: promise that resolves with cluster extensions.

Param Type
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](#module_JS API_ generator logic)
Returns: promise that resolves with cluster extensions.

Param Type
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](#module_JS API_ generator logic)
Returns: promise that resolves with attribute extensions.

Param Type
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](#module_JS API_ generator logic)
Returns: promise that resolves with attribute type extensions.

Param Type
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](#module_JS API_ generator logic)
Returns: promise that resolves with command extensions.

Param Type
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](#module_JS API_ generator logic)
Returns: promise that resolves with command extensions.

Param Type
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](#module_JS API_ generator logic)

Param Type
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](#module_JS API_ generator logic)
Returns: a function that wraps the original function, with deprecation message.

Param Type Description
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](#module_Templating API_ Access helpers)
    • [~collectDefaultAccessList(ctx, entityType)](#module_Templating API_ Access helpers..collectDefaultAccessList) ⇒
    • [~collectAccesslist(ctx, options)](#module_Templating API_ Access helpers..collectAccesslist) ⇒
    • [~access_aggregate(options)](#module_Templating API_ Access helpers..access_aggregate)
    • [~access(options)](#module_Templating API_ Access helpers..access)
    • [~default_access(options)](#module_Templating API_ Access helpers..default_access) ⇒

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

Collects the default access list

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

Param Type
ctx *
entityType *

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

Get Access List based on on given options.

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

Param Type
ctx *
options *

Templating API: Access helpers~access_aggregate(options)

This helper creates a context for the aggregates of access.

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

Param Type
options *

Templating API: Access helpers~access(options)

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

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

Param Type
options *

Templating API: Access helpers~default_access(options) ⇒

Get the access list information.

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

Param Type
options *

Templating API: Attribute helpers

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

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

Templating API: Attribute helpers~featureBits(options) ⇒

Get feature bits from the given context.

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

Param Type
options *

Templating API: Attribute helpers~attributeDefault() ⇒

Valid within a cluster context, requires code.

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

Templating API: Attribute helpers~as_underlying_atomic_identifier_for_attribute_id(attributeId)

Given an attribute Id determine its corresponding atomic identifier from the atomic table.

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

Param Type
attributeId *

Templating API: C formatting helpers

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

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

Templating API: C formatting helpers~asOffset(hex)

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

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

Param Type
hex *

Templating API: C formatting helpers~asDelimitedMacro(label)

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

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

Param Type
label *

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

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

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

Param Type
label *

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

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

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

Param Type
dataType *
context *
packageIds *

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

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

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

Param Type
value *

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

Formats label as a C type.

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

Param Type
label *

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

Formats label as a C symbol.

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

Param Type
label *

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

Formats the default value into an attribute of a given length

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

Param Type
value *
length *

Templating API: C formatting helpers~asBytes(value)

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

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

Param Type
value *

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

Given a string convert it into a camelCased string

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

Param Type
str *

Templating API: C formatting helpers~cleanseLabel(label)

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

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

Param Type
label *

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

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

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

Param Type
str *

Templating API: C formatting helpers~cleanseLabelAsKebabCase(label)

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

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

Param Type
label *

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

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

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

Param Type
str *

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

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

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

Param Type
str *

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

Returns the cli type representation.

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

Param
size
isSigned

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

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

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

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

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

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

Param Type
db *
bitmap_name *
packageIds *

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

Returns the type of enum

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

Param Type
db *
enum_name *
packageIds *

Templating API: C formatting helpers~addOne(number)

Returns the number by adding 1 to it.

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

Param Type
number *

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

Return true if number1 is greater than number2

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

Param
num1
num2

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

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

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

Param Type
options *

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

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

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

Param Type
options *

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

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

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

Param Type
options *

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

Get extension values for the given information.

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

Param Type
context *
prop *
entityType *

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

If helper for command extensions(true condition).

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

Param Type
options *

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

If helper for command extensions(false condition).

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

Param Type
options *

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

If helper for cluster extensions(true condition).

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

Param Type
options *

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

If helper for cluster extensions(false condition).

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

Param Type
options *

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

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

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

Param Type
options *

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

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

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

Param Type
options *

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

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

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

Param Type
options *

Templating API: Command helpers

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

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

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

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

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

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

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

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

Param
commandId
options

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

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

Param
commandArg
trueReturn
falseReturn

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

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

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

Param
commandArg
options

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

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

Param
command
commandArg
trueReturn
falseReturn

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

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

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

Param
command
commandArg
options

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

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

Param
commandArg
trueReturn
falseReturn

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

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

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

Param
commandArg
options

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

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

Param
commandArg
trueReturn
falseReturn

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

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

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

Param
commandArg
options

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

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

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

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

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

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

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

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

Templating API: Matter endpoint config helpers

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

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

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

Returns number of endpoint types.

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

Param Type
options *

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

Returns number of endpoints.

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

Param Type
options *

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

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

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

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

Creates array of endpointId fields on endpoints

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

Param Type
options *

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

Creates array of profileId fields on endpoints

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

Param Type
options *

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

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

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

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

Creates array of networkId fields on endpoints

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

Param Type
options *

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

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

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

Param Type
options *

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

Get indexes and manufacturer code.

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

Param Type
codeIndexPairs *

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

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

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

Param Type
options *

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

Get count of attributes with manufacturer code.

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

Param Type
options *

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

Get all command manufacturer codes.

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

Param Type
options *

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

Get count of commands with manufacturer code.

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

Param Type
options *

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

Get all cluster manufacturer codes.

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

Param Type
options *

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

Get count of clusters with manufacturer code.

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

Param Type
options *

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

Get size of largest attribute.

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

Param Type
options *

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

Get cumulative size of all singleton endpoint type attributes.

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

Param Type
options *

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

Get cumulative size of all endpoint type attributes.

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

Param Type
options *

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

Get count of endpoint type commands.

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

Param Type
options *

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

Get endpoint type information.

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

Param Type
options *

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

Get count of endpoint type clusters.

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

Param Type
options *

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

Get endpoint type cluster information.

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

Param Type
options *

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

Get endpoint type command information.

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

Param Type
options *

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

Get count of endpoint type attributes.

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

Param Type
options *

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

Get endpoint type attribute information.

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

Param Type
options *

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

Extracting device versions and identifiers from endpoint types

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

Param Type
context *
options *

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

Get all device types in the configuration.

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

Param Type
options *

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

Get device type offset per endpoint.

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

Param Type
options *

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

Get count of device types per endpoint.

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

Param Type
options *

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

Get count of total attributes with min max values listed.

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

Param Type
options *

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

Get all attributes with min max values defined.

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

Param Type
options *

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

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

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

Param Type
options *

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

Get count of total attributes with reporting enabled

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

Param Type
options *

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

Get long(size>2 bytes) attribute count.

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

Param Type
options *

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

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

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

Param Type
options *

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

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

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

Param Type
manufacturerCode *
code *

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

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

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

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

Templating API: Matter endpoint config helpers~collectAttributes()

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

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

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

This function goes over all the attributes and populates sizes.

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

Param Type
db *
zclPackageIds *
endpointTypes *

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

This function goes over all attributes and populates atomic types.

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

Param Type
db *
zclPackageIds *
endpointTypes *

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

Checks if global attribute is excluded from the meta data.

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

Param Type
attr *

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

Starts the endpoint configuration block., longDefaults: longDefaults

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

Param Type
options *

Templating API: Future helpers

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

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

Templating API: Future helpers~ifFuture(options)

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

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

Param Type
options *

Templating API: Future helpers~setFuture(options)

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

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

Param Type
options *

Templating API: Future helpers~future(options)

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

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

Param Type
options *

Templating API: SDK extension helpers

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

Templating API: C formatting helpers

This module contains the API for accessing SDK extensions.

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

Templating API: C formatting helpers~asOffset(hex)

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

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

Param Type
hex *

Templating API: C formatting helpers~asDelimitedMacro(label)

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

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

Param Type
label *

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

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

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

Param Type
label *

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

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

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

Param Type
dataType *
context *
packageIds *

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

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

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

Param Type
value *

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

Formats label as a C type.

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

Param Type
label *

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

Formats label as a C symbol.

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

Param Type
label *

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

Formats the default value into an attribute of a given length

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

Param Type
value *
length *

Templating API: C formatting helpers~asBytes(value)

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

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

Param Type
value *

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

Given a string convert it into a camelCased string

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

Param Type
str *

Templating API: C formatting helpers~cleanseLabel(label)

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

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

Param Type
label *

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

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

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

Param Type
str *

Templating API: C formatting helpers~cleanseLabelAsKebabCase(label)

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

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

Param Type
label *

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

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

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

Param Type
str *

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

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

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

Param Type
str *

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

Returns the cli type representation.

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

Param
size
isSigned

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

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

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

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

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

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

Param Type
db *
bitmap_name *
packageIds *

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

Returns the type of enum

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

Param Type
db *
enum_name *
packageIds *

Templating API: C formatting helpers~addOne(number)

Returns the number by adding 1 to it.

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

Param Type
number *

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

Return true if number1 is greater than number2

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

Param
num1
num2

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

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

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

Param Type
options *

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

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

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

Param Type
options *

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

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

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

Param Type
options *

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

Get extension values for the given information.

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

Param Type
context *
prop *
entityType *

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

If helper for command extensions(true condition).

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

Param Type
options *

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

If helper for command extensions(false condition).

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

Param Type
options *

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

If helper for cluster extensions(true condition).

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

Param Type
options *

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

If helper for cluster extensions(false condition).

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

Param Type
options *

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

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

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

Param Type
options *

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

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

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

Param Type
options *

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

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

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

Param Type
options *

Templating API: user-data specific helpers

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

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

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

Creates block iterator over the endpoints.

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

Param Type
options *

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

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

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

Param Type
options *

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

Creates block iterator helper over the endpoint types.

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

Param Type
options *

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

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

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

Param Type
options *

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

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

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

Param Type
options *

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

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

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

Param Type
options *

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

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

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

Param Type
options *

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

Get count of total endpoint types.

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

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

Retrieve the number of endpoints which possess the specified cluster type

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

Param Type
clusterTypeId *

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

Iterates over all attributes required by the user configuration.

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

Param Type
options *

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

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

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

Param Type
options *

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

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

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

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

Get attribute details based on given arguments.

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

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

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

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

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

Param
options

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

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

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

Param
options

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

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

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

Param
options

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

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

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

Param
options

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

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

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

Param Type
options *

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

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

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

Param
options

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

Creates cluster iterator for all endpoints.

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

Param Type
options *

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

Creates cluster command iterator for all endpoints.

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

Param Type
options *

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

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

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

Param Type
options *

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

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

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

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

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

param options Returns: all commands with cli for a cluster

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

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

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

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

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

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

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

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

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

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

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

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

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

Param
options

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

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

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

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

Param
name
side
options

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

Helper that resolves into a user session key value.

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

Param Type
options *

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

If helper that checks if command discovery is enabled

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

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

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

Get Session's manufacturer code.

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

Param Type
options *

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

Get user's default response policy selected.

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

Param Type
options *

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

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

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

Param Type
command *
options *

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

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

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

Param Type
command *
options *

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

Get endpoint identifier from the given endpoint type ID.

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

Param Type
endpointTypeId *

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

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

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

Param Type
endpointTypeId *

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

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

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

Param
name
side
options

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

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

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

Param
options

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

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

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

Param
options

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

All available cluster commands across all endpoints and clusters.

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

Param
options

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

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

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

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

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

All clusters with side that have available incoming commands

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

Param
options

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

All clusters with side that have available outgoing commands

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

Param
options

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

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

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

Param
clusterCode
options

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

All clusters that have available incoming commands. If there is a client and server enabled on the endpoint, this combines them into a single entry.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: All clusters that have available incoming commands across all endpoints.

Param
options

Templating API: user-data specific helpers~all_incoming_commands_for_cluster_combined(clusterName, clientSide, serverSide, options) ⇒

All commands that need to be parsed for a given cluster. This takes in booleans for if the client and or server are included.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: all commands that need to be parsed for a given cluster

Param
clusterName
clientSide
serverSide
options

Templating API: user-data specific helpers~all_user_incoming_commands_for_all_clusters(options) ⇒

Get all incoming commands in the user configuration.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: all incoming commands enabled by the user.

Param Type
options *

Templating API: user-data specific helpers~all_incoming_or_outgoing_commands_for_cluster(clusterName, clusterSide, isIncoming, options) ⇒

A util function for all incoming or outgoing commands that need to be parsed for a given cluster

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: All incoming or outgoing commands that need to be parsed for a given cluster

Param
clusterName
clusterSide
isIncoming
options

Templating API: user-data specific helpers~all_incoming_commands_for_cluster(clusterName, options) ⇒

All incoming commands that need to be parsed for a given cluster

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: all incoming commands that need to be parsed for a given cluster

Param
clusterName
options

Templating API: user-data specific helpers~all_outgoing_commands_for_cluster(clusterName, options) ⇒

All outgoing commands that need to be parsed for a given cluster

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: all outgoing commands that need to be parsed for a given cluster

Param
clusterName
options

Templating API: user-data specific helpers~generated_clustes_details(options) ⇒

Entails the Cluster details per endpoint

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: Cluster Details per endpoint with attribute summaries within the clusters

Param Type
options *

Templating API: user-data specific helpers~generated_endpoint_type_details(options) ⇒

Entails Endpoint type details along with their cluster summaries

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: Endpoint type details along with their cluster summaries

Param
options

Templating API: user-data specific helpers~all_user_cluster_attributes_min_max_defaults(name, side, options) ⇒

Returns attributes inside an endpoint type that either have a default or a bounded attribute.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: endpoints with bounds or defaults

Param
name
side
options

Templating API: user-data specific helpers~checkAttributeMatch(clusterName, attributeName, attributeSide, attributeValue, attributeValueType, endpointAttributes) ⇒

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: arrayIndex

Param
clusterName
attributeName
attributeSide
attributeValue
attributeValueType
endpointAttributes

Templating API: user-data specific helpers~generated_defaults_index(clusterName, attributeName, attributeValueType, attributeValue, prefixReturn, postFixReturn) ⇒

Extracts the index of generated defaults array which come from all_user_cluster_attributes_for_generated_defaults

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: index of the generated default array

Param
clusterName
attributeName
attributeValueType
attributeValue
prefixReturn
postFixReturn

Templating API: user-data specific helpers~generated_default_index(clusterName, attributeName, attributeSide, attributeValueType, attributeValue, prefixReturn, postFixReturn) ⇒

Extracts the index of generated defaults array which come from all_user_cluster_attributes_for_generated_defaults

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: deafult value's index in the generated default array

Param
clusterName
attributeName
attributeSide
attributeValueType
attributeValue
prefixReturn
postFixReturn

Templating API: user-data specific helpers~generated_attributes_min_max_index(name, side, options) ⇒

Extracts the index of generated min max defaults array which come from all_user_cluster_attributes_min_max_defaults

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: index of the generated min max default array

Param
name
side
options

Templating API: user-data specific helpers~generated_attribute_min_max_index(clusterName, attributeName, attributeSide, options) ⇒

Extracts the index of generated min max defaults array which come from all_user_cluster_attributes_min_max_defaults

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: index of the generated min max default in the array

Param
clusterName
attributeName
attributeSide
options

Templating API: user-data specific helpers~if_enabled_clusters(options) ⇒

If helper that checks if there are clusters enabled Available options:

  • side: side="client/server" can be used to check if there are client or server side clusters are available

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: Promise of content.

Param Type
options *

Templating API: user-data specific helpers~if_multi_protocol_attributes_enabled(options) ⇒

Check if multi-protocol is enabled for the application.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: boolean based on existence of attribute-attribute associations.

Param Type
options *

Templating API: user-data specific helpers~all_multi_protocol_attributes(options) ⇒

Retrieve all the attribute-attribute associations for the current session.

Kind: inner method of [Templating API: user-data specific helpers](#module_Templating API_ user-data specific helpers)
Returns: attribute-attribute mapping entries

Param Type
options *

Templating API: Token helpers

This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}

  • [Templating API: Token helpers](#module_Templating API_ Token helpers)
    • [~token_cluster_create(config)](#module_Templating API_ Token helpers..token_cluster_create) ⇒
    • [~tokens_context()](#module_Templating API_ Token helpers..tokens_context)
    • [~token_next()](#module_Templating API_ Token helpers..token_next)
    • [~debug_object(obj)](#module_Templating API_ Token helpers..debug_object) ⇒
    • [~token_attribute_util(context, options)](#module_Templating API_ Token helpers..token_attribute_util) ⇒
    • [~token_attributes(endpointTypeRef, options)](#module_Templating API_ Token helpers..token_attributes) ⇒
    • [~token_attribute_clusters(endpointTypeRef, options)](#module_Templating API_ Token helpers..token_attribute_clusters) ⇒
    • [~token_attribute_endpoints(options)](#module_Templating API_ Token helpers..token_attribute_endpoints) ⇒

Templating API: Token helpers~token_cluster_create(config) ⇒

Get a transformed config object.

Kind: inner method of [Templating API: Token helpers](#module_Templating API_ Token helpers)
Returns: object

Param Type
config *

Templating API: Token helpers~tokens_context()

This function builds creates a new context from the endpoint_config structure for use in the zap-tokens.h template. The endpoint_config context provides a list of endpoints, and endpointTypes, where each endpointType contains a list of clusters, and each cluster contains a list of attributes. However, the tokens template requires a list of attributes per endpoint, and per cluster, discriminating from singletons and non-singletons, so this function performs the required grouping.

While each attribute contains an isSingleton attribute, the database schema allows for the same attribute to be returned both as singleton and non-singleton in different clusters, for different endpoints. In consequence, care must be taken to remove the singletons from the cluster and endpoint attribute lists. This is done in two steps, the first loop creates a global (context) list of singletons and non-singletons, and the second loop removes the singletons from the endpoint, and clusters.

Clusters from different endpoints may have different attributes, therefore each endpoint keeps a separate list of clusters. Additionally, a context-level map of clusters is required in order to gather all attributes (singletons and non-singletons) from all endpoint clusters.

Kind: inner method of [Templating API: Token helpers](#module_Templating API_ Token helpers)

Templating API: Token helpers~token_next()

The token template assigns an unique ID to each unique attribute. These IDs span all attributes from all clusters from all endpointTypes. This helper function allows the template to increment the token ID within the tokens context.

Kind: inner method of [Templating API: Token helpers](#module_Templating API_ Token helpers)

Templating API: Token helpers~debug_object(obj) ⇒

Get JSON stringified value of the obj.

Kind: inner method of [Templating API: Token helpers](#module_Templating API_ Token helpers)
Returns: JSON string

Param Type
obj *

Templating API: Token helpers~token_attribute_util(context, options) ⇒

Util function that extracts all the token attribute information.

Kind: inner method of [Templating API: Token helpers](#module_Templating API_ Token helpers)
Returns: Information on all token attributes in the configuration.

Param Type
context *
options *

Templating API: Token helpers~token_attributes(endpointTypeRef, options) ⇒

Get information about all the token attributes in the configuration or this helper can be used within an endpoint block helper to fetch the corresponding token attributes based on endpoint type given. Available Options: isSingleton: 0/1, option can be used to filter attributes based on singleton or non-singleton(Available with endpointTypeRef only)

Kind: inner method of [Templating API: Token helpers](#module_Templating API_ Token helpers)
Returns: singleton and non-singleton token attributes along with their endpoint information. Singleton attributes are only returned once whereas non-singleton attributes are returned per endpoint. However if used within an endpoint block helper it returns token_attributes for a given endpoint type.

Param Type
endpointTypeRef *
options *

Templating API: Token helpers~token_attribute_clusters(endpointTypeRef, options) ⇒

This helper can return all token associated clusters across endpoints or this helper can be used within an endpoint block helper to fetch the corresponding token associated clusters. Available Options: isSingleton: 0/1, option can be used to filter clusters based on singleton or non-singleton attributes.

Kind: inner method of [Templating API: Token helpers](#module_Templating API_ Token helpers)
Returns: Token associated clusters for a particular endpoint type or all token associated clusters across endpoints.

Param Type
endpointTypeRef *
options *

Templating API: Token helpers~token_attribute_endpoints(options) ⇒

Get all endpoints which have token attributes in the configuration. AvailableOptions:

  • isSingleton: 0/1, option can be used to filter endpoints based on singleton or non-singleton.

Kind: inner method of [Templating API: Token helpers](#module_Templating API_ Token helpers)
Returns: all endpoints with token attributes

Param Type
options *

Templating API: toplevel utility helpers

This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}

  • [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
    • [~zap_header()](#module_Templating API_ toplevel utility helpers..zap_header) ⇒
    • [~ident()](#module_Templating API_ toplevel utility helpers..ident) ⇒
    • [~new_line(cnt)](#module_Templating API_ toplevel utility helpers..new_line) ⇒
    • [~backslash()](#module_Templating API_ toplevel utility helpers..backslash) ⇒
    • [~template_options(category, options)](#module_Templating API_ toplevel utility helpers..template_options)
    • [~first(options)](#module_Templating API_ toplevel utility helpers..first) ⇒
    • [~not_first(options)](#module_Templating API_ toplevel utility helpers..not_first) ⇒
    • [~last(options)](#module_Templating API_ toplevel utility helpers..last) ⇒
    • [~not_last(optionms)](#module_Templating API_ toplevel utility helpers..not_last) ⇒
    • [~middle(options)](#module_Templating API_ toplevel utility helpers..middle) ⇒
    • [~template_option_with_code(options, key)](#module_Templating API_ toplevel utility helpers..template_option_with_code)
    • [~fail(options)](#module_Templating API_ toplevel utility helpers..fail)
    • [~isEqual(string_a, string_b)](#module_Templating API_ toplevel utility helpers..isEqual)
    • [~is_lowercase_equal(string_a, string_b)](#module_Templating API_ toplevel utility helpers..is_lowercase_equal)
    • [~toggle(condition, trueResult, falseResult)](#module_Templating API_ toplevel utility helpers..toggle) ⇒
    • [~trim_string(str)](#module_Templating API_ toplevel utility helpers..trim_string) ⇒
    • [~asLastWord(str)](#module_Templating API_ toplevel utility helpers..asLastWord)
    • [~iterate()](#module_Templating API_ toplevel utility helpers..iterate)
    • [~addToAccumulator(accumulator, value)](#module_Templating API_ toplevel utility helpers..addToAccumulator)
    • [~iterateAccumulator(options)](#module_Templating API_ toplevel utility helpers..iterateAccumulator) ⇒
    • [~waitForSynchronousPromise(pollInterval, promise, resolve, reject)](#module_Templating API_ toplevel utility helpers..waitForSynchronousPromise)
    • [~promiseToResolveAllPreviousPromises(globalPromises)](#module_Templating API_ toplevel utility helpers..promiseToResolveAllPreviousPromises)
    • [~after(options)](#module_Templating API_ toplevel utility helpers..after) ⇒
    • [~concatenate()](#module_Templating API_ toplevel utility helpers..concatenate)
    • [~is_num_equal(numA, numB)](#module_Templating API_ toplevel utility helpers..is_num_equal) ⇒
    • [~is_defined(value)](#module_Templating API_ toplevel utility helpers..is_defined) ⇒
    • [~replace_string(mainString, replaceString, replaceWithString)](#module_Templating API_ toplevel utility helpers..replace_string) ⇒
    • [~add_prefix_to_all_strings(str, prefixStr)](#module_Templating API_ toplevel utility helpers..add_prefix_to_all_strings) ⇒
    • [~multiply()](#module_Templating API_ toplevel utility helpers..multiply) ⇒
    • [~is_power_of_two(val)](#module_Templating API_ toplevel utility helpers..is_power_of_two) ⇒
    • [~is_string_underscored(val)](#module_Templating API_ toplevel utility helpers..is_string_underscored) ⇒
    • [~as_uppercase(val)](#module_Templating API_ toplevel utility helpers..as_uppercase) ⇒

Templating API: toplevel utility helpers~zap_header() ⇒

Produces the top-of-the-file header for a C file.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: The header content

Templating API: toplevel utility helpers~ident() ⇒

Simple helper that produces an approved size of identation.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: whitespace that is the identation.

Templating API: toplevel utility helpers~new_line(cnt) ⇒

Return new lines based on the given cnt parameter.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: new line

Param Type
cnt *

Templating API: toplevel utility helpers~backslash() ⇒

return back slash

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: string

Templating API: toplevel utility helpers~template_options(category, options)

Block helper that iterates over the package options of a given category.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)

Param Type
category *
options *

Templating API: toplevel utility helpers~first(options) ⇒

Inside an iterator, this helper allows you to specify the content that will be output only during the first element.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: content, if it's the first element inside an operator, empty otherwise.

Param Type
options *

Templating API: toplevel utility helpers~not_first(options) ⇒

Inside an iterator, this helper allows you to specify the content that will be output only if the element is not the first element.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: content, if it's the first element inside an operator, empty otherwise.

Param Type
options *

Templating API: toplevel utility helpers~last(options) ⇒

Inside an iterator, this helper allows you to specify the content that will be output only during the last element.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: content, if it's the last element inside an operator, empty otherwise.

Param Type
options *

Templating API: toplevel utility helpers~not_last(optionms) ⇒

Inside an iterator. the block is output only if this is NOT the last item. Useful for wrapping commas in the list of arguments and such.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: content, if it's not the last element inside a block, empty otherwise.

Param Type
optionms *

Templating API: toplevel utility helpers~middle(options) ⇒

Inside an iterator, this helper allows you to specify the content that will be output only during the non-first and no-last element.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: content, if it's the middle element inside an operator, empty otherwise.

Param Type
options *

Templating API: toplevel utility helpers~template_option_with_code(options, key)

This fetches a promise which returns template options if provided

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)

Param Type
options *
key *

Templating API: toplevel utility helpers~fail(options)

Forced fail halper.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)

Param Type
options *

Templating API: toplevel utility helpers~isEqual(string_a, string_b)

This returns a boolean if the 2 strings are same

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)

Param Type
string_a *
string_b *

Templating API: toplevel utility helpers~is_lowercase_equal(string_a, string_b)

This returns a boolean based on the 2 strings being equal or not given that both

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)

Param Type
string_a *
string_b *

Templating API: toplevel utility helpers~toggle(condition, trueResult, falseResult) ⇒

Return true/false result based on condition.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: boolean

Param Type
condition *
trueResult *
falseResult *

Templating API: toplevel utility helpers~trim_string(str) ⇒

Remove leading and trailing spaces from a string

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: A string with no leading and trailing spaces

Param Type
str *

Templating API: toplevel utility helpers~asLastWord(str)

Split the string based on spaces and return the last word

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)

Param Type
str *

Templating API: toplevel utility helpers~iterate()

Iteration block.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)

Templating API: toplevel utility helpers~addToAccumulator(accumulator, value)

Add to accumulator results.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)

Param Type
accumulator *
value *

Templating API: toplevel utility helpers~iterateAccumulator(options) ⇒

Get accumulated information from templates.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: accumulated details

Param Type
options *

Templating API: toplevel utility helpers~waitForSynchronousPromise(pollInterval, promise, resolve, reject)

Waits for promise to be resolved synchronously.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)

Param Type
pollInterval *
promise *
resolve *
reject *

Templating API: toplevel utility helpers~promiseToResolveAllPreviousPromises(globalPromises)

Resolves all the given globalPromises promises.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)

Param Type
globalPromises *

Templating API: toplevel utility helpers~after(options) ⇒

Resolve the after promise after all other promises in the global context have been resolved.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: Content after all other content has been resolved.

Param Type
options *

Templating API: toplevel utility helpers~concatenate()

Given: A list of strings Returns a concatenated string with spaces between each string

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)

Templating API: toplevel utility helpers~is_num_equal(numA, numB) ⇒

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: true if both numbers are equal else returns false

Param
numA
numB

Templating API: toplevel utility helpers~is_defined(value) ⇒

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: true or false based on whether the value is undefined or not

Param
value

Templating API: toplevel utility helpers~replace_string(mainString, replaceString, replaceWithString) ⇒

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: A string replaced with another string in the mainString

Param
mainString
replaceString
replaceWithString

Templating API: toplevel utility helpers~add_prefix_to_all_strings(str, prefixStr) ⇒

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: A resultant string with all string values prefixed with prefixStr

Param
str
prefixStr

Templating API: toplevel utility helpers~multiply() ⇒

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: A number which is result of multiplying all the arguments given

Templating API: toplevel utility helpers~is_power_of_two(val) ⇒

Returns a boolean based on whether a given value is a power or 2 or not.

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: boolean

Param Type
val *

Templating API: toplevel utility helpers~is_string_underscored(val) ⇒

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: true if a string has an underscore in it

Param Type
val *

Templating API: toplevel utility helpers~as_uppercase(val) ⇒

Kind: inner method of [Templating API: toplevel utility helpers](#module_Templating API_ toplevel utility helpers)
Returns: val in uppercase

Param Type
val *

Templating API: static zcl helpers

This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}

  • [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
    • [~zcl_bitmaps(options)](#module_Templating API_ static zcl helpers..zcl_bitmaps) ⇒
    • [~zcl_bitmap_items(options)](#module_Templating API_ static zcl helpers..zcl_bitmap_items)
    • [~zcl_enums(options)](#module_Templating API_ static zcl helpers..zcl_enums) ⇒
    • [~zcl_structs(options)](#module_Templating API_ static zcl helpers..zcl_structs) ⇒
    • [~zcl_enum_items(options)](#module_Templating API_ static zcl helpers..zcl_enum_items)
    • [~first_unused_enum_value(options)](#module_Templating API_ static zcl helpers..first_unused_enum_value) ⇒
    • [~zcl_struct_items(options)](#module_Templating API_ static zcl helpers..zcl_struct_items) ⇒
    • [~zcl_struct_items_by_struct_name(name, options)](#module_Templating API_ static zcl helpers..zcl_struct_items_by_struct_name) ⇒
    • [~zcl_struct_items_by_struct_and_cluster_name(name, clusterName, options)](#module_Templating API_ static zcl helpers..zcl_struct_items_by_struct_and_cluster_name) ⇒
    • [~zcl_device_types(options)](#module_Templating API_ static zcl helpers..zcl_device_types) ⇒
    • [~zcl_device_type_clusters(options)](#module_Templating API_ static zcl helpers..zcl_device_type_clusters) ⇒
    • [~zcl_device_type_cluster_commands(options)](#module_Templating API_ static zcl helpers..zcl_device_type_cluster_commands) ⇒
    • [~zcl_device_type_cluster_attributes(options)](#module_Templating API_ static zcl helpers..zcl_device_type_cluster_attributes) ⇒
    • [~zcl_clusters(options)](#module_Templating API_ static zcl helpers..zcl_clusters) ⇒
    • [~zcl_commands(options)](#module_Templating API_ static zcl helpers..zcl_commands) ⇒
    • [~zcl_command_responses(options)](#module_Templating API_ static zcl helpers..zcl_command_responses) ⇒
    • [~zcl_commands_with_cluster_info(options)](#module_Templating API_ static zcl helpers..zcl_commands_with_cluster_info) ⇒
    • [~zcl_commands_with_arguments(options)](#module_Templating API_ static zcl helpers..zcl_commands_with_arguments)
    • [~zcl_commands_source_client(options)](#module_Templating API_ static zcl helpers..zcl_commands_source_client) ⇒
    • [~zcl_commands_source_server(options)](#module_Templating API_ static zcl helpers..zcl_commands_source_server) ⇒
    • [~zcl_events(options)](#module_Templating API_ static zcl helpers..zcl_events) ⇒
    • [~zcl_command_tree(options)](#module_Templating API_ static zcl helpers..zcl_command_tree) ⇒
    • [~zcl_global_commands(options)](#module_Templating API_ static zcl helpers..zcl_global_commands) ⇒
    • [~zcl_attributes(options)](#module_Templating API_ static zcl helpers..zcl_attributes) ⇒
    • [~zcl_attributes_client(options)](#module_Templating API_ static zcl helpers..zcl_attributes_client) ⇒
    • [~zcl_attributes_server(options)](#module_Templating API_ static zcl helpers..zcl_attributes_server) ⇒
    • [~zcl_atomics(options)](#module_Templating API_ static zcl helpers..zcl_atomics) ⇒
    • [~zcl_cluster_largest_label_length()](#module_Templating API_ static zcl helpers..zcl_cluster_largest_label_length) ⇒
    • [~largestLabelLength(An)](#module_Templating API_ static zcl helpers..largestLabelLength) ⇒
    • [~zcl_command_arguments_count(commandId)](#module_Templating API_ static zcl helpers..zcl_command_arguments_count) ⇒
    • [~ifCommandArgumentsHaveFixedLengthWithCurrentContext(commandId, fixedLengthReturn, notFixedLengthReturn, currentContext)](#module_Templating API_ static zcl helpers..ifCommandArgumentsHaveFixedLengthWithCurrentContext)
    • [~if_command_arguments_have_fixed_length(commandId, fixedLengthReturn, notFixedLengthReturn)](#module_Templating API_ static zcl helpers..if_command_arguments_have_fixed_length)
    • [~as_underlying_zcl_type_command_is_not_fixed_length_but_command_argument_is_always_present(type, command, commandArg, appendString, options)](#module_Templating API_ static zcl helpers..as_underlying_zcl_type_command_is_not_fixed_length_but_command_argument_is_always_present) ⇒
    • [~as_underlying_zcl_type_if_command_is_not_fixed_length(type, commandId, appendString, options)](#module_Templating API_ static zcl helpers..as_underlying_zcl_type_if_command_is_not_fixed_length)
    • [~command_arguments_total_length(commandId)](#module_Templating API_ static zcl helpers..command_arguments_total_length)
    • [~zcl_command_arguments(options)](#module_Templating API_ static zcl helpers..zcl_command_arguments) ⇒
    • [~zcl_event_fields(options)](#module_Templating API_ static zcl helpers..zcl_event_fields)
    • [~zcl_command_argument_data_type(typeName, options)](#module_Templating API_ static zcl helpers..zcl_command_argument_data_type)
    • [~asUnderlyingZclType(typeName, options)](#module_Templating API_ static zcl helpers..asUnderlyingZclType)
    • [~zcl_string_type_return(type, options)](#module_Templating API_ static zcl helpers..zcl_string_type_return)
    • [~is_zcl_string(type)](#module_Templating API_ static zcl helpers..is_zcl_string)
    • [~if_is_number(type)](#module_Templating API_ static zcl helpers..if_is_number) ⇒
    • [~if_is_string(type)](#module_Templating API_ static zcl helpers..if_is_string) ⇒
    • [~if_is_char_string(type)](#module_Templating API_ static zcl helpers..if_is_char_string) ⇒
    • [~if_is_octet_string(type)](#module_Templating API_ static zcl helpers..if_is_octet_string) ⇒
    • [~if_is_short_string(type)](#module_Templating API_ static zcl helpers..if_is_short_string) ⇒
    • [~if_is_long_string(type)](#module_Templating API_ static zcl helpers..if_is_long_string) ⇒
    • [~if_is_atomic(type:)](#module_Templating API_ static zcl helpers..if_is_atomic) ⇒
    • [~if_is_bitmap(type)](#module_Templating API_ static zcl helpers..if_is_bitmap) ⇒
    • [~if_is_enum(type)](#module_Templating API_ static zcl helpers..if_is_enum) ⇒
    • [~if_is_struct(type)](#module_Templating API_ static zcl helpers..if_is_struct) ⇒
    • [~isClient(side)](#module_Templating API_ static zcl helpers..isClient) ⇒
    • [~isServer(side)](#module_Templating API_ static zcl helpers..isServer) ⇒
    • [~isStrEqual(str1, str2)](#module_Templating API_ static zcl helpers..isStrEqual) ⇒
    • [~isLastElement(index, count)](#module_Templating API_ static zcl helpers..isLastElement) ⇒
    • [~isFirstElement(index, count)](#module_Templating API_ static zcl helpers..isFirstElement) ⇒
    • [~isEnabled(enable)](#module_Templating API_ static zcl helpers..isEnabled) ⇒
    • [~isCommandAvailable(clusterSide, incoming, outgoing, source, name)](#module_Templating API_ static zcl helpers..isCommandAvailable) ⇒
    • [~as_underlying_zcl_type_command_argument_always_present(type:, commandId:, appendString:, introducedInRef:, removedInRef:, presentIf:, options:)](#module_Templating API_ static zcl helpers..as_underlying_zcl_type_command_argument_always_present) ⇒
    • [~if_command_argument_always_present(commandId, introducedInRef, removedInRef, presentIf, argumentPresentReturn, argumentNotPresentReturn)](#module_Templating API_ static zcl helpers..if_command_argument_always_present) ⇒
    • [~as_underlying_zcl_type_command_argument_not_always_present_no_presentif(type:, commandId:, appendString:, introducedInRef:, removedInRef:, presentIf:, options:)](#module_Templating API_ static zcl helpers..as_underlying_zcl_type_command_argument_not_always_present_no_presentif) ⇒
    • [~as_underlying_zcl_type_ca_not_always_present_no_presentif(commandArg, appendString, options)](#module_Templating API_ static zcl helpers..as_underlying_zcl_type_ca_not_always_present_no_presentif) ⇒
    • [~if_command_argument_not_always_present_no_presentif(commandId, introducedInRef, removedInRef, presentIf, argumentNotInAllVersionsReturn, argumentInAllVersionsReturn)](#module_Templating API_ static zcl helpers..if_command_argument_not_always_present_no_presentif) ⇒
    • [~as_underlying_zcl_type_command_argument_not_always_present_with_presentif(type:, commandId:, appendString:, introducedInRef:, removedInRef:, presentIf:, options:)](#module_Templating API_ static zcl helpers..as_underlying_zcl_type_command_argument_not_always_present_with_presentif) ⇒
    • [~as_underlying_zcl_type_ca_not_always_present_with_presentif(commandArg, appendString, options)](#module_Templating API_ static zcl helpers..as_underlying_zcl_type_ca_not_always_present_with_presentif) ⇒
    • [~if_command_argument_not_always_present_with_presentif(commandId, introducedInRef, removedInRef, presentIf, argumentNotInAllVersionsPresentIfReturn, argumentInAllVersionsReturn)](#module_Templating API_ static zcl helpers..if_command_argument_not_always_present_with_presentif) ⇒
    • [~as_underlying_zcl_type_command_argument_always_present_with_presentif(type:, commandId:, appendString:, introducedInRef:, removedInRef:, presentIf:, options:)](#module_Templating API_ static zcl helpers..as_underlying_zcl_type_command_argument_always_present_with_presentif) ⇒
    • [~as_underlying_zcl_type_ca_always_present_with_presentif(commandArg, appendString, options)](#module_Templating API_ static zcl helpers..as_underlying_zcl_type_ca_always_present_with_presentif) ⇒
    • [~if_command_argument_always_present_with_presentif(commandId, introducedInRef, removedInRef, presentIf, argumentNotInAllVersionsPresentIfReturn, argumentInAllVersionsReturn)](#module_Templating API_ static zcl helpers..if_command_argument_always_present_with_presentif) ⇒
    • [~if_manufacturing_specific_cluster(clusterId, manufacturer_specific_return, null_manufacturer_specific_return)](#module_Templating API_ static zcl helpers..if_manufacturing_specific_cluster) ⇒
    • [~if_mfg_specific_cluster(clusterId, options)](#module_Templating API_ static zcl helpers..if_mfg_specific_cluster) ⇒
    • [~as_generated_default_macro(value, attributeSize, options)](#module_Templating API_ static zcl helpers..as_generated_default_macro) ⇒
    • [~attribute_mask(writable, storageOption, minMax, mfgSpecific, clusterCode, client, isSingleton, prefixString, postfixString)](#module_Templating API_ static zcl helpers..attribute_mask) ⇒
    • [~command_mask(commmandSource, clusterSide, isIncomingEnabled, isOutgoingEnabled, manufacturingCode, prefixForMask)](#module_Templating API_ static zcl helpers..command_mask) ⇒
    • [~command_mask_sub_helper(commandMask, str)](#module_Templating API_ static zcl helpers..command_mask_sub_helper) ⇒
    • [~format_zcl_string_as_characters_for_generated_defaults(stringVal, sizeOfString)](#module_Templating API_ static zcl helpers..format_zcl_string_as_characters_for_generated_defaults) ⇒
    • [~as_type_min_value(type, options)](#module_Templating API_ static zcl helpers..as_type_min_value) ⇒
    • [~as_type_max_value(type, options)](#module_Templating API_ static zcl helpers..as_type_max_value) ⇒
    • [~structs_with_clusters(options)](#module_Templating API_ static zcl helpers..structs_with_clusters)
    • [~as_zcl_type_size(type, options)](#module_Templating API_ static zcl helpers..as_zcl_type_size) ⇒
    • [~if_compare(leftValue, rightValue, options)](#module_Templating API_ static zcl helpers..if_compare) ⇒ Object
    • [~if_is_data_type_signed(type, clusterId, options)](#module_Templating API_ static zcl helpers..if_is_data_type_signed) ⇒
    • [~as_zcl_data_type_size(type, clusterId, options)](#module_Templating API_ static zcl helpers..as_zcl_data_type_size) ⇒

Templating API: static zcl helpers~zcl_bitmaps(options) ⇒

Block helper iterating over all bitmaps.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
options *

Templating API: static zcl helpers~zcl_bitmap_items(options)

Iterates over enum items. Valid only inside zcl_enums.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)

Param Type
options *

Templating API: static zcl helpers~zcl_enums(options) ⇒

Block helper iterating over all enums. If existing independently, it iterates over ALL the enums. Within a context of a cluster, it iterates only over the enums belonging to a cluster.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
options *

Templating API: static zcl helpers~zcl_structs(options) ⇒

Block helper iterating over all structs. If existing independently, it iterates over ALL the structs. Within a context of a cluster, it iterates only over the structs belonging to a cluster.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
options *

Templating API: static zcl helpers~zcl_enum_items(options)

Iterates over enum items. Valid only inside zcl_enums.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)

Param Type
options *

Templating API: static zcl helpers~first_unused_enum_value(options) ⇒

This helper prints out the first unused enum value. It supports mode="next_larger" and mode="first_unused" (which is the default).

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: the unused enum value

Param Type
options *

Templating API: static zcl helpers~zcl_struct_items(options) ⇒

Block helper iterating over all struct items. Valid only inside zcl_structs.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
options *

Templating API: static zcl helpers~zcl_struct_items_by_struct_name(name, options) ⇒

Block helper iterating over all struct items given the struct name.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param
name
options

Templating API: static zcl helpers~zcl_struct_items_by_struct_and_cluster_name(name, clusterName, options) ⇒

Block helper iterating over all struct items given the struct name and cluster name. The items iterated will be those that correspond to that struct name being used within the given cluster. That means the struct name must be either a global struct (in which case the cluster name is just ignored), or a struct associated with the given cluster.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param
name
clusterName
options

Templating API: static zcl helpers~zcl_device_types(options) ⇒

Block helper iterating over all deviceTypes.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
options *

Templating API: static zcl helpers~zcl_device_type_clusters(options) ⇒

Block helper for use inside zcl_device_types

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: blocks for clusters

Param Type
options *

Templating API: static zcl helpers~zcl_device_type_cluster_commands(options) ⇒

Block helper for use inside zcl_device_type_clusters

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: blocks for commands

Param Type
options *

Templating API: static zcl helpers~zcl_device_type_cluster_attributes(options) ⇒

Block helper for use inside zcl_device_type_clusters

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: blocks for attributes

Param Type
options *

Templating API: static zcl helpers~zcl_clusters(options) ⇒

Block helper iterating over all clusters.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
options *

Templating API: static zcl helpers~zcl_commands(options) ⇒

Block helper iterating over all commands. There are two modes of this helper: when used in a global context, it iterates over ALL commands in the database. when used inside a zcl_cluster block helper, it iterates only over the commands for that cluster.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
options *

Templating API: static zcl helpers~zcl_command_responses(options) ⇒

Returns all commands which are command responses. For eg, If the xml has the following: then newCmdResponse will be included in the list of commands returned here.

There are two modes of this helper:

  • when used in a global context, it iterates over ALL command responses in the database.
  • when used inside a zcl_cluster block helper, it iterates only over the commands responses for that cluster.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: all command responses

Param Type
options *

Templating API: static zcl helpers~zcl_commands_with_cluster_info(options) ⇒

Block helper iterating over all commands with cluster information. Note: Similar to zcl_commands but has cluster information as well.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
options *

Templating API: static zcl helpers~zcl_commands_with_arguments(options)

Helper that retrieves all commands that contain arguments.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)

Param Type
options *

Templating API: static zcl helpers~zcl_commands_source_client(options) ⇒

Block helper iterating over all client commands. There are two modes of this helper: when used in a global context, it iterates over ALL client commands in the database. when used inside a zcl_cluster block helper, it iterates only over the commands for that client cluster.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
options *

Templating API: static zcl helpers~zcl_commands_source_server(options) ⇒

Block helper iterating over all server commands. There are two modes of this helper: when used in a global context, it iterates over ALL server commands in the database. when used inside a zcl_cluster block helper, it iterates only over the commands for that server cluster.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
options *

Templating API: static zcl helpers~zcl_events(options) ⇒

Block helper iterating over all events. There are two modes of this helper: when used in a global context, it iterates over ALL events in the database. when used inside a zcl_cluster block helper, it iterates only over the events for that cluster.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
options *

Templating API: static zcl helpers~zcl_command_tree(options) ⇒

Block helper iterating over all commands, including their arguments and clusters.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
options *

Templating API: static zcl helpers~zcl_global_commands(options) ⇒

Helper to iterate over all global commands.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of global command iteration.

Param Type
options *

Templating API: static zcl helpers~zcl_attributes(options) ⇒

Iterator over the attributes. If it is used at toplevel, if iterates over all the attributes in the database. If used within zcl_cluster context, it iterates over all the attributes that belong to that cluster.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of attribute iteration.

Param Type
options *

Templating API: static zcl helpers~zcl_attributes_client(options) ⇒

Iterator over the client attributes. If it is used at toplevel, if iterates over all the client attributes in the database. If used within zcl_cluster context, it iterates over all the client attributes that belong to that cluster.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of attribute iteration.

Param Type
options *

Templating API: static zcl helpers~zcl_attributes_server(options) ⇒

Iterator over the server attributes. If it is used at toplevel, if iterates over all the server attributes in the database. If used within zcl_cluster context, it iterates over all the server attributes that belong to that cluster. Available Options:

  • removeKeys: Removes one or more keys from the map(for eg keys in db-mapping.js) for eg: (#zcl_attributes_server removeKeys='isOptional, isNullable') will remove 'isOptional' from the results

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of attribute iteration.

Param Type
options *

Templating API: static zcl helpers~zcl_atomics(options) ⇒

Block helper iterating over all atomic types.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
options *

Templating API: static zcl helpers~zcl_cluster_largest_label_length() ⇒

Given: N/A

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: the length of largest cluster name in a list of clusters

Templating API: static zcl helpers~largestLabelLength(An) ⇒

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: the length of largest object name in an array. Helper for zcl_cluster_largest_label_length

Param Type Description
An * Array

Templating API: static zcl helpers~zcl_command_arguments_count(commandId) ⇒

Helper to extract the number of command arguments in a command

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Number of command arguments as an integer

Param Type
commandId *

Templating API: static zcl helpers~ifCommandArgumentsHaveFixedLengthWithCurrentContext(commandId, fixedLengthReturn, notFixedLengthReturn, currentContext)

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)

Param Description
commandId
fixedLengthReturn
notFixedLengthReturn
currentContext Returns fixedLengthReturn or notFixedLengthReturn based on whether the command is fixed length or not

Templating API: static zcl helpers~if_command_arguments_have_fixed_length(commandId, fixedLengthReturn, notFixedLengthReturn)

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)

Param Description
commandId
fixedLengthReturn
notFixedLengthReturn Returns fixedLengthReturn or notFixedLengthReturn based on whether the command is fixed length or not. Does not check if command arguments are always present or not.

Templating API: static zcl helpers~as_underlying_zcl_type_command_is_not_fixed_length_but_command_argument_is_always_present(type, command, commandArg, appendString, options) ⇒

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: the underlying zcl type of a command argument if the argument is not fixed length but is always present. If the condition is not met then returns an empty string.

Param
type
command
commandArg
appendString
options

Templating API: static zcl helpers~as_underlying_zcl_type_if_command_is_not_fixed_length(type, commandId, appendString, options)

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)

Param Description
type
commandId
appendString
options Returns: Given the commandId and the type of one of its arguments, based on whether the command is fixed length or not either return nothing or return the underlying zcl type appended with the appendString.

Templating API: static zcl helpers~command_arguments_total_length(commandId)

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)

Param Description
commandId Returns the size of the command by calculating the sum total of the command arguments Note: This helper should be called on fixed length commands only. It should not be called with commands which do not have a fixed length.

Templating API: static zcl helpers~zcl_command_arguments(options) ⇒

Block helper iterating over command arguments within a command or a command tree.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of command argument iteration.

Param Type
options *

Templating API: static zcl helpers~zcl_event_fields(options)

Block helper iterating over the event fields inside an event.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)

Param Type
options *

Templating API: static zcl helpers~zcl_command_argument_data_type(typeName, options)

Helper that deals with the type of the argument.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)

Param Type
typeName *
options *

Templating API: static zcl helpers~asUnderlyingZclType(typeName, options)

Helper that deals with the type of the argument.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)

Param Type Description
typeName *
options * Note: If the options has zclCharFormatter set to true then the function will return the user defined data associated with the zcl data type and not the actual data type. example: {{asUnderlyingZclType [array type] array="b" one_byte="u" two_byte="v" three_byte="x" four_byte="w" short_string="s" long_string="l" default="b" zclCharFormatter="true"}} For the above if asUnderlyingZclType was given [array type] then the above will return 'b'

Templating API: static zcl helpers~zcl_string_type_return(type, options)

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)

Param Description
type
options Returns the data mentioned in the helper options based on whether the type is short string, long string or not a string Example: {{zcl_string_type_return type short_string="short string output" long_string="short string output" default="Output when not a string")

Templating API: static zcl helpers~is_zcl_string(type)

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)

Param Description
type Return: true or false based on whether the type is a string or not.

Templating API: static zcl helpers~if_is_number(type) ⇒

If helper that checks if a type is a string

example: {{#if_is_number type}} type is number {{else}} type is not number {{/if_is_number}}

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
type *

Templating API: static zcl helpers~if_is_string(type) ⇒

If helper that checks if a type is a string

example: {{#if_is_string type}} type is string {{else}} type is not string {{/if_is_string}}

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
type *

Templating API: static zcl helpers~if_is_char_string(type) ⇒

If helper that checks if a string type is present in the list of char strings i.e. characterStringTypes

example: {{#if_is_char_string type}} type is char string {{else}} type is not char string {{/if_is_char_string}}

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
type *

Templating API: static zcl helpers~if_is_octet_string(type) ⇒

If helper that checks if a string type is present in the list of octet strings i.e. octetStringTypes

example: {{#if_is_octet_string type}} type is octet string {{else}} type is not octet string {{/if_is_octet_string}}

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
type *

Templating API: static zcl helpers~if_is_short_string(type) ⇒

If helper that checks if a string type is present in the list of short strings i.e. stringShortTypes

example: {{#if_is_short_string type}} type is short string {{else}} type is not short string {{/if_is_short_string}}

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
type *

Templating API: static zcl helpers~if_is_long_string(type) ⇒

If helper that checks if a string type is present in the list of long strings i.e. stringLongTypes

example: {{#if_is_long_string type}} type is long string {{else}} type is not long string {{/if_is_long_string}}

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
type *

Templating API: static zcl helpers~if_is_atomic(type:) ⇒

If helper that checks if a type is an atomic

example: {{#if_is_atomic type}} type is atomic {{else}} type is not atomic {{/if_is_atomic}}

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type Description
type: * string

Templating API: static zcl helpers~if_is_bitmap(type) ⇒

If helper that checks if a type is a bitmap

example: {{#if_is_bitmap type}} type is bitmap {{else}} type is not bitmap {{/if_is_bitmap}}

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
type *

Templating API: static zcl helpers~if_is_enum(type) ⇒

If helper that checks if a type is an enum

  • example: {{#if_is_enum type}} type is enum {{else}} type is not enum {{/if_is_enum}}

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param Type
type *

Templating API: static zcl helpers~if_is_struct(type) ⇒

If helper that checks if a type is an struct

  • example: {{#if_is_struct type}} type is struct {{else}} type is not struct {{/if_is_struct}}

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content.

Param
type

Templating API: static zcl helpers~isClient(side) ⇒

Checks if the side is client or not

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: boolean

Param Type
side *

Templating API: static zcl helpers~isServer(side) ⇒

Checks if the side is server or not

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: boolean

Param Type
side *

Templating API: static zcl helpers~isStrEqual(str1, str2) ⇒

Compares 2 strings.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: boolean

Param Type
str1 *
str2 *

Templating API: static zcl helpers~isLastElement(index, count) ⇒

Returns boolean based on whether the element is the last element.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: boolean

Param Type
index *
count *

Templating API: static zcl helpers~isFirstElement(index, count) ⇒

Returns boolean based on whether the element is the first element.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: boolean

Param Type
index *
count *

Templating API: static zcl helpers~isEnabled(enable) ⇒

Check if enable is 1.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: boolean

Param Type
enable *

Templating API: static zcl helpers~isCommandAvailable(clusterSide, incoming, outgoing, source, name) ⇒

Returns boolean based on command being available or not.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: boolean

Param Type
clusterSide *
incoming *
outgoing *
source *
name *

Templating API: static zcl helpers~as_underlying_zcl_type_command_argument_always_present(type:, commandId:, appendString:, introducedInRef:, removedInRef:, presentIf:, options:) ⇒

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: A string as an underlying zcl type if the command is not fixed length and the command argument is always present in all zcl specifications.

Param Description
type: type of argument
commandId: command id
appendString: append the string to the argument
introducedInRef: If the command argument is not present in all zcl specifications and was introduced in a certain specification version then this will not be null
removedInRef: If the command argument is not present in all zcl specifications and was removed in a certain specification version then this will not be null
presentIf: If the command argument is present conditionally then this will be a condition and not null
options: options which can be passed to zclUtil.asUnderlyingZclTypeWithPackageId for determining the underlying zcl type for the provided argument type

Templating API: static zcl helpers~if_command_argument_always_present(commandId, introducedInRef, removedInRef, presentIf, argumentPresentReturn, argumentNotPresentReturn) ⇒

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: argumentPresentReturn if the command is not fixed length and command argument is always present without conditions(introducedInRef, removedInRef, presentIf) else returns argumentNotPresentReturn

Param
commandId
introducedInRef
removedInRef
presentIf
argumentPresentReturn
argumentNotPresentReturn

Templating API: static zcl helpers~as_underlying_zcl_type_command_argument_not_always_present_no_presentif(type:, commandId:, appendString:, introducedInRef:, removedInRef:, presentIf:, options:) ⇒

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: A string as an underlying zcl type if the command is not fixed length, the command argument is not always present in all zcl specifications and there is no present if conditionality on the command argument.

Param Description
type: type of argument
commandId: command id
appendString: append the string to the argument
introducedInRef: If the command argument is not present in all zcl specifications and was introduced in a certain specification version then this will not be null
removedInRef: If the command argument is not present in all zcl specifications and was removed in a certain specification version then this will not be null
presentIf: If the command argument is present conditionally then this will be a condition and not null
options: options which can be passed to zclUtil.asUnderlyingZclTypeWithPackageId for determining the underlying zcl type for the provided argument type

Templating API: static zcl helpers~as_underlying_zcl_type_ca_not_always_present_no_presentif(commandArg, appendString, options) ⇒

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: A string as an underlying zcl type if the command is not fixed length, the command argument is not always present in all zcl specifications and there is no present if conditionality on the command argument.

Param Description
commandArg command argument
appendString append the string to the argument
options options which can be passed to zclUtil.asUnderlyingZclTypeWithPackageId for determining the underlying zcl type for the provided argument type

Templating API: static zcl helpers~if_command_argument_not_always_present_no_presentif(commandId, introducedInRef, removedInRef, presentIf, argumentNotInAllVersionsReturn, argumentInAllVersionsReturn) ⇒

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: argumentNotInAllVersionsReturn if the command is not fixed length and command argument is present with conditions introducedInRef or removedInRef but no presentIf conditions else returns argumentNotPresentReturn

Param
commandId
introducedInRef
removedInRef
presentIf
argumentNotInAllVersionsReturn
argumentInAllVersionsReturn

Templating API: static zcl helpers~as_underlying_zcl_type_command_argument_not_always_present_with_presentif(type:, commandId:, appendString:, introducedInRef:, removedInRef:, presentIf:, options:) ⇒

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: A string as an underlying zcl type if the command is not fixed length, the command argument is not always present in all zcl specifications and there is a present if conditionality on the command argument.

Param Description
type: type of argument
commandId: command id
appendString: append the string to the argument
introducedInRef: If the command argument is not present in all zcl specifications and was introduced in a certain specification version then this will not be null
removedInRef: If the command argument is not present in all zcl specifications and was removed in a certain specification version then this will not be null
presentIf: If the command argument is present conditionally then this will be a condition and not null
options: options which can be passed to zclUtil.asUnderlyingZclTypeWithPackageId for determining the underlying zcl type for the provided argument type

Templating API: static zcl helpers~as_underlying_zcl_type_ca_not_always_present_with_presentif(commandArg, appendString, options) ⇒

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: A string as an underlying zcl type if the command is not fixed length, the command argument is not always present in all zcl specifications but there is a present if conditionality on the command argument.

Param Description
commandArg command argument
appendString append the string to the argument
options options which can be passed to zclUtil.asUnderlyingZclTypeWithPackageId for determining the underlying zcl type for the provided argument type

Templating API: static zcl helpers~if_command_argument_not_always_present_with_presentif(commandId, introducedInRef, removedInRef, presentIf, argumentNotInAllVersionsPresentIfReturn, argumentInAllVersionsReturn) ⇒

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: argumentNotInAllVersionsReturn if the command is not fixed length, command argument is present with conditions introducedInRef or removedInRef and presentIf conditions exist as well else returns argumentNotPresentReturn

Param
commandId
introducedInRef
removedInRef
presentIf
argumentNotInAllVersionsPresentIfReturn
argumentInAllVersionsReturn

Templating API: static zcl helpers~as_underlying_zcl_type_command_argument_always_present_with_presentif(type:, commandId:, appendString:, introducedInRef:, removedInRef:, presentIf:, options:) ⇒

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: A string as an underlying zcl type if the command is not fixed length, the command argument is always present in all zcl specifications and there is a present if conditionality on the command argument.

Param Description
type: type of argument
commandId: command id
appendString: append the string to the argument
introducedInRef: If the command argument is not present in all zcl specifications and was introduced in a certain specification version then this will not be null
removedInRef: If the command argument is not present in all zcl specifications and was removed in a certain specification version then this will not be null
presentIf: If the command argument is present conditionally then this will be a condition and not null
options: options which can be passed to zclUtil.asUnderlyingZclTypeWithPackageId for determining the underlying zcl type for the provided argument type

Templating API: static zcl helpers~as_underlying_zcl_type_ca_always_present_with_presentif(commandArg, appendString, options) ⇒

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: A string as an underlying zcl type if the command is not fixed length, the command argument is always present in all zcl specifications but there is a present if conditionality on the command argument.

Param Description
commandArg command argument
appendString append the string to the argument
options options which can be passed to zclUtil.asUnderlyingZclTypeWithPackageId for determining the underlying zcl type for the provided argument type

Templating API: static zcl helpers~if_command_argument_always_present_with_presentif(commandId, introducedInRef, removedInRef, presentIf, argumentNotInAllVersionsPresentIfReturn, argumentInAllVersionsReturn) ⇒

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: argumentInAllVersionsPresentIfReturn if the command is not fixed length, command argument is always present and presentIf conditions exist else returns argumentNotPresentReturn

Param
commandId
introducedInRef
removedInRef
presentIf
argumentNotInAllVersionsPresentIfReturn
argumentInAllVersionsReturn

Templating API: static zcl helpers~if_manufacturing_specific_cluster(clusterId, manufacturer_specific_return, null_manufacturer_specific_return) ⇒

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: manufacturer_specific_return if the cluster is manufacturer specific or returns null_manufacturer_specific_return if cluster is not manufacturer specific.

Param Type
clusterId *
manufacturer_specific_return *
null_manufacturer_specific_return *

Templating API: static zcl helpers~if_mfg_specific_cluster(clusterId, options) ⇒

If helper which checks if cluster is manufacturing specific or not example: {{#if_mfg_specific_cluster clusterId}} cluster is manufacturing specific {{else}} cluster is not manufacturing specific {{/if_mfg_specific_cluster}}

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Returns content in the handlebar template based on whether the command is manufacturing specific or not.

Param
clusterId
options

Templating API: static zcl helpers~as_generated_default_macro(value, attributeSize, options) ⇒

Given the value and size of an attribute along with endian as an option. This helper returns the attribute value as big/little endian. Example: {{as_generated_default_macro 0x00003840 4 endian="big"}} will return: 0x00, 0x00, 0x38, 0x40,

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Formatted attribute value based on given arguments Available options:

  • endian: Specify 'big' or 'little' endian format
  • isCommaTerminated: '0' or '1' for output to have a ',' at the end
Param
value
attributeSize
options

Templating API: static zcl helpers~attribute_mask(writable, storageOption, minMax, mfgSpecific, clusterCode, client, isSingleton, prefixString, postfixString) ⇒

Given the attributes of a zcl attribute. Creates an attribute mask based on the given options Available options: isClusterCodeMfgSpecific: 0/1, This is to determine if cluster code needs to be used to determine if a cluster is mfg specific or not.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: attribute mask based on given values

Param
writable
storageOption
minMax
mfgSpecific
clusterCode
client
isSingleton
prefixString
postfixString

Templating API: static zcl helpers~command_mask(commmandSource, clusterSide, isIncomingEnabled, isOutgoingEnabled, manufacturingCode, prefixForMask) ⇒

Given the attributes of a zcl command. Creates a command mask based on the given options

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: command mask based on given values

Param
commmandSource
clusterSide
isIncomingEnabled
isOutgoingEnabled
manufacturingCode
prefixForMask

Templating API: static zcl helpers~command_mask_sub_helper(commandMask, str) ⇒

A Sub helper api for command_mask to reduce code redundancy

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: command mask addition based on the arguments

Param
commandMask
str

Templating API: static zcl helpers~format_zcl_string_as_characters_for_generated_defaults(stringVal, sizeOfString) ⇒

This may be used within all_user_cluster_attributes_for_generated_defaults for example: {{format_zcl_string_as_characters_for_generated_defaults 'abc' 5}} will return as follows: 3, 'a', 'b', 'c' 0, 0

Available Options:

  • isOctet: 0/1 can be used to return results correctly for octet strings
  • isCommaTerminated: 0/1 can be used to return result with/without ',' at the end

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Formatted string for generated defaults starting with the lenth of a string then each character and then filler for the size allocated for the string. Long strings prefixed by 2 byte length field.

Param
stringVal
sizeOfString

Templating API: static zcl helpers~as_type_min_value(type, options) ⇒

Given a zcl data type return the min allowed value for that zcl data type based on the language specified in the options

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: max allowed value for the given zcl data type Available Options:

  • language: determines the output of the helper based on language for eg: (as_type_min_value language='c++') will give the output specific to the c++ language. Note: If language is not specified then helper throws an error.
Param Type
type *
options *

Templating API: static zcl helpers~as_type_max_value(type, options) ⇒

Given a zcl data type return the max allowed value for that zcl data type based on the language specified in the options

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: max allowed value for the given zcl data type Available Options:

  • language: determines the output of the helper based on language for eg: (as_type_max_value language='c++') will give the output specific to the c++ language. Note: If language is not specified then the helper returns size of type in bits.
Param Type
type *
options *

Templating API: static zcl helpers~structs_with_clusters(options)

Returns all structs which have clusters associated with them

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)

Param Type Description
options * Available Options: - groupByStructName: Can group the query results based on struct name for structs which are present in more than one cluster eg Usage: {{#structs_with_clusters groupByStructName=1}}{{/structs_with_clusters}}

Templating API: static zcl helpers~as_zcl_type_size(type, options) ⇒

Returns the size of the zcl type if possible else returns -1

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: size of zcl type

Param Type
type *
options *

Templating API: static zcl helpers~if_compare(leftValue, rightValue, options) ⇒ Object

An if helper for comparisons

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Object - Promise of content example: checking if (4 < 5) (if_compare 4 5 operator='<') Content when comparison returns true

Content when comparison returns false (/if_compare)

Param Type
leftValue *
rightValue *
options *

Templating API: static zcl helpers~if_is_data_type_signed(type, clusterId, options) ⇒

Check if the given type is signed or not based on the type name and cluster id. Note: This helper needs to be used under a block helper which has a reference to clusterId.

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: Promise of content

Param Type
type *
clusterId *
options *

Templating API: static zcl helpers~as_zcl_data_type_size(type, clusterId, options) ⇒

Fetches the size of the data type based on type name and cluster id given Note:

  • Size is zero for structs
  • This helper needs to be used under a block helper which has a reference to clusterId. Available Options:
  • roundUpToPowerOfTwo: Rounds the size up to the nearest power of 2
  • sizeIn: By default size is returned in bytes but it can be returned in bits by mentioning sizeIn="bits"

Kind: inner method of [Templating API: static zcl helpers](#module_Templating API_ static zcl helpers)
Returns: size of the data type

Param Type
type *
clusterId *
options *

Templating API: Zigbee Specific helpers

This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}

  • [Templating API: Zigbee Specific helpers](#module_Templating API_ Zigbee Specific helpers)
    • [~get_cli_size(size, type, allowZclTypes)](#module_Templating API_ Zigbee Specific helpers..get_cli_size) ⇒
    • [~zcl_command_argument_type_to_cli_data_type_util(type, cliPrefix, context, options)](#module_Templating API_ Zigbee Specific helpers..zcl_command_argument_type_to_cli_data_type_util) ⇒
    • [~zcl_command_argument_type_to_cli_data_type(typeName, options)](#module_Templating API_ Zigbee Specific helpers..zcl_command_argument_type_to_cli_data_type)
    • [~zcl_command_argument_type_to_zcl_cli_data_type(typeName, options)](#module_Templating API_ Zigbee Specific helpers..zcl_command_argument_type_to_zcl_cli_data_type)

Templating API: Zigbee Specific helpers~get_cli_size(size, type, allowZclTypes) ⇒

Kind: inner method of [Templating API: Zigbee Specific helpers](#module_Templating API_ Zigbee Specific helpers)
Returns: The size in bits for a cli type based on allowZclTypes

Param Type
size *
type *
allowZclTypes *

Templating API: Zigbee Specific helpers~zcl_command_argument_type_to_cli_data_type_util(type, cliPrefix, context, options) ⇒

Kind: inner method of [Templating API: Zigbee Specific helpers](#module_Templating API_ Zigbee Specific helpers)
Returns: the zcl cli data type string with the cli prefix given Additional Options:

  • isOptional option can be passed along with the command argument to return optional command argument extension accordingly eg: #zcl_command_arguments zcl_command_argument_type_to_zcl_cli_data_type type isOptional=isOptional /zcl_command_arguments
Param Type
type *
cliPrefix *
context *
options *

Templating API: Zigbee Specific helpers~zcl_command_argument_type_to_cli_data_type(typeName, options)

Helper that deals with the type of the argument.

Kind: inner method of [Templating API: Zigbee Specific helpers](#module_Templating API_ Zigbee Specific helpers)

Param Type
typeName *
options *

Templating API: Zigbee Specific helpers~zcl_command_argument_type_to_zcl_cli_data_type(typeName, options)

Helper that deals with the type of the argument.

Kind: inner method of [Templating API: Zigbee Specific helpers](#module_Templating API_ Zigbee Specific helpers)

Param Type
typeName *
options *

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](#module_JS API_ generator logic)
    • [~findAndReadJsonFiles(obj, basePath)](#module_JS API_ generator logic..findAndReadJsonFiles) ⇒ Promise.<string>
    • [~loadGenTemplateFromFile(templatePath)](#module_JS API_ generator logic..loadGenTemplateFromFile) ⇒
    • [~recordPackageIfNonexistent(db, packagePath, parentId, packageType, version, category, description)](#module_JS API_ generator logic..recordPackageIfNonexistent) ⇒
    • [~loadTemplateOptionsFromJsonFile(db, packageId, category, externalPath)](#module_JS API_ generator logic..loadTemplateOptionsFromJsonFile) ⇒
    • [~recordTemplatesPackage(context, isTopLevelPackageInSync)](#module_JS API_ generator logic..recordTemplatesPackage) ⇒
    • [~decodePackageExtensionEntity(entityType, entity)](#module_JS API_ generator logic..decodePackageExtensionEntity) ⇒
    • [~loadZclExtensions(zclExt)](#module_JS API_ generator logic..loadZclExtensions) ⇒
    • [~loadTemplates(db, genTemplatesJsonArray)](#module_JS API_ generator logic..loadTemplates)
    • [~loadGenTemplatesJsonFile(db, genTemplatesJson)](#module_JS API_ generator logic..loadGenTemplatesJsonFile) ⇒
    • [~retrievePackageMetaInfo(db, genTemplatesPkgId)](#module_JS API_ generator logic..retrievePackageMetaInfo) ⇒
    • [~generateAllTemplates(genResult, genTemplateJsonPkg, generateOnly)](#module_JS API_ generator logic..generateAllTemplates) ⇒
    • [~generateSingleTemplate(genResult, singleTemplatePkg)](#module_JS API_ generator logic..generateSingleTemplate) ⇒
    • [~generate(db, sessionId, templatePackageId, templateGeneratorOptions, options)](#module_JS API_ generator logic..generate) ⇒
    • [~writeFileWithBackup(fileName, content, doBackup)](#module_JS API_ generator logic..writeFileWithBackup) ⇒
    • [~generateGenerationContent(genResult)](#module_JS API_ generator logic..generateGenerationContent)
    • [~generateAndWriteFiles(db, sessionId, packageId, outputDirectory)](#module_JS API_ generator logic..generateAndWriteFiles) ⇒
    • [~createGenerationLog(logFile, genData)](#module_JS API_ generator logic..createGenerationLog)
    • [~postProcessGeneratedFiles(outputDirectory, genResult)](#module_JS API_ generator logic..postProcessGeneratedFiles) ⇒
    • [~contentIndexer(content)](#module_JS API_ generator logic..contentIndexer)
    • [~generateSingleFileForPreview(db, sessionId, fileName)](#module_JS API_ generator logic..generateSingleFileForPreview) ⇒
    • [~produceCompiledTemplate(singleTemplatePkg)](#module_JS API_ generator logic..produceCompiledTemplate) ⇒
    • [~produceIterativeContent(hb, metaInfo, db, sessionId, singleTemplatePkg, genTemplateJsonPackage, options)](#module_JS API_ generator logic..produceIterativeContent) ⇒
    • [~produceContent(hb, metaInfo, db, sessionId, singlePkg, overridePath:)](#module_JS API_ generator logic..produceContent) ⇒
    • [~wrapOverridable(originalFn, overrideFn)](#module_JS API_ generator logic..wrapOverridable) ⇒
    • [~loadOverridable(path)](#module_JS API_ generator logic..loadOverridable)
    • [~loadPartial(hb, name, data)](#module_JS API_ generator logic..loadPartial)
    • [~helperWrapper(wrappedHelper)](#module_JS API_ generator logic..helperWrapper) ⇒
    • [~loadHelper(hb, helpers, context)](#module_JS API_ generator logic..loadHelper)
    • [~allBuiltInHelpers()](#module_JS API_ generator logic..allBuiltInHelpers) ⇒
    • [~findHelperPackageByAlias(alias)](#module_JS API_ generator logic..findHelperPackageByAlias) ⇒
    • [~initializeBuiltInHelpersForPackage()](#module_JS API_ generator logic..initializeBuiltInHelpersForPackage)
    • [~hbInstance()](#module_JS API_ generator logic..hbInstance) ⇒
    • [~makeSynchronizablePromise(promise)](#module_JS API_ generator logic..makeSynchronizablePromise)
    • [~collectBlocks(resultArray, options, context)](#module_JS API_ generator logic..collectBlocks) ⇒
    • [~ensureZclPackageId(context)](#module_JS API_ generator logic..ensureZclPackageId) ⇒
    • [~ensureZclPackageIds(context)](#module_JS API_ generator logic..ensureZclPackageIds) ⇒
    • [~ensureTemplatePackageCategory(context)](#module_JS API_ generator logic..ensureTemplatePackageCategory) ⇒
    • [~ensureTemplatePackageId(context)](#module_JS API_ generator logic..ensureTemplatePackageId) ⇒
    • [~ensureEndpointTypeIds(context)](#module_JS API_ generator logic..ensureEndpointTypeIds) ⇒
    • [~ensureZclClusterSdkExtensions(context, templatePackageId)](#module_JS API_ generator logic..ensureZclClusterSdkExtensions) ⇒
    • [~ensureZclDeviceTypeSdkExtensions(context, templatePackageId)](#module_JS API_ generator logic..ensureZclDeviceTypeSdkExtensions) ⇒
    • [~ensureZclAttributeSdkExtensions(context, templatePackageId)](#module_JS API_ generator logic..ensureZclAttributeSdkExtensions) ⇒
    • [~ensureZclAttributeTypeSdkExtensions(context, templatePackageId)](#module_JS API_ generator logic..ensureZclAttributeTypeSdkExtensions) ⇒
    • [~ensureZclCommandSdkExtensions(context, templatePackageId)](#module_JS API_ generator logic..ensureZclCommandSdkExtensions) ⇒
    • [~ensureZclEventSdkExtensions(context, templatePackageId)](#module_JS API_ generator logic..ensureZclEventSdkExtensions) ⇒
    • [~templatePromise(global, promise)](#module_JS API_ generator logic..templatePromise)
    • [~deprecatedHelper(fn, explanation)](#module_JS API_ generator logic..deprecatedHelper) ⇒

JS API: generator logic~findAndReadJsonFiles(obj, basePath) ⇒ Promise.<string>

Finds and reads JSON files referenced in a nested object.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: Promise.<string> - - A promise that resolves to the concatenated content of all JSON files.

Param Type Description
obj Object The object to search for JSON file references.
basePath string The base directory to resolve relative paths.

JS API: generator logic~loadGenTemplateFromFile(templatePath) ⇒

Given a path, it will read generation template object into memory.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: Object that contains: data, crc, templateData

Param Type
templatePath *

JS API: generator logic~recordPackageIfNonexistent(db, packagePath, parentId, packageType, version, category, description) ⇒

Inserts the package details when they do not exist.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: Promise of package insertion

Param Type
db *
packagePath *
parentId *
packageType *
version *
category *
description *

JS API: generator logic~loadTemplateOptionsFromJsonFile(db, packageId, category, externalPath) ⇒

Insert the template options from the json meta data file.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: Promise of inserted template options

Param Type
db *
packageId *
category *
externalPath *

JS API: generator logic~recordTemplatesPackage(context, isTopLevelPackageInSync) ⇒

Given a loading context and whether the package is in sync, 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](#module_JS API_ generator logic)
Returns: promise that resolves with the same context passed in, except packageId added to it

Param Type
context *
isTopLevelPackageInSync *

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](#module_JS API_ generator logic)
Returns: object that can be used for database injection

Param Type
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](#module_JS API_ generator logic)
Returns: Promise of loading the zcl extensions.

Param Type
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](#module_JS API_ generator logic)

Param Type
db *
genTemplatesJsonArray *

JS API: generator logic~loadGenTemplatesJsonFile(db, genTemplatesJson) ⇒

Main API async function to load templates from a gen-template.json file.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: the loading context, contains: db, path, crc, packageId and templateData, or error

Param Type Description
db * Database
genTemplatesJson * Path to the JSON file or an array of paths to JSON file

JS API: generator logic~retrievePackageMetaInfo(db, genTemplatesPkgId) ⇒

Get the package information from the given package ID.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: package information

Param Type
db *
genTemplatesPkgId *

JS API: generator logic~generateAllTemplates(genResult, genTemplateJsonPkg, generateOnly) ⇒

Generates all the templates inside a toplevel package.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: Promise that resolves with genResult, that contains all the generated templates, keyed by their 'output'

Param Type Description
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](#module_JS API_ generator logic)
Returns: promise that resolves with the genResult, with newly generated content added.

Param Type Description
genResult *
singleTemplatePkg * Single template package.

JS API: generator logic~generate(db, sessionId, templatePackageId, templateGeneratorOptions, options) ⇒

Main API async function to generate stuff.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: Promise that resolves into a generation result.Promise that resolves into a generation result.

Param Type Description
db * Database
sessionId *
templatePackageId * packageId Template package id. It can be either single template or gen template json.
templateGeneratorOptions *
options *

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](#module_JS API_ generator logic)
Returns: promise of a written file.

Param Type
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](#module_JS API_ generator logic)

Param Type
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](#module_JS API_ generator logic)
Returns: a promise which will resolve when all the files are written.

Param Type
db *
sessionId *
packageId *
outputDirectory *

JS API: generator logic~createGenerationLog(logFile, genData)

Create a generation log.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)

Param Type
logFile *
genData *

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](#module_JS API_ generator logic)
Returns: promise of a dealt-with post processing actions

Param Type
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](#module_JS API_ generator logic)

Param Type Description
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](#module_JS API_ generator logic)
Returns: promise that resolves into a preview object.

Param Type
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](#module_JS API_ generator logic)
Returns: templates

Param Type
singleTemplatePkg *

JS API: generator logic~produceIterativeContent(hb, metaInfo, db, sessionId, singleTemplatePkg, genTemplateJsonPackage, options) ⇒

This function is reached if the template is an "iterative one", meaning it has the iterator set to one of the valid options.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: Promise that resolves into an array of key/content/stats objects.

Param Type
hb *
metaInfo *
db *
sessionId *
singleTemplatePkg *
genTemplateJsonPackage *
options *

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](#module_JS API_ generator logic)
Returns: Promise that resolves into an array of key/content/stats objects.

Param Type Description
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](#module_JS API_ generator logic)
Returns: result from override function, unless it throws an exception, in which case return result from original function.

Param Type
originalFn *
overrideFn *

JS API: generator logic~loadOverridable(path)

This function is responsible to load the overridable function container.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)

Param Type Description
path * of the override file

JS API: generator logic~loadPartial(hb, name, data)

Function that loads the partials.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)

Param Type
hb *
name *
data *

JS API: generator logic~helperWrapper(wrappedHelper) ⇒

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: function

Param Type
wrappedHelper *

JS API: generator logic~loadHelper(hb, helpers, context)

Function that loads the helpers.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)

Param Type Default Description
hb *
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.
context *

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](#module_JS 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](#module_JS API_ generator logic)
Returns: Helper package or undefined if none was found.

Param Type
alias *

JS API: generator logic~initializeBuiltInHelpersForPackage()

Global helper initialization

Kind: inner method of [JS API: generator logic](#module_JS 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](#module_JS 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](#module_JS API_ generator logic)

Param Type
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](#module_JS API_ generator logic)
Returns: Promise that resolves with a content string.

Param Type Description
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](#module_JS API_ generator logic)
Returns: promise that resolves with the package id.

Param Type
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](#module_JS API_ generator logic)
Returns: promise that resolves with a list of package id.

Param Type
context *

JS API: generator logic~ensureTemplatePackageCategory(context) ⇒

Returns a package category of the toplevel template package from context.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: proimise that resolves into a package category

Param Type
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](#module_JS API_ generator logic)
Returns: promise that resolves with the package id.

Param Type
context *

JS API: generator logic~ensureEndpointTypeIds(context) ⇒

Populate the endpoint type ids into the global context.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: endpoint type ids

Param Type
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](#module_JS API_ generator logic)
Returns: promise that resolves with cluster extensions.

Param Type
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](#module_JS API_ generator logic)
Returns: promise that resolves with cluster extensions.

Param Type
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](#module_JS API_ generator logic)
Returns: promise that resolves with attribute extensions.

Param Type
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](#module_JS API_ generator logic)
Returns: promise that resolves with attribute type extensions.

Param Type
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](#module_JS API_ generator logic)
Returns: promise that resolves with command extensions.

Param Type
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](#module_JS API_ generator logic)
Returns: promise that resolves with command extensions.

Param Type
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](#module_JS API_ generator logic)

Param Type
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](#module_JS API_ generator logic)
Returns: a function that wraps the original function, with deprecation message.

Param Type Description
fn *
explanation * can contain text, or from/to, or just be a string message itself.

JS API: template iterators.

JS API: generator logic

  • [JS API: generator logic](#module_JS API_ generator logic)
    • [~findAndReadJsonFiles(obj, basePath)](#module_JS API_ generator logic..findAndReadJsonFiles) ⇒ Promise.<string>
    • [~loadGenTemplateFromFile(templatePath)](#module_JS API_ generator logic..loadGenTemplateFromFile) ⇒
    • [~recordPackageIfNonexistent(db, packagePath, parentId, packageType, version, category, description)](#module_JS API_ generator logic..recordPackageIfNonexistent) ⇒
    • [~loadTemplateOptionsFromJsonFile(db, packageId, category, externalPath)](#module_JS API_ generator logic..loadTemplateOptionsFromJsonFile) ⇒
    • [~recordTemplatesPackage(context, isTopLevelPackageInSync)](#module_JS API_ generator logic..recordTemplatesPackage) ⇒
    • [~decodePackageExtensionEntity(entityType, entity)](#module_JS API_ generator logic..decodePackageExtensionEntity) ⇒
    • [~loadZclExtensions(zclExt)](#module_JS API_ generator logic..loadZclExtensions) ⇒
    • [~loadTemplates(db, genTemplatesJsonArray)](#module_JS API_ generator logic..loadTemplates)
    • [~loadGenTemplatesJsonFile(db, genTemplatesJson)](#module_JS API_ generator logic..loadGenTemplatesJsonFile) ⇒
    • [~retrievePackageMetaInfo(db, genTemplatesPkgId)](#module_JS API_ generator logic..retrievePackageMetaInfo) ⇒
    • [~generateAllTemplates(genResult, genTemplateJsonPkg, generateOnly)](#module_JS API_ generator logic..generateAllTemplates) ⇒
    • [~generateSingleTemplate(genResult, singleTemplatePkg)](#module_JS API_ generator logic..generateSingleTemplate) ⇒
    • [~generate(db, sessionId, templatePackageId, templateGeneratorOptions, options)](#module_JS API_ generator logic..generate) ⇒
    • [~writeFileWithBackup(fileName, content, doBackup)](#module_JS API_ generator logic..writeFileWithBackup) ⇒
    • [~generateGenerationContent(genResult)](#module_JS API_ generator logic..generateGenerationContent)
    • [~generateAndWriteFiles(db, sessionId, packageId, outputDirectory)](#module_JS API_ generator logic..generateAndWriteFiles) ⇒
    • [~createGenerationLog(logFile, genData)](#module_JS API_ generator logic..createGenerationLog)
    • [~postProcessGeneratedFiles(outputDirectory, genResult)](#module_JS API_ generator logic..postProcessGeneratedFiles) ⇒
    • [~contentIndexer(content)](#module_JS API_ generator logic..contentIndexer)
    • [~generateSingleFileForPreview(db, sessionId, fileName)](#module_JS API_ generator logic..generateSingleFileForPreview) ⇒
    • [~produceCompiledTemplate(singleTemplatePkg)](#module_JS API_ generator logic..produceCompiledTemplate) ⇒
    • [~produceIterativeContent(hb, metaInfo, db, sessionId, singleTemplatePkg, genTemplateJsonPackage, options)](#module_JS API_ generator logic..produceIterativeContent) ⇒
    • [~produceContent(hb, metaInfo, db, sessionId, singlePkg, overridePath:)](#module_JS API_ generator logic..produceContent) ⇒
    • [~wrapOverridable(originalFn, overrideFn)](#module_JS API_ generator logic..wrapOverridable) ⇒
    • [~loadOverridable(path)](#module_JS API_ generator logic..loadOverridable)
    • [~loadPartial(hb, name, data)](#module_JS API_ generator logic..loadPartial)
    • [~helperWrapper(wrappedHelper)](#module_JS API_ generator logic..helperWrapper) ⇒
    • [~loadHelper(hb, helpers, context)](#module_JS API_ generator logic..loadHelper)
    • [~allBuiltInHelpers()](#module_JS API_ generator logic..allBuiltInHelpers) ⇒
    • [~findHelperPackageByAlias(alias)](#module_JS API_ generator logic..findHelperPackageByAlias) ⇒
    • [~initializeBuiltInHelpersForPackage()](#module_JS API_ generator logic..initializeBuiltInHelpersForPackage)
    • [~hbInstance()](#module_JS API_ generator logic..hbInstance) ⇒
    • [~makeSynchronizablePromise(promise)](#module_JS API_ generator logic..makeSynchronizablePromise)
    • [~collectBlocks(resultArray, options, context)](#module_JS API_ generator logic..collectBlocks) ⇒
    • [~ensureZclPackageId(context)](#module_JS API_ generator logic..ensureZclPackageId) ⇒
    • [~ensureZclPackageIds(context)](#module_JS API_ generator logic..ensureZclPackageIds) ⇒
    • [~ensureTemplatePackageCategory(context)](#module_JS API_ generator logic..ensureTemplatePackageCategory) ⇒
    • [~ensureTemplatePackageId(context)](#module_JS API_ generator logic..ensureTemplatePackageId) ⇒
    • [~ensureEndpointTypeIds(context)](#module_JS API_ generator logic..ensureEndpointTypeIds) ⇒
    • [~ensureZclClusterSdkExtensions(context, templatePackageId)](#module_JS API_ generator logic..ensureZclClusterSdkExtensions) ⇒
    • [~ensureZclDeviceTypeSdkExtensions(context, templatePackageId)](#module_JS API_ generator logic..ensureZclDeviceTypeSdkExtensions) ⇒
    • [~ensureZclAttributeSdkExtensions(context, templatePackageId)](#module_JS API_ generator logic..ensureZclAttributeSdkExtensions) ⇒
    • [~ensureZclAttributeTypeSdkExtensions(context, templatePackageId)](#module_JS API_ generator logic..ensureZclAttributeTypeSdkExtensions) ⇒
    • [~ensureZclCommandSdkExtensions(context, templatePackageId)](#module_JS API_ generator logic..ensureZclCommandSdkExtensions) ⇒
    • [~ensureZclEventSdkExtensions(context, templatePackageId)](#module_JS API_ generator logic..ensureZclEventSdkExtensions) ⇒
    • [~templatePromise(global, promise)](#module_JS API_ generator logic..templatePromise)
    • [~deprecatedHelper(fn, explanation)](#module_JS API_ generator logic..deprecatedHelper) ⇒

JS API: generator logic~findAndReadJsonFiles(obj, basePath) ⇒ Promise.<string>

Finds and reads JSON files referenced in a nested object.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: Promise.<string> - - A promise that resolves to the concatenated content of all JSON files.

Param Type Description
obj Object The object to search for JSON file references.
basePath string The base directory to resolve relative paths.

JS API: generator logic~loadGenTemplateFromFile(templatePath) ⇒

Given a path, it will read generation template object into memory.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: Object that contains: data, crc, templateData

Param Type
templatePath *

JS API: generator logic~recordPackageIfNonexistent(db, packagePath, parentId, packageType, version, category, description) ⇒

Inserts the package details when they do not exist.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: Promise of package insertion

Param Type
db *
packagePath *
parentId *
packageType *
version *
category *
description *

JS API: generator logic~loadTemplateOptionsFromJsonFile(db, packageId, category, externalPath) ⇒

Insert the template options from the json meta data file.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: Promise of inserted template options

Param Type
db *
packageId *
category *
externalPath *

JS API: generator logic~recordTemplatesPackage(context, isTopLevelPackageInSync) ⇒

Given a loading context and whether the package is in sync, 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](#module_JS API_ generator logic)
Returns: promise that resolves with the same context passed in, except packageId added to it

Param Type
context *
isTopLevelPackageInSync *

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](#module_JS API_ generator logic)
Returns: object that can be used for database injection

Param Type
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](#module_JS API_ generator logic)
Returns: Promise of loading the zcl extensions.

Param Type
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](#module_JS API_ generator logic)

Param Type
db *
genTemplatesJsonArray *

JS API: generator logic~loadGenTemplatesJsonFile(db, genTemplatesJson) ⇒

Main API async function to load templates from a gen-template.json file.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: the loading context, contains: db, path, crc, packageId and templateData, or error

Param Type Description
db * Database
genTemplatesJson * Path to the JSON file or an array of paths to JSON file

JS API: generator logic~retrievePackageMetaInfo(db, genTemplatesPkgId) ⇒

Get the package information from the given package ID.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: package information

Param Type
db *
genTemplatesPkgId *

JS API: generator logic~generateAllTemplates(genResult, genTemplateJsonPkg, generateOnly) ⇒

Generates all the templates inside a toplevel package.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: Promise that resolves with genResult, that contains all the generated templates, keyed by their 'output'

Param Type Description
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](#module_JS API_ generator logic)
Returns: promise that resolves with the genResult, with newly generated content added.

Param Type Description
genResult *
singleTemplatePkg * Single template package.

JS API: generator logic~generate(db, sessionId, templatePackageId, templateGeneratorOptions, options) ⇒

Main API async function to generate stuff.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: Promise that resolves into a generation result.Promise that resolves into a generation result.

Param Type Description
db * Database
sessionId *
templatePackageId * packageId Template package id. It can be either single template or gen template json.
templateGeneratorOptions *
options *

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](#module_JS API_ generator logic)
Returns: promise of a written file.

Param Type
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](#module_JS API_ generator logic)

Param Type
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](#module_JS API_ generator logic)
Returns: a promise which will resolve when all the files are written.

Param Type
db *
sessionId *
packageId *
outputDirectory *

JS API: generator logic~createGenerationLog(logFile, genData)

Create a generation log.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)

Param Type
logFile *
genData *

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](#module_JS API_ generator logic)
Returns: promise of a dealt-with post processing actions

Param Type
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](#module_JS API_ generator logic)

Param Type Description
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](#module_JS API_ generator logic)
Returns: promise that resolves into a preview object.

Param Type
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](#module_JS API_ generator logic)
Returns: templates

Param Type
singleTemplatePkg *

JS API: generator logic~produceIterativeContent(hb, metaInfo, db, sessionId, singleTemplatePkg, genTemplateJsonPackage, options) ⇒

This function is reached if the template is an "iterative one", meaning it has the iterator set to one of the valid options.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: Promise that resolves into an array of key/content/stats objects.

Param Type
hb *
metaInfo *
db *
sessionId *
singleTemplatePkg *
genTemplateJsonPackage *
options *

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](#module_JS API_ generator logic)
Returns: Promise that resolves into an array of key/content/stats objects.

Param Type Description
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](#module_JS API_ generator logic)
Returns: result from override function, unless it throws an exception, in which case return result from original function.

Param Type
originalFn *
overrideFn *

JS API: generator logic~loadOverridable(path)

This function is responsible to load the overridable function container.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)

Param Type Description
path * of the override file

JS API: generator logic~loadPartial(hb, name, data)

Function that loads the partials.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)

Param Type
hb *
name *
data *

JS API: generator logic~helperWrapper(wrappedHelper) ⇒

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: function

Param Type
wrappedHelper *

JS API: generator logic~loadHelper(hb, helpers, context)

Function that loads the helpers.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)

Param Type Default Description
hb *
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.
context *

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](#module_JS 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](#module_JS API_ generator logic)
Returns: Helper package or undefined if none was found.

Param Type
alias *

JS API: generator logic~initializeBuiltInHelpersForPackage()

Global helper initialization

Kind: inner method of [JS API: generator logic](#module_JS 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](#module_JS 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](#module_JS API_ generator logic)

Param Type
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](#module_JS API_ generator logic)
Returns: Promise that resolves with a content string.

Param Type Description
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](#module_JS API_ generator logic)
Returns: promise that resolves with the package id.

Param Type
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](#module_JS API_ generator logic)
Returns: promise that resolves with a list of package id.

Param Type
context *

JS API: generator logic~ensureTemplatePackageCategory(context) ⇒

Returns a package category of the toplevel template package from context.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: proimise that resolves into a package category

Param Type
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](#module_JS API_ generator logic)
Returns: promise that resolves with the package id.

Param Type
context *

JS API: generator logic~ensureEndpointTypeIds(context) ⇒

Populate the endpoint type ids into the global context.

Kind: inner method of [JS API: generator logic](#module_JS API_ generator logic)
Returns: endpoint type ids

Param Type
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](#module_JS API_ generator logic)
Returns: promise that resolves with cluster extensions.

Param Type
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](#module_JS API_ generator logic)
Returns: promise that resolves with cluster extensions.

Param Type
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](#module_JS API_ generator logic)
Returns: promise that resolves with attribute extensions.

Param Type
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](#module_JS API_ generator logic)
Returns: promise that resolves with attribute type extensions.

Param Type
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](#module_JS API_ generator logic)
Returns: promise that resolves with command extensions.

Param Type
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](#module_JS API_ generator logic)
Returns: promise that resolves with command extensions.

Param Type
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](#module_JS API_ generator logic)

Param Type
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](#module_JS API_ generator logic)
Returns: a function that wraps the original function, with deprecation message.

Param Type Description
fn *
explanation * can contain text, or from/to, or just be a string message itself.

IDE Integration API: Studio REST API.

This module provides the APIs to Silabs Simplicity Studio's Jetty server.

REST API: user data

This module provides the API to access zcl specific information.

  • [REST API: user data](#module_REST API_ user data)
    • [~getComponentIdsByCluster(db, sessionId, clusterId, side)](#module_REST API_ user data..getComponentIdsByCluster) ⇒ *
    • [~httpGetSessionKeyValues(db)](#module_REST API_ user data..httpGetSessionKeyValues) ⇒
    • [~httpGetEndpointIds(db)](#module_REST API_ user data..httpGetEndpointIds) ⇒
    • [~httpGetDeviceTypeFeatures(db)](#module_REST API_ user data..httpGetDeviceTypeFeatures) ⇒
    • [~httpPostCheckConformOnFeatureUpdate(db)](#module_REST API_ user data..httpPostCheckConformOnFeatureUpdate) ⇒
    • [~httpGetRequiredElements(db)](#module_REST API_ user data..httpGetRequiredElements) ⇒
    • [~httpGetFeatureMapValue(db)](#module_REST API_ user data..httpGetFeatureMapValue)
    • [~httpGetSessionNotifications(db)](#module_REST API_ user data..httpGetSessionNotifications) ⇒
    • [~httpDeleteSessionNotification(db)](#module_REST API_ user data..httpDeleteSessionNotification) ⇒
    • [~httpGetPackageNotifications(db)](#module_REST API_ user data..httpGetPackageNotifications) ⇒
    • [~httpGetPackageNotificationsByPackageId(db)](#module_REST API_ user data..httpGetPackageNotificationsByPackageId) ⇒
    • [~httpDeletePackageNotification(db)](#module_REST API_ user data..httpDeletePackageNotification) ⇒
    • [~httpGetUnseenNotificationCount(db)](#module_REST API_ user data..httpGetUnseenNotificationCount) ⇒
    • [~httpGetUnseenNotificationAndUpdate(db)](#module_REST API_ user data..httpGetUnseenNotificationAndUpdate) ⇒
    • [~httpPostSaveSessionKeyValue(db)](#module_REST API_ user data..httpPostSaveSessionKeyValue) ⇒
    • [~httpPostCluster(db)](#module_REST API_ user data..httpPostCluster) ⇒
    • [~httpPostForcedExternal(db)](#module_REST API_ user data..httpPostForcedExternal) ⇒ function
    • [~httpPostAttributeUpdate(db)](#module_REST API_ user data..httpPostAttributeUpdate) ⇒
    • [~httpPostCommandUpdate(db)](#module_REST API_ user data..httpPostCommandUpdate) ⇒
    • [~httpPostEventUpdate(db)](#module_REST API_ user data..httpPostEventUpdate) ⇒
    • [~httpGetInitialState(db)](#module_REST API_ user data..httpGetInitialState) ⇒
    • [~httpGetOption(db)](#module_REST API_ user data..httpGetOption) ⇒
    • [~httpGetUiOptions(db)](#module_REST API_ user data..httpGetUiOptions) ⇒
    • [~httpGetPackages()](#module_REST API_ user data..httpGetPackages)
    • [~httpGetAllPackages()](#module_REST API_ user data..httpGetAllPackages)
    • [~httpPostAddNewPackage()](#module_REST API_ user data..httpPostAddNewPackage)
    • [~httpPostShareClusterStatesAcrossEndpoints()](#module_REST API_ user data..httpPostShareClusterStatesAcrossEndpoints)
    • [~commandDefaults(db, endpointTypeIdList, sharedClusterList, packageIds)](#module_REST API_ user data..commandDefaults) ⇒
    • [~writeCommandDefaults(db, defaults)](#module_REST API_ user data..writeCommandDefaults)
    • [~attributeDefaults(db, endpointTypeIdList, sharedClusterList, packageIds)](#module_REST API_ user data..attributeDefaults) ⇒
    • [~writeAttributeDefaults(db, defaults)](#module_REST API_ user data..writeAttributeDefaults)
    • [~commandEquals(a, b)](#module_REST API_ user data..commandEquals) ⇒
    • [~attributeEquals(a, b)](#module_REST API_ user data..attributeEquals) ⇒
    • [~httpDeleteSessionPackage(db)](#module_REST API_ user data..httpDeleteSessionPackage) ⇒
    • [~httpPostDuplicateEndpoint(db)](#module_REST API_ user data..httpPostDuplicateEndpoint) ⇒
    • [~httpPostDuplicateEndpointType(db)](#module_REST API_ user data..httpPostDuplicateEndpointType) ⇒
    • [~httpPatchUpdateBitOfFeatureMapAttribute(db)](#module_REST API_ user data..httpPatchUpdateBitOfFeatureMapAttribute) ⇒
    • [~httpGetConformDataExists(db)](#module_REST API_ user data..httpGetConformDataExists) ⇒
    • [~httpPostRequiredElementWarning(db)](#module_REST API_ user data..httpPostRequiredElementWarning) ⇒
    • [~duplicateEndpointTypeClusters(db, oldEndpointTypeId, newEndpointTypeId)](#module_REST 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](#module_REST API_ user data)
Returns: * - array of componentIds

Param Type
db *
sessionId *
clusterId *
side *

REST API: user data~httpGetSessionKeyValues(db) ⇒

HTTP GET: session key values

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpGetEndpointIds(db) ⇒

HTTP GET: endpoint ids of endpoints within a specified session

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpGetDeviceTypeFeatures(db) ⇒

HTTP GET: device type features

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpPostCheckConformOnFeatureUpdate(db) ⇒

HTTP POST: elements to be updated after toggle a device type feature

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpGetRequiredElements(db) ⇒

HTTP GET: required and unsupported cluster elements based on conformance

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpGetFeatureMapValue(db)

HTTP GET: the value of feature map attribute in an endpoint type cluster

Kind: inner method of [REST API: user data](#module_REST API_ user data)

Param Type
db *

REST API: user data~httpGetSessionNotifications(db) ⇒

HTTP GET: session get notifications

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpDeleteSessionNotification(db) ⇒

HTTP DELETE: session delete notifications

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpGetPackageNotifications(db) ⇒

HTTP GET: package get notifications

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpGetPackageNotificationsByPackageId(db) ⇒

HTTP GET: package get notifications

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpDeletePackageNotification(db) ⇒

HTTP DELETE: session delete notifications

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpGetUnseenNotificationCount(db) ⇒

HTTP GET: session get unseen session notification count

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpGetUnseenNotificationAndUpdate(db) ⇒

HTTP GET: session update all session notifications to be SEEN

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpPostSaveSessionKeyValue(db) ⇒

HTTP POST: save session key value

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpPostCluster(db) ⇒

HTTP POST: cluster

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpPostForcedExternal(db) ⇒ function

Handles a POST request to retrieve forced external storage options.

This function is designed to be used as a middleware in an Express.js route. It extracts the session ID from the request, queries the database for package information associated with that session, and then retrieves forced external storage options for the identified package. The results are sent back to the client as a JSON response.

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: function - An asynchronous function that takes Express.js request and response objects.

Param Type Description
db Object The database connection object.

REST API: user data~httpPostAttributeUpdate(db) ⇒

HTTP POST attribute update

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpPostCommandUpdate(db) ⇒

HTTP POST: command update

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpPostEventUpdate(db) ⇒

HTTP POST: command update

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpGetInitialState(db) ⇒

HTTP GET: initial state

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpGetOption(db) ⇒

HTTP GET: option

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpGetUiOptions(db) ⇒

HTTP GET: ui_options

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: UI options from all packages.

Param Type
db *

REST API: user data~httpGetPackages()

HTTP GET: Project packages

Kind: inner method of [REST API: user data](#module_REST API_ user data)

REST API: user data~httpGetAllPackages()

HTTP GET: All Packages

Kind: inner method of [REST API: user data](#module_REST API_ user data)

REST API: user data~httpPostAddNewPackage()

HTTP POST: Add new project package

Kind: inner method of [REST API: user data](#module_REST 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](#module_REST API_ user data)

REST API: user data~commandDefaults(db, endpointTypeIdList, sharedClusterList, packageIds) ⇒

Get shared command defaults across endpoints.

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: sharedCmdDefaults

Param Type
db *
endpointTypeIdList *
sharedClusterList *
packageIds *

REST API: user data~writeCommandDefaults(db, defaults)

Insert command defaults into the database.

Kind: inner method of [REST API: user data](#module_REST API_ user data)

Param Type
db *
defaults *

REST API: user data~attributeDefaults(db, endpointTypeIdList, sharedClusterList, packageIds) ⇒

Shared attribute defaults across endpoints.

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: sharedAttributeDefaults

Param Type
db *
endpointTypeIdList *
sharedClusterList *
packageIds *

REST API: user data~writeAttributeDefaults(db, defaults)

Write attribute defaults.

Kind: inner method of [REST API: user data](#module_REST API_ user data)

Param Type
db *
defaults *

REST API: user data~commandEquals(a, b) ⇒

Compares 2 commands for equality.

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: boolean

Param Type
a *
b *

REST API: user data~attributeEquals(a, b) ⇒

Compares 2 attributes for equality.

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: boolean

Param Type
a *
b *

REST API: user data~httpDeleteSessionPackage(db) ⇒

Delete the session package.

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: HTTP Response for delete operation

Param Type
db *

REST API: user data~httpPostDuplicateEndpoint(db) ⇒

Creating a duplicate for endpoint

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: newly created endpoint id

Param Type
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](#module_REST API_ user data)
Returns: newly created endpoint-type id

Param Type
db *

REST API: user data~httpPatchUpdateBitOfFeatureMapAttribute(db) ⇒

Update feature map attribute with given new value

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: status of the update

Param Type
db *

REST API: user data~httpGetConformDataExists(db) ⇒

Check if conformance data exists in the database

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: boolean value of data exist or not

Param Type
db *

REST API: user data~httpPostRequiredElementWarning(db) ⇒

Set warning for the required element, and delete its existing warning if any.

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: response of setting the warning notification

Param Type
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](#module_REST API_ user data)

Param Type
db *
oldEndpointTypeId *
newEndpointTypeId *

Export API: Exports Data into a file.

This module provides the functionality that reads the ZAP data from a database and exports it into a file.

zap file

Formats ZAP file in a certain format.

  • [zap file](#Format API_ Formats .module_zap file)
    • [~unpackAttribute(a)](#Format API_ Formats .module_zap file..unpackAttribute) ⇒
    • [~packAttribute(a)](#Format API_ Formats .module_zap file..packAttribute) ⇒
    • [~unpackCommand(c)](#Format API_ Formats .module_zap file..unpackCommand) ⇒
    • [~packCommand(cmd)](#Format API_ Formats .module_zap file..packCommand) ⇒
    • [~unpackEvent(ev)](#Format API_ Formats .module_zap file..unpackEvent) ⇒
    • [~packEvent(ev)](#Format API_ Formats .module_zap file..packEvent) ⇒
    • [~unpackKeyValuePairs(keyValuePairs)](#Format API_ Formats .module_zap file..unpackKeyValuePairs) ⇒
    • [~packKeyValuePairs(keyValuePairs)](#Format API_ Formats .module_zap file..packKeyValuePairs) ⇒
    • [~cleanseCluster(c)](#Format API_ Formats .module_zap file..cleanseCluster)
    • [~uncleanseCluster(c)](#Format API_ Formats .module_zap file..uncleanseCluster)
    • [~convertToFile(state, fileFormat)](#Format API_ Formats .module_zap file..convertToFile)
    • [~updateCommands(cluster, clusterToCommandMap)](#Format API_ Formats .module_zap file..updateCommands) ⇒
    • [~convertFromFile()](#Format API_ Formats .module_zap file..convertFromFile)

zap file~unpackAttribute(a) ⇒

Converts attribute storage string to internal representation

Kind: inner method of [zap file](#Format API_ Formats .module_zap file)
Returns: attribute object

Param Type
a *

zap file~packAttribute(a) ⇒

Converts attribute object for internal representation.

Kind: inner method of [zap file](#Format API_ Formats .module_zap file)
Returns: string

Param Type
a *

zap file~unpackCommand(c) ⇒

Converts command storage string to internal representation

Kind: inner method of [zap file](#Format API_ Formats .module_zap file)
Returns: command object

Param Type
c *

zap file~packCommand(cmd) ⇒

Converts command object for file representation.

Kind: inner method of [zap file](#Format API_ Formats .module_zap file)
Returns: string

Param Type
cmd *

zap file~unpackEvent(ev) ⇒

Convert string representation to internal object representation

Kind: inner method of [zap file](#Format API_ Formats .module_zap file)
Returns: event object

Param Type
ev *

zap file~packEvent(ev) ⇒

Converts event object for file representation

Kind: inner method of [zap file](#Format API_ Formats .module_zap file)
Returns: String

Param Type
ev *

zap file~unpackKeyValuePairs(keyValuePairs) ⇒

Converts the key value pairs in the file into internal representation

Kind: inner method of [zap file](#Format API_ Formats .module_zap file)
Returns: array of objects

Param Type
keyValuePairs *

zap file~packKeyValuePairs(keyValuePairs) ⇒

Packs key value pairs for extenrnal representation

Kind: inner method of [zap file](#Format API_ Formats .module_zap file)
Returns: none

Param Type
keyValuePairs *

zap file~cleanseCluster(c)

Cleanses toplevel cluster data.

Kind: inner method of [zap file](#Format API_ Formats .module_zap file)

Param Type
c *

zap file~uncleanseCluster(c)

Uncleanses the toplevel cluster data.

Kind: inner method of [zap file](#Format API_ Formats .module_zap file)

Param Type
c *

zap file~convertToFile(state, fileFormat)

This function gets the state from database and converts it for a given file format.

Kind: inner method of [zap file](#Format API_ Formats .module_zap file)

Param Type
state *
fileFormat *

zap file~updateCommands(cluster, clusterToCommandMap) ⇒

Updates the clusters with the new command format where there is isIncoming and isEnabled instead of incoming and outgoing

Kind: inner method of [zap file](#Format API_ Formats .module_zap file)
Returns: state or null

Param Type
cluster *
clusterToCommandMap *

zap file~convertFromFile()

This function gets the JSON from the file, and converts it to the correct database state

Kind: inner method of [zap file](#Format API_ Formats .module_zap file)

Import API: Imports data from a file.

This module provides the functionality that reads a .isc file

Import API: Imports data from a file.

This module provides the functionality that reads a .json(.zap) file

Import API: Imports data from a file.

This file provides the functionality that reads the ZAP data from a JSON file and imports it into a database.

Timer API: initializes times.

This module provides the APIs for initializing timers specifically for sessions.

Startup API: initializes times.

This file contains various startup modes.

watchdog API: initializes times.

This file contains watchdogs.

REST API: admin functions

This module provides the REST API to the admin functions.

  • [REST API: admin functions](#module_REST API_ admin functions)
    • [~httpPostSql(db, app)](#module_REST API_ admin functions..httpPostSql) ⇒
    • [~httpGetVersion(db)](#module_REST API_ admin functions..httpGetVersion) ⇒
    • [~httpGetCache(db)](#module_REST API_ admin functions..httpGetCache)

REST API: admin functions~httpPostSql(db, app) ⇒

API: /sql Request JSON:

  {
    sql: SQL Query
  }

Response JSON:

  {
    result: Array of rows.
  }

Kind: inner method of [REST API: admin functions](#module_REST API_ admin functions)
Returns: callback for the express uri registration

Param Type
db *
app *

REST API: admin functions~httpGetVersion(db) ⇒

API: /version Response JSON:

  {
    version: full version.
    featureLevel: feature level.
    hash: git hash code
    timestamp: Unix time from the last commit in the repo.
    date: Date of the last commit in the repo.
  }

Kind: inner method of [REST API: admin functions](#module_REST API_ admin functions)
Returns: callback for the express uri registration.

Param Type
db *

REST API: admin functions~httpGetCache(db)

API: /cache Response JSON:

	 {
     keys: 0,    // global key count
     hits: 0,    // global hit count
     misses: 0,  // global miss count
     ksize: 0,   // global key size count in approximately bytes
     vsize: 0    // global value size count in approximately bytes
	 }

Kind: inner method of [REST API: admin functions](#module_REST API_ admin functions)

Param Type
db *

REST API: endpoint

This module provides the REST API to the user specific data.

  • [REST API: endpoint](#module_REST API_ endpoint)
    • [~httpDeleteEndpoint(db)](#module_REST API_ endpoint..httpDeleteEndpoint) ⇒
    • [~httpDeleteEndpointType(db)](#module_REST API_ endpoint..httpDeleteEndpointType) ⇒
    • [~httpPostEndpoint(db)](#module_REST API_ endpoint..httpPostEndpoint) ⇒
    • [~httpPatchEndpoint(db)](#module_REST API_ endpoint..httpPatchEndpoint) ⇒
    • [~httpPostEndpointType(db)](#module_REST API_ endpoint..httpPostEndpointType) ⇒
    • [~httpGetInitialComposition(db)](#module_REST API_ endpoint..httpGetInitialComposition) ⇒ function
    • [~httpPatchEndpointType(db)](#module_REST API_ endpoint..httpPatchEndpointType) ⇒

REST API: endpoint~httpDeleteEndpoint(db) ⇒

HTTP DELETE: endpoint

Kind: inner method of [REST API: endpoint](#module_REST API_ endpoint)
Returns: callback for the express uri registration

Param Type
db *

REST API: endpoint~httpDeleteEndpointType(db) ⇒

HTTP DELETE: endpoint type

Kind: inner method of [REST API: endpoint](#module_REST API_ endpoint)
Returns: callback for the express uri registration

Param Type
db *

REST API: endpoint~httpPostEndpoint(db) ⇒

HTTP POST: endpoint

Kind: inner method of [REST API: endpoint](#module_REST API_ endpoint)
Returns: callback for the express uri registration

Param Type
db *

REST API: endpoint~httpPatchEndpoint(db) ⇒

HTTP POST: endpoint

Kind: inner method of [REST API: endpoint](#module_REST API_ endpoint)
Returns: callback for the express uri registration

Param Type Description
db * Main database to use for the operation.

REST API: endpoint~httpPostEndpointType(db) ⇒

HTTP POST endpoint type

Kind: inner method of [REST API: endpoint](#module_REST API_ endpoint)
Returns: callback for the express uri registration

Param Type
db *

REST API: endpoint~httpGetInitialComposition(db) ⇒ function

Handles the HTTP GET request to retrieve the root node.

Kind: inner method of [REST API: endpoint](#module_REST API_ endpoint)
Returns: function - - An async function that handles the HTTP request and response.

Param Type Description
db Object The database connection object.

REST API: endpoint~httpPatchEndpointType(db) ⇒

HTTP POST: endpoint type update

Kind: inner method of [REST API: endpoint](#module_REST API_ endpoint)
Returns: callback for the express uri registration

Param Type
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](#module_REST API_ generation functions)
    • [~httpGetPreviewNameIndex(db)](#module_REST API_ generation functions..httpGetPreviewNameIndex) ⇒
    • [~httpGetPreviewName(db)](#module_REST API_ generation functions..httpGetPreviewName) ⇒
    • [~httpGetPreview(db)](#module_REST API_ generation functions..httpGetPreview) ⇒
    • [~httpPutGenerate(db)](#module_REST API_ generation functions..httpPutGenerate) ⇒
    • [~httpGetComponentTree(db)](#module_REST API_ generation functions..httpGetComponentTree) ⇒
    • [~httpPostComponentUpdateHandler(db, request, response, add)](#module_REST API_ generation functions..httpPostComponentUpdateHandler)
    • [~httpPostComponentAdd(db)](#module_REST API_ generation functions..httpPostComponentAdd)
    • [~httpPostComponentRemove(db)](#module_REST API_ generation functions..httpPostComponentRemove) ⇒

REST API: generation functions~httpGetPreviewNameIndex(db) ⇒

HTTP GET: preview single file with index.

Kind: inner method of [REST API: generation functions](#module_REST API_ generation functions)
Returns: callback for the express uri registration

Param Type
db *

REST API: generation functions~httpGetPreviewName(db) ⇒

HTTP GET: Preview a single file.

Kind: inner method of [REST API: generation functions](#module_REST API_ generation functions)
Returns: callback for the express uri registration

Param Type
db *

REST API: generation functions~httpGetPreview(db) ⇒

HTTP GET: total preview object.

Kind: inner method of [REST API: generation functions](#module_REST API_ generation functions)
Returns: callback for the express uri registration

Param Type
db *

REST API: generation functions~httpPutGenerate(db) ⇒

HTTP PUT: performs local generation into a specified directory.

Kind: inner method of [REST API: generation functions](#module_REST API_ generation functions)
Returns: callback for the express uri registration

Param Type
db *

REST API: generation functions~httpGetComponentTree(db) ⇒

Get component tree.

Kind: inner method of [REST API: generation functions](#module_REST API_ generation functions)
Returns: Response data

Param Type
db *

REST API: generation functions~httpPostComponentUpdateHandler(db, request, response, add)

Update component.

Kind: inner method of [REST API: generation functions](#module_REST API_ generation functions)

Param Type
db *
request *
response *
add *

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](#module_REST API_ generation functions)

Param Type
db *

REST API: generation functions~httpPostComponentRemove(db) ⇒

Remove component.

Kind: inner method of [REST API: generation functions](#module_REST API_ generation functions)
Returns: Promise of component removed

Param Type
db *

REST API: generation functions

This module provides the REST API to the IDE component handling.

  • [REST API: generation functions](#module_REST API_ generation functions)
    • [~httpGetPreviewNameIndex(db)](#module_REST API_ generation functions..httpGetPreviewNameIndex) ⇒
    • [~httpGetPreviewName(db)](#module_REST API_ generation functions..httpGetPreviewName) ⇒
    • [~httpGetPreview(db)](#module_REST API_ generation functions..httpGetPreview) ⇒
    • [~httpPutGenerate(db)](#module_REST API_ generation functions..httpPutGenerate) ⇒
    • [~httpGetComponentTree(db)](#module_REST API_ generation functions..httpGetComponentTree) ⇒
    • [~httpPostComponentUpdateHandler(db, request, response, add)](#module_REST API_ generation functions..httpPostComponentUpdateHandler)
    • [~httpPostComponentAdd(db)](#module_REST API_ generation functions..httpPostComponentAdd)
    • [~httpPostComponentRemove(db)](#module_REST API_ generation functions..httpPostComponentRemove) ⇒

REST API: generation functions~httpGetPreviewNameIndex(db) ⇒

HTTP GET: preview single file with index.

Kind: inner method of [REST API: generation functions](#module_REST API_ generation functions)
Returns: callback for the express uri registration

Param Type
db *

REST API: generation functions~httpGetPreviewName(db) ⇒

HTTP GET: Preview a single file.

Kind: inner method of [REST API: generation functions](#module_REST API_ generation functions)
Returns: callback for the express uri registration

Param Type
db *

REST API: generation functions~httpGetPreview(db) ⇒

HTTP GET: total preview object.

Kind: inner method of [REST API: generation functions](#module_REST API_ generation functions)
Returns: callback for the express uri registration

Param Type
db *

REST API: generation functions~httpPutGenerate(db) ⇒

HTTP PUT: performs local generation into a specified directory.

Kind: inner method of [REST API: generation functions](#module_REST API_ generation functions)
Returns: callback for the express uri registration

Param Type
db *

REST API: generation functions~httpGetComponentTree(db) ⇒

Get component tree.

Kind: inner method of [REST API: generation functions](#module_REST API_ generation functions)
Returns: Response data

Param Type
db *

REST API: generation functions~httpPostComponentUpdateHandler(db, request, response, add)

Update component.

Kind: inner method of [REST API: generation functions](#module_REST API_ generation functions)

Param Type
db *
request *
response *
add *

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](#module_REST API_ generation functions)

Param Type
db *

REST API: generation functions~httpPostComponentRemove(db) ⇒

Remove component.

Kind: inner method of [REST API: generation functions](#module_REST API_ generation functions)
Returns: Promise of component removed

Param Type
db *

REST API: initialization functions

This module provides the REST API to the session initialization

  • [REST API: initialization functions](#module_REST API_ initialization functions)
    • [~sessionAttempt(db)](#module_REST API_ initialization functions..sessionAttempt) ⇒
    • [~sessionCreate(db)](#module_REST API_ initialization functions..sessionCreate) ⇒
    • [~initializeSession(db, options:)](#module_REST API_ initialization functions..initializeSession) ⇒
    • [~loadPreviousSessions(db)](#module_REST API_ initialization functions..loadPreviousSessions) ⇒
    • [~init(db)](#module_REST API_ initialization functions..init) ⇒

REST API: initialization functions~sessionAttempt(db) ⇒

This function returns Properties, Templates and Dirty-Sessions

Kind: inner method of [REST API: initialization functions](#module_REST API_ initialization functions)
Returns: An async function that handles HTTP requests

Param Type Description
db * The database connection object

REST API: initialization functions~sessionCreate(db) ⇒

This function creates a new session.

Kind: inner method of [REST API: initialization functions](#module_REST API_ initialization functions)
Returns: An async function that handles HTTP requests. The function extracts session parameters from the request, ensures the user and session exist in the database, and populates the session options with the provided packages.

Param Type Description
db * The database connection object

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](#module_REST API_ initialization functions)
Returns: A success message.

Param Type Description
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](#module_REST API_ initialization functions)
Returns: A success message.

Param Type
db *

REST API: initialization functions~init(db) ⇒

Init function from the App.vue

Kind: inner method of [REST API: initialization functions](#module_REST API_ initialization functions)
Returns: A success message.

Param Type
db *

REST API: static zcl functions

This module provides the REST API to the static zcl queries.

  • [REST API: static zcl functions](#module_REST API_ static zcl functions)
    • [~zclEntityQuery(selectAllFunction, selectByIdFunction)](#module_REST API_ static zcl functions..zclEntityQuery) ⇒
    • [~returnZclEntitiesForClusterId(db, clusterId, packageId)](#module_REST API_ static zcl functions..returnZclEntitiesForClusterId) ⇒
    • [~mergeZclClusterAttributeCommandEventFeatureData(accumulated, currentValue)](#module_REST API_ static zcl functions..mergeZclClusterAttributeCommandEventFeatureData) ⇒
    • [~reduceAndConcatenateZclEntity(db, id, packageIdArray, zclQueryCallback, mergeFunction, defaultValue)](#module_REST API_ static zcl functions..reduceAndConcatenateZclEntity) ⇒
    • [~parseForZclData(db, entity, id, packageIdArray)](#module_REST API_ static zcl functions..parseForZclData) ⇒
    • [~httpGetZclEntity(app)](#module_REST API_ static zcl functions..httpGetZclEntity)
    • [~httpGetZclExtension(db)](#module_REST API_ static zcl functions..httpGetZclExtension) ⇒

REST API: static zcl functions~zclEntityQuery(selectAllFunction, selectByIdFunction) ⇒

This function builds a function that has the following skeleton. This is used to simplify all the logic where we have selectAll and selectById for each of the different ZCL entities.

Kind: inner method of [REST API: static zcl functions](#module_REST API_ static zcl functions)
Returns: a certain function based on given arguments to them.

Param Type
selectAllFunction *
selectByIdFunction *

REST API: static zcl functions~returnZclEntitiesForClusterId(db, clusterId, packageId) ⇒

For the CLUSTER path, we have special handling to also sideload attributes, commands, events, and features relevant to that cluster.

Kind: inner method of [REST API: static zcl functions](#module_REST API_ static zcl functions)
Returns: zcl entities

Param Type
db *
clusterId *
packageId *

REST API: static zcl functions~mergeZclClusterAttributeCommandEventFeatureData(accumulated, currentValue) ⇒

This is the special merge function used for the CLUSTER path

Kind: inner method of [REST API: static zcl functions](#module_REST API_ static zcl functions)
Returns: ZCL entity details object

Param Type
accumulated *
currentValue *

REST API: static zcl functions~reduceAndConcatenateZclEntity(db, id, packageIdArray, zclQueryCallback, mergeFunction, defaultValue) ⇒

This maps over each packageId, and runs the query callback.

Kind: inner method of [REST API: static zcl functions](#module_REST API_ static zcl functions)
Returns: zcl entities

Param Type
db *
id *
packageIdArray *
zclQueryCallback *
mergeFunction *
defaultValue *

REST API: static zcl functions~parseForZclData(db, entity, id, packageIdArray) ⇒

Get entity details based on given information.

Kind: inner method of [REST API: static zcl functions](#module_REST API_ static zcl functions)
Returns: Promise of entity details

Param Type
db *
entity *
id *
packageIdArray *

REST API: static zcl functions~httpGetZclEntity(app)

API: /zcl/:entity/:id

Kind: inner method of [REST API: static zcl functions](#module_REST API_ static zcl functions)

Param Type Description
app * Express instance.

REST API: static zcl functions~httpGetZclExtension(db) ⇒

API: /zclExtension/:entity/:extension

Kind: inner method of [REST API: static zcl functions](#module_REST API_ static zcl functions)
Returns: zcl extension handler

Param Type
db *

REST API: user data

This module provides the REST API to the user specific data.

  • [REST API: user data](#module_REST API_ user data)
    • [~getComponentIdsByCluster(db, sessionId, clusterId, side)](#module_REST API_ user data..getComponentIdsByCluster) ⇒ *
    • [~httpGetSessionKeyValues(db)](#module_REST API_ user data..httpGetSessionKeyValues) ⇒
    • [~httpGetEndpointIds(db)](#module_REST API_ user data..httpGetEndpointIds) ⇒
    • [~httpGetDeviceTypeFeatures(db)](#module_REST API_ user data..httpGetDeviceTypeFeatures) ⇒
    • [~httpPostCheckConformOnFeatureUpdate(db)](#module_REST API_ user data..httpPostCheckConformOnFeatureUpdate) ⇒
    • [~httpGetRequiredElements(db)](#module_REST API_ user data..httpGetRequiredElements) ⇒
    • [~httpGetFeatureMapValue(db)](#module_REST API_ user data..httpGetFeatureMapValue)
    • [~httpGetSessionNotifications(db)](#module_REST API_ user data..httpGetSessionNotifications) ⇒
    • [~httpDeleteSessionNotification(db)](#module_REST API_ user data..httpDeleteSessionNotification) ⇒
    • [~httpGetPackageNotifications(db)](#module_REST API_ user data..httpGetPackageNotifications) ⇒
    • [~httpGetPackageNotificationsByPackageId(db)](#module_REST API_ user data..httpGetPackageNotificationsByPackageId) ⇒
    • [~httpDeletePackageNotification(db)](#module_REST API_ user data..httpDeletePackageNotification) ⇒
    • [~httpGetUnseenNotificationCount(db)](#module_REST API_ user data..httpGetUnseenNotificationCount) ⇒
    • [~httpGetUnseenNotificationAndUpdate(db)](#module_REST API_ user data..httpGetUnseenNotificationAndUpdate) ⇒
    • [~httpPostSaveSessionKeyValue(db)](#module_REST API_ user data..httpPostSaveSessionKeyValue) ⇒
    • [~httpPostCluster(db)](#module_REST API_ user data..httpPostCluster) ⇒
    • [~httpPostForcedExternal(db)](#module_REST API_ user data..httpPostForcedExternal) ⇒ function
    • [~httpPostAttributeUpdate(db)](#module_REST API_ user data..httpPostAttributeUpdate) ⇒
    • [~httpPostCommandUpdate(db)](#module_REST API_ user data..httpPostCommandUpdate) ⇒
    • [~httpPostEventUpdate(db)](#module_REST API_ user data..httpPostEventUpdate) ⇒
    • [~httpGetInitialState(db)](#module_REST API_ user data..httpGetInitialState) ⇒
    • [~httpGetOption(db)](#module_REST API_ user data..httpGetOption) ⇒
    • [~httpGetUiOptions(db)](#module_REST API_ user data..httpGetUiOptions) ⇒
    • [~httpGetPackages()](#module_REST API_ user data..httpGetPackages)
    • [~httpGetAllPackages()](#module_REST API_ user data..httpGetAllPackages)
    • [~httpPostAddNewPackage()](#module_REST API_ user data..httpPostAddNewPackage)
    • [~httpPostShareClusterStatesAcrossEndpoints()](#module_REST API_ user data..httpPostShareClusterStatesAcrossEndpoints)
    • [~commandDefaults(db, endpointTypeIdList, sharedClusterList, packageIds)](#module_REST API_ user data..commandDefaults) ⇒
    • [~writeCommandDefaults(db, defaults)](#module_REST API_ user data..writeCommandDefaults)
    • [~attributeDefaults(db, endpointTypeIdList, sharedClusterList, packageIds)](#module_REST API_ user data..attributeDefaults) ⇒
    • [~writeAttributeDefaults(db, defaults)](#module_REST API_ user data..writeAttributeDefaults)
    • [~commandEquals(a, b)](#module_REST API_ user data..commandEquals) ⇒
    • [~attributeEquals(a, b)](#module_REST API_ user data..attributeEquals) ⇒
    • [~httpDeleteSessionPackage(db)](#module_REST API_ user data..httpDeleteSessionPackage) ⇒
    • [~httpPostDuplicateEndpoint(db)](#module_REST API_ user data..httpPostDuplicateEndpoint) ⇒
    • [~httpPostDuplicateEndpointType(db)](#module_REST API_ user data..httpPostDuplicateEndpointType) ⇒
    • [~httpPatchUpdateBitOfFeatureMapAttribute(db)](#module_REST API_ user data..httpPatchUpdateBitOfFeatureMapAttribute) ⇒
    • [~httpGetConformDataExists(db)](#module_REST API_ user data..httpGetConformDataExists) ⇒
    • [~httpPostRequiredElementWarning(db)](#module_REST API_ user data..httpPostRequiredElementWarning) ⇒
    • [~duplicateEndpointTypeClusters(db, oldEndpointTypeId, newEndpointTypeId)](#module_REST 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](#module_REST API_ user data)
Returns: * - array of componentIds

Param Type
db *
sessionId *
clusterId *
side *

REST API: user data~httpGetSessionKeyValues(db) ⇒

HTTP GET: session key values

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpGetEndpointIds(db) ⇒

HTTP GET: endpoint ids of endpoints within a specified session

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpGetDeviceTypeFeatures(db) ⇒

HTTP GET: device type features

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpPostCheckConformOnFeatureUpdate(db) ⇒

HTTP POST: elements to be updated after toggle a device type feature

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpGetRequiredElements(db) ⇒

HTTP GET: required and unsupported cluster elements based on conformance

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpGetFeatureMapValue(db)

HTTP GET: the value of feature map attribute in an endpoint type cluster

Kind: inner method of [REST API: user data](#module_REST API_ user data)

Param Type
db *

REST API: user data~httpGetSessionNotifications(db) ⇒

HTTP GET: session get notifications

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpDeleteSessionNotification(db) ⇒

HTTP DELETE: session delete notifications

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpGetPackageNotifications(db) ⇒

HTTP GET: package get notifications

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpGetPackageNotificationsByPackageId(db) ⇒

HTTP GET: package get notifications

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpDeletePackageNotification(db) ⇒

HTTP DELETE: session delete notifications

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpGetUnseenNotificationCount(db) ⇒

HTTP GET: session get unseen session notification count

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpGetUnseenNotificationAndUpdate(db) ⇒

HTTP GET: session update all session notifications to be SEEN

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpPostSaveSessionKeyValue(db) ⇒

HTTP POST: save session key value

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpPostCluster(db) ⇒

HTTP POST: cluster

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpPostForcedExternal(db) ⇒ function

Handles a POST request to retrieve forced external storage options.

This function is designed to be used as a middleware in an Express.js route. It extracts the session ID from the request, queries the database for package information associated with that session, and then retrieves forced external storage options for the identified package. The results are sent back to the client as a JSON response.

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: function - An asynchronous function that takes Express.js request and response objects.

Param Type Description
db Object The database connection object.

REST API: user data~httpPostAttributeUpdate(db) ⇒

HTTP POST attribute update

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpPostCommandUpdate(db) ⇒

HTTP POST: command update

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpPostEventUpdate(db) ⇒

HTTP POST: command update

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpGetInitialState(db) ⇒

HTTP GET: initial state

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpGetOption(db) ⇒

HTTP GET: option

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: callback for the express uri registration

Param Type
db *

REST API: user data~httpGetUiOptions(db) ⇒

HTTP GET: ui_options

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: UI options from all packages.

Param Type
db *

REST API: user data~httpGetPackages()

HTTP GET: Project packages

Kind: inner method of [REST API: user data](#module_REST API_ user data)

REST API: user data~httpGetAllPackages()

HTTP GET: All Packages

Kind: inner method of [REST API: user data](#module_REST API_ user data)

REST API: user data~httpPostAddNewPackage()

HTTP POST: Add new project package

Kind: inner method of [REST API: user data](#module_REST 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](#module_REST API_ user data)

REST API: user data~commandDefaults(db, endpointTypeIdList, sharedClusterList, packageIds) ⇒

Get shared command defaults across endpoints.

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: sharedCmdDefaults

Param Type
db *
endpointTypeIdList *
sharedClusterList *
packageIds *

REST API: user data~writeCommandDefaults(db, defaults)

Insert command defaults into the database.

Kind: inner method of [REST API: user data](#module_REST API_ user data)

Param Type
db *
defaults *

REST API: user data~attributeDefaults(db, endpointTypeIdList, sharedClusterList, packageIds) ⇒

Shared attribute defaults across endpoints.

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: sharedAttributeDefaults

Param Type
db *
endpointTypeIdList *
sharedClusterList *
packageIds *

REST API: user data~writeAttributeDefaults(db, defaults)

Write attribute defaults.

Kind: inner method of [REST API: user data](#module_REST API_ user data)

Param Type
db *
defaults *

REST API: user data~commandEquals(a, b) ⇒

Compares 2 commands for equality.

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: boolean

Param Type
a *
b *

REST API: user data~attributeEquals(a, b) ⇒

Compares 2 attributes for equality.

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: boolean

Param Type
a *
b *

REST API: user data~httpDeleteSessionPackage(db) ⇒

Delete the session package.

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: HTTP Response for delete operation

Param Type
db *

REST API: user data~httpPostDuplicateEndpoint(db) ⇒

Creating a duplicate for endpoint

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: newly created endpoint id

Param Type
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](#module_REST API_ user data)
Returns: newly created endpoint-type id

Param Type
db *

REST API: user data~httpPatchUpdateBitOfFeatureMapAttribute(db) ⇒

Update feature map attribute with given new value

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: status of the update

Param Type
db *

REST API: user data~httpGetConformDataExists(db) ⇒

Check if conformance data exists in the database

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: boolean value of data exist or not

Param Type
db *

REST API: user data~httpPostRequiredElementWarning(db) ⇒

Set warning for the required element, and delete its existing warning if any.

Kind: inner method of [REST API: user data](#module_REST API_ user data)
Returns: response of setting the warning notification

Param Type
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](#module_REST API_ user data)

Param Type
db *
oldEndpointTypeId *
newEndpointTypeId *

JS API: Matter specific APIs.

This module contains Matter specific APIs.

JS API: http server

This module provides the HTTP server functionality.

  • [JS API: http server](#module_JS API_ http server)
    • [~registerRestApi(filename, db, app)](#module_JS API_ http server..registerRestApi)
    • [~registerAllRestModules(db, app)](#module_JS API_ http server..registerAllRestModules)
    • [~initHttpServer(db, port)](#module_JS API_ http server..initHttpServer) ⇒
    • [~userSessionHandler(db, options)](#module_JS API_ http server..userSessionHandler) ⇒
    • [~shutdownHttpServer()](#module_JS API_ http server..shutdownHttpServer) ⇒
    • [~shutdownHttpServerSync()](#module_JS API_ http server..shutdownHttpServerSync) ⇒
    • [~httpServerPort()](#module_JS API_ http server..httpServerPort) ⇒
    • [~httpServerUrl()](#module_JS API_ http server..httpServerUrl) ⇒
    • [~httpServerStartupMessage()](#module_JS 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](#module_JS API_ http server)

Param Type
filename *
db *
app *

JS API: http server~registerAllRestModules(db, app)

Register all REST modeules.

Kind: inner method of [JS API: http server](#module_JS API_ http server)

Param Type
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](#module_JS API_ http server)
Returns: A promise that resolves with an express app.

Param Type Description
db * Database object to use.
port * Port for the HTTP server.

JS API: http server~userSessionHandler(db, options) ⇒

Handle user session.

Kind: inner method of [JS API: http server](#module_JS API_ http server)
Returns: function

Param Type
db *
options *

JS API: http server~shutdownHttpServer() ⇒

Promises to shut down the http server.

Kind: inner method of [JS API: http server](#module_JS 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](#module_JS 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](#module_JS API_ http server)
Returns: port

JS API: http server~httpServerUrl() ⇒

Returns the URL of the server.

Kind: inner method of [JS API: http server](#module_JS 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](#module_JS API_ http server)

IPC Server API: Inter-process communication

This module provides IPC Server functionality.

  • [IPC Server API: Inter-process communication](#module_IPC Server API_ Inter-process communication)
    • [~socketPath()](#module_IPC Server API_ Inter-process communication..socketPath)
    • [~log(msg)](#module_IPC Server API_ Inter-process communication..log)
    • [~handlerPing(context, data)](#module_IPC Server API_ Inter-process communication..handlerPing)
    • [~handlerServerStatus(context)](#module_IPC Server API_ Inter-process communication..handlerServerStatus)
    • [~handlerConvert(context, data)](#module_IPC Server API_ Inter-process communication..handlerConvert)
    • [~handlerStop(context, data)](#module_IPC Server API_ Inter-process communication..handlerStop)
    • [~handlerGenerate(context, data)](#module_IPC Server API_ Inter-process communication..handlerGenerate) ⇒
    • [~preHandler()](#module_IPC Server API_ Inter-process communication..preHandler)
    • [~initServer(options)](#module_IPC Server API_ Inter-process communication..initServer)
    • [~isServerRunning()](#module_IPC Server API_ Inter-process communication..isServerRunning) ⇒
    • [~shutdownServerSync(isServer)](#module_IPC Server API_ Inter-process communication..shutdownServerSync)

IPC Server API: Inter-process communication~socketPath()

Returns the socket path for the IPC.

Kind: inner method of [IPC Server API: Inter-process communication](#module_IPC Server API_ Inter-process communication)

IPC Server API: Inter-process communication~log(msg)

Log IPC message.

Kind: inner method of [IPC Server API: Inter-process communication](#module_IPC Server API_ Inter-process communication)

Param Type
msg *

IPC Server API: Inter-process communication~handlerPing(context, data)

Ping IPC server.

Kind: inner method of [IPC Server API: Inter-process communication](#module_IPC Server API_ Inter-process communication)

Param Type
context *
data *

IPC Server API: Inter-process communication~handlerServerStatus(context)

Get IPC server status.

Kind: inner method of [IPC Server API: Inter-process communication](#module_IPC Server API_ Inter-process communication)

Param Type
context *

IPC Server API: Inter-process communication~handlerConvert(context, data)

Convert zap files.

Kind: inner method of [IPC Server API: Inter-process communication](#module_IPC Server API_ Inter-process communication)

Param Type
context *
data *

IPC Server API: Inter-process communication~handlerStop(context, data)

Shut down IPC server.

Kind: inner method of [IPC Server API: Inter-process communication](#module_IPC Server API_ Inter-process communication)

Param Type
context *
data *

IPC Server API: Inter-process communication~handlerGenerate(context, data) ⇒

Data contains: zapFileArray, outputPattern, zcl, template

Kind: inner method of [IPC Server API: Inter-process communication](#module_IPC Server API_ Inter-process communication)
Returns: Promise of generation

Param Type
context *
data *

IPC Server API: Inter-process communication~preHandler()

Runs just before every time IPC request is processed.

Kind: inner method of [IPC Server API: Inter-process communication](#module_IPC Server API_ Inter-process communication)

IPC Server API: Inter-process communication~initServer(options)

IPC initialization.

Kind: inner method of [IPC Server API: Inter-process communication](#module_IPC Server API_ Inter-process communication)
Parem: * isServer 'true' if this is a server, 'false' for client.

Param Type
options *

IPC Server API: Inter-process communication~isServerRunning() ⇒

Returns true if server is running.

Kind: inner method of [IPC Server API: Inter-process communication](#module_IPC Server API_ Inter-process communication)
Returns: true if server is running.

IPC Server API: Inter-process communication~shutdownServerSync(isServer)

Shuts down the IPC server.

Kind: inner method of [IPC Server API: Inter-process communication](#module_IPC Server API_ Inter-process communication)

Param Type
isServer *

JS API: websocket server

This module provides the HTTP server functionality.

  • [JS API: websocket server](#module_JS API_ websocket server)
    • [~initializeWebSocket(httpServer)](#module_JS API_ websocket server..initializeWebSocket)
    • [~clientSocket(sessionUuid)](#module_JS API_ websocket server..clientSocket)
    • [~sendTick(socket)](#module_JS API_ websocket server..sendTick)
    • [~doSend(socket, object)](#module_JS API_ websocket server..doSend)
    • [~sendWebSocketData(category, payload)](#module_JS API_ websocket server..sendWebSocketData)
    • [~sendWebSocketMessage(msg)](#module_JS API_ websocket server..sendWebSocketMessage)
    • [~onWebSocket(category, listener)](#module_JS 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](#module_JS API_ websocket server)

Param Type
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](#module_JS API_ websocket server)

Param Type
sessionUuid *

JS API: websocket server~sendTick(socket)

Send websocket payload with the tick category.

Kind: inner method of [JS API: websocket server](#module_JS API_ websocket server)

Param Type
socket *

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](#module_JS API_ websocket server)

Param Type
socket *
object *

JS API: websocket server~sendWebSocketData(category, payload)

Send websocket payload with a given category.

Kind: inner method of [JS API: websocket server](#module_JS API_ websocket server)

Param Type
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](#module_JS API_ websocket server)

Param Type
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](#module_JS API_ websocket server)

Param Type Description
category * category of message.
listener * function that receives socket, data.

JS API: About page

This module provides the About page functionality for ZAP.

  • [JS API: About page](#module_JS API_ About page)
    • [~createAboutWindow(parentWindow, port)](#module_JS API_ About page..createAboutWindow)
    • [~createOrShowAboutWindow(port)](#module_JS API_ About page..createOrShowAboutWindow)

JS API: About page~createAboutWindow(parentWindow, port)

Create the about window in ZAP.

Kind: inner method of [JS API: About page](#module_JS API_ About page)

Param Type
parentWindow *
port *

JS API: About page~createOrShowAboutWindow(port)

Call this function to create a new or show an existing preference window.

Kind: inner method of [JS API: About page](#module_JS API_ About page)

Param Type
port *

JS API: renderer API related utilities

  • [JS API: renderer API related utilities](#module_JS API_ renderer API related utilities)
    • [~getSessionUuidFromBrowserWindow(browserWindow)](#module_JS API_ renderer API related utilities..getSessionUuidFromBrowserWindow) ⇒
    • [~getRendererApiInformation(browserWindow)](#module_JS API_ renderer API related utilities..getRendererApiInformation) ⇒
    • [~execRendererApi(browserWindow, rendererApiCommand, ...theArgs)](#module_JS API_ renderer API related utilities..execRendererApi)
    • [~execFileOpen(browserWindow, filePath)](#module_JS API_ renderer API related utilities..execFileOpen) ⇒
    • [~processRendererNotify(message)](#module_JS API_ renderer API related utilities..processRendererNotify) ⇒
    • [~reportFiles(browserWindow, result)](#module_JS API_ renderer API related utilities..reportFiles)
    • [~getUserKeyFromCookieValue(cookieValue)](#module_JS API_ renderer API related utilities..getUserKeyFromCookieValue) ⇒
    • [~getUserKeyFromBrowserCookie(browserCookie)](#module_JS API_ renderer API related utilities..getUserKeyFromBrowserCookie)
    • [~getUserKeyFromBrowserWindow(browserWindow)](#module_JS 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](#module_JS API_ renderer API related utilities)
Returns: session UUID

Param Type
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](#module_JS API_ renderer API related utilities)
Returns: description of renderer api

Param Type
browserWindow *

JS API: renderer API related utilities~execRendererApi(browserWindow, rendererApiCommand, ...theArgs)

Execute RendererApi commands

Kind: inner method of [JS API: renderer API related utilities](#module_JS API_ renderer API related utilities)

Param Type
browserWindow *
rendererApiCommand *
...theArgs any

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](#module_JS API_ renderer API related utilities)
Returns: Result of file open call.

Param Type
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](#module_JS API_ renderer API related utilities)
Returns: true if message was a notify message and was consumed.

Param Type
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](#module_JS API_ renderer API related utilities)

Param Type
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](#module_JS API_ renderer API related utilities)
Returns: cookie value used for user identification

Param Type
cookieValue *

JS API: renderer API related utilities~getUserKeyFromBrowserCookie(browserCookie)

Returns the session key

Kind: inner method of [JS API: renderer API related utilities](#module_JS API_ renderer API related utilities)

Param Type Description
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](#module_JS API_ renderer API related utilities)

Param Type
browserWindow *

JS API: UI Development

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.

JS API: UI

Main UI

  • [JS API: UI](#module_JS API_ UI)
    • [~hookSecondInstanceEvents(argv)](#module_JS API_ UI..hookSecondInstanceEvents)
    • [~hookMainInstanceEvents()](#module_JS API_ UI..hookMainInstanceEvents)

JS API: UI~hookSecondInstanceEvents(argv)

Hook second instance.

Kind: inner method of [JS API: UI](#module_JS API_ UI)

Param Type
argv *

JS API: UI~hookMainInstanceEvents()

Hook up all the events for the electron app object.

Kind: inner method of [JS API: UI](#module_JS API_ UI)

JS API: Menu for ZAP UI

Menu for ZAP UI

  • [JS API: Menu for ZAP UI](#module_JS API_ Menu for ZAP UI)
    • [~getUserSessionInfoMessage(browserWindow)](#module_JS API_ Menu for ZAP UI..getUserSessionInfoMessage) ⇒
    • [~doOpen(menuItem, browserWindow, event)](#module_JS API_ Menu for ZAP UI..doOpen)
    • [~doSave(browserWindow)](#module_JS API_ Menu for ZAP UI..doSave)
    • [~doSaveAs(menuItem, browserWindow, event)](#module_JS API_ Menu for ZAP UI..doSaveAs)
    • [~fileSave(db, browserWindow, filePath)](#module_JS API_ Menu for ZAP UI..fileSave) ⇒
    • [~fileOpen(db, filePaths)](#module_JS API_ Menu for ZAP UI..fileOpen)
    • [~showMenu(httpPort)](#module_JS API_ Menu for ZAP UI..showMenu)
    • [~hideMenu(httpPort)](#module_JS API_ Menu for ZAP UI..hideMenu)
    • [~toggleMenu(port)](#module_JS API_ Menu for ZAP UI..toggleMenu)
    • [~initMenu(httpPort)](#module_JS API_ Menu for ZAP UI..initMenu)

JS API: Menu for ZAP UI~getUserSessionInfoMessage(browserWindow) ⇒

Get the user session information details in a string.

Kind: inner method of [JS API: Menu for ZAP UI](#module_JS API_ Menu for ZAP UI)
Returns: string

Param Type
browserWindow *

JS API: Menu for ZAP UI~doOpen(menuItem, browserWindow, event)

Perform a file->open operation.

Kind: inner method of [JS API: Menu for ZAP UI](#module_JS API_ Menu for ZAP UI)

Param Type
menuItem *
browserWindow *
event *

JS API: Menu for ZAP UI~doSave(browserWindow)

Perform a save, defering to save as if file is not yet selected.

Kind: inner method of [JS API: Menu for ZAP UI](#module_JS API_ Menu for ZAP UI)

Param Type
browserWindow *

JS API: Menu for ZAP UI~doSaveAs(menuItem, browserWindow, event)

Perform save as.

Kind: inner method of [JS API: Menu for ZAP UI](#module_JS API_ Menu for ZAP UI)

Param Type
menuItem *
browserWindow *
event *

JS API: Menu for ZAP UI~fileSave(db, browserWindow, filePath) ⇒

perform the save.

Kind: inner method of [JS API: Menu for ZAP UI](#module_JS API_ Menu for ZAP UI)
Returns: Promise of saving.

Param Type
db *
browserWindow *
filePath *

JS API: Menu for ZAP UI~fileOpen(db, filePaths)

Perform the do open action, possibly reading in multiple files.

Kind: inner method of [JS API: Menu for ZAP UI](#module_JS API_ Menu for ZAP UI)

Param Type
db *
filePaths *

JS API: Menu for ZAP UI~showMenu(httpPort)

Show the menu.

Kind: inner method of [JS API: Menu for ZAP UI](#module_JS API_ Menu for ZAP UI)

Param Type
httpPort *

JS API: Menu for ZAP UI~hideMenu(httpPort)

Hide the menu.

Kind: inner method of [JS API: Menu for ZAP UI](#module_JS API_ Menu for ZAP UI)

Param Type
httpPort *

JS API: Menu for ZAP UI~toggleMenu(port)

Toggling of menu

Kind: inner method of [JS API: Menu for ZAP UI](#module_JS API_ Menu for ZAP UI)

Param Type
port *

JS API: Menu for ZAP UI~initMenu(httpPort)

Initial menu show.

Kind: inner method of [JS API: Menu for ZAP UI](#module_JS API_ Menu for ZAP UI)

Param Type
httpPort *

JS API: Tray for ZAP UI

Tray for ZAP UI

JS API: Tray for ZAP UI~initTray(port) ⇒

Initialize tray.

Kind: inner method of [JS API: Tray for ZAP UI](#module_JS API_ Tray for ZAP UI)
Returns: none

Param Type
port *

JS API: Utility module for ZAP UI

Utility module for ZAP UI

  • [JS API: Utility module for ZAP UI](#module_JS API_ Utility module for ZAP UI)
    • [~showErrorMessage(title, err)](#module_JS API_ Utility module for ZAP UI..showErrorMessage)
    • [~openFileConfiguration(db, filePath, httpPort, zapFileExtensions)](#module_JS API_ Utility module for ZAP UI..openFileConfiguration)
    • [~openNewConfiguration(httpPort, options:)](#module_JS API_ Utility module for ZAP UI..openNewConfiguration)
    • [~toggleDirtyFlag(browserWindow, dirty)](#module_JS API_ Utility module for ZAP UI..toggleDirtyFlag)
    • [~openFileDialogAndReportResult(browserWindow, options)](#module_JS API_ Utility module for ZAP UI..openFileDialogAndReportResult)
    • [~enableUi(port, zapFiles, uiMode, standalone, zapFileExtensions)](#module_JS API_ Utility module for ZAP UI..enableUi) ⇒

JS API: Utility module for ZAP UI~showErrorMessage(title, err)

Simple dialog to show error messages from electron renderer scope.

Kind: inner method of [JS API: Utility module for ZAP UI](#module_JS API_ Utility module for ZAP UI)

Param Type
title *
err *

JS API: Utility module for ZAP UI~openFileConfiguration(db, filePath, httpPort, zapFileExtensions)

Process a single file, parsing it in as JSON and then possibly opening a new window if all is good.

Kind: inner method of [JS API: Utility module for ZAP UI](#module_JS API_ Utility module for ZAP UI)

Param Type Description
db *
filePath *
httpPort * Server port for the URL that will be constructed.
zapFileExtensions * Extend a zap file with zapExtension

JS API: Utility module for ZAP UI~openNewConfiguration(httpPort, options:)

Creates a new window with a blank configuration.

Kind: inner method of [JS API: Utility module for ZAP UI](#module_JS API_ Utility module for ZAP UI)

Param Type Description
httpPort *
options: * uiMode, debugNavBar

JS API: Utility module for ZAP UI~toggleDirtyFlag(browserWindow, dirty)

Toggles the dirty flag.

Kind: inner method of [JS API: Utility module for ZAP UI](#module_JS API_ Utility module for ZAP UI)

Param Type Description
browserWindow * window to affect
dirty * true if this windows is now dirty, false if otherwise

JS API: Utility module for ZAP UI~openFileDialogAndReportResult(browserWindow, options)

This function should be invoked as a result of the fileBrowse notification via the renderer API. It pops the open dialog and reports result back through the API.

Kind: inner method of [JS API: Utility module for ZAP UI](#module_JS API_ Utility module for ZAP UI)

Param Type Description
browserWindow *
options * 'key', 'title', 'mode', 'defaultPath'

JS API: Utility module for ZAP UI~enableUi(port, zapFiles, uiMode, standalone, zapFileExtensions) ⇒

Enable the UI open using the given arguments.

Kind: inner method of [JS API: Utility module for ZAP UI](#module_JS API_ Utility module for ZAP UI)
Returns: promise of a file open configuration

Param Type
port *
zapFiles *
uiMode *
standalone *
zapFileExtensions *

JS API: Window module for ZAP UI

Window module for ZAP UI

  • [JS API: Window module for ZAP UI](#module_JS API_ Window module for ZAP UI)
    • static
      • [.initializeElectronUi(port)](#module_JS API_ Window module for ZAP UI.initializeElectronUi)
      • [.windowCreateIfNotThere(port)](#module_JS API_ Window module for ZAP UI.windowCreateIfNotThere)
      • [.windowCreate(port, filePath, [uiMode])](#module_JS API_ Window module for ZAP UI.windowCreate) ⇒
    • inner
      • [~createQueryString(uiMode, standalone, isNew, filePath, restPort)](#module_JS API_ Window module for ZAP UI..createQueryString) ⇒

JS API: Window module for ZAP UI.initializeElectronUi(port)

Electron UI initialization.

Note: You might be tempted to pass db to this function. Don't. That was done before and it's just a lazy way to cut through the layers between UI and back-end. Should not be done. Any information UI needs from the database should be retrieved via renderer API.

Kind: static method of [JS API: Window module for ZAP UI](#module_JS API_ Window module for ZAP UI)

Param Type
port *

JS API: Window module for ZAP UI.windowCreateIfNotThere(port)

Create a window if none present.

Kind: static method of [JS API: Window module for ZAP UI](#module_JS API_ Window module for ZAP UI)

Param Type
port *

JS API: Window module for ZAP UI.windowCreate(port, filePath, [uiMode]) ⇒

Create a window, possibly with a given file path.

Kind: static method of [JS API: Window module for ZAP UI](#module_JS API_ Window module for ZAP UI)
Returns: BrowserWindow that got created

Param Type Default
port *
filePath *
[uiMode] *

JS API: Window module for ZAP UI~createQueryString(uiMode, standalone, isNew, filePath, restPort) ⇒

Get url string.

Kind: inner method of [JS API: Window module for ZAP UI](#module_JS API_ Window module for ZAP UI)
Returns: String

Param Type
uiMode *
standalone *
isNew *
filePath *
restPort *

JS API: Arguments for ZAP

Arguments for ZAP

  • [JS API: Arguments for ZAP](#module_JS API_ Arguments for ZAP)
    • static
      • [.processCommandLineArguments(argv)](#module_JS API_ Arguments for ZAP.processCommandLineArguments) ⇒
    • inner
      • [~environmentVariablesDescription()](#module_JS API_ Arguments for ZAP..environmentVariablesDescription) ⇒

JS API: Arguments for ZAP.processCommandLineArguments(argv) ⇒

Process the command line arguments and resets the state in this file to the specified values.

Kind: static method of [JS API: Arguments for ZAP](#module_JS API_ Arguments for ZAP)
Returns: parsed argv object

Param Type
argv *

JS API: Arguments for ZAP~environmentVariablesDescription() ⇒

Get environment variable details.

Kind: inner method of [JS API: Arguments for ZAP](#module_JS API_ Arguments for ZAP)
Returns: environment varibale details

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](#module_JS API_ async reporting)
    • [~sendDirtyFlagStatus(db, session)](#module_JS API_ async reporting..sendDirtyFlagStatus)
    • [~sendNotificationUpdate(db, session)](#module_JS API_ async reporting..sendNotificationUpdate)
    • [~startAsyncReporting(db, intervalMs)](#module_JS API_ async reporting..startAsyncReporting)
    • [~stopAsyncReporting()](#module_JS 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](#module_JS API_ async reporting)

Param Type
db *
session *

JS API: async reporting~sendNotificationUpdate(db, session)

Sends a dirty flag status for a single session.

Kind: inner method of [JS API: async reporting](#module_JS API_ async reporting)

Param Type
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](#module_JS API_ async reporting)

Param Type
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](#module_JS API_ async reporting)

JS API: Binary utilities

Binary utilities to deal with hex numbers and such.

  • [JS API: Binary utilities](#module_JS API_ Binary utilities)
    • [~int8ToHex(value)](#module_JS API_ Binary utilities..int8ToHex) ⇒
    • [~int16ToHex(value)](#module_JS API_ Binary utilities..int16ToHex) ⇒
    • [~int32ToHex(value)](#module_JS API_ Binary utilities..int32ToHex) ⇒
    • [~stringToHex(value)](#module_JS API_ Binary utilities..stringToHex) ⇒
    • [~bitCount(n)](#module_JS API_ Binary utilities..bitCount) ⇒
    • [~hexToCBytes(value)](#module_JS API_ Binary utilities..hexToCBytes) ⇒
    • [~bitOffset(binary)](#module_JS API_ Binary utilities..bitOffset)
    • [~hexToBinary(hex)](#module_JS API_ Binary utilities..hexToBinary)
    • [~stringToOneByteLengthPrefixCBytes(value, maxLength, pad)](#module_JS API_ Binary utilities..stringToOneByteLengthPrefixCBytes) ⇒
    • [~stringToTwoByteLengthPrefixCBytes(value, maxLength, pad)](#module_JS API_ Binary utilities..stringToTwoByteLengthPrefixCBytes) ⇒

JS API: Binary utilities~int8ToHex(value) ⇒

Takes an int8 value and turns it into a hex.

Kind: inner method of [JS API: Binary utilities](#module_JS API_ Binary utilities)
Returns: hex string, 2 characters long without '0x'

Param Type
value *

JS API: Binary utilities~int16ToHex(value) ⇒

Takes an int16 value and turns it into a hex.

Kind: inner method of [JS API: Binary utilities](#module_JS API_ Binary utilities)
Returns: hex string, 4 characters long without '0x'

Param Type
value *

JS API: Binary utilities~int32ToHex(value) ⇒

Takes an int32 value and turns it into a hex.

Kind: inner method of [JS API: Binary utilities](#module_JS API_ Binary utilities)
Returns: hex string, 8 characters long without '0x'

Param Type
value *

JS API: Binary utilities~stringToHex(value) ⇒

Converts a string to the hex value.

Kind: inner method of [JS API: Binary utilities](#module_JS API_ Binary utilities)
Returns: hex string, value.length * 2 + 2 characters long. It appends the terminating NULL, so 0x00 is at the end.

Param Type
value *

JS API: Binary utilities~bitCount(n) ⇒

Given a number, this function returns the number of bits set in the number

Kind: inner method of [JS API: Binary utilities](#module_JS API_ Binary utilities)
Returns: number of bits set.

Param Type
n *

JS API: Binary utilities~hexToCBytes(value) ⇒

Takes the raw hex string, such as abcd and converts it into a C constant array, such as 0xAB, 0xCD.

Kind: inner method of [JS API: Binary utilities](#module_JS API_ Binary utilities)
Returns: C byte array

Param Type
value *

JS API: Binary utilities~bitOffset(binary)

Getting a binary string ("0001101010010") it returns the number of zero bits at the end.

Kind: inner method of [JS API: Binary utilities](#module_JS API_ Binary utilities)

Param Type
binary *

JS API: Binary utilities~hexToBinary(hex)

Convert a hex number to a binary. Hex has to be in a format as obtained by intToHex methods above: no '0x' prefix and upper-case letters, as in "12AB".

Kind: inner method of [JS API: Binary utilities](#module_JS API_ Binary utilities)

Param Type
hex *

JS API: Binary utilities~stringToOneByteLengthPrefixCBytes(value, maxLength, pad) ⇒

Returns string as C bytes, prefixed with one-byte length. If maxLength is greater than length of value, then the resulting array is padded with 0x00.

Kind: inner method of [JS API: Binary utilities](#module_JS API_ Binary utilities)
Returns: Object containing 'length' and 'content', where length is number of bytes used and content is actual content in C format.

Param Type Default Description
value *
maxLength * the maximum length of the used memory in bytes
pad * true If true, then pad with 0x00 until maxLength bytes.

JS API: Binary utilities~stringToTwoByteLengthPrefixCBytes(value, maxLength, pad) ⇒

Returns string as C bytes, prefixed with two-byte length If maxLength is greater than length of value, then the resulting array is padded with 0x00.

Kind: inner method of [JS API: Binary utilities](#module_JS API_ Binary utilities)
Returns: Object containing 'length' and 'content', where length is number of bytes used and content is actual content in C format.

Param Type Default Description
value *
maxLength * the maximum length of the used memory in bytes
pad * true If true, then pad with 0x00 until maxLength bytes.

JS API: Environment utilities

Environment utilities for ZAP

  • [JS API: Environment utilities](#module_JS API_ Environment utilities)
    • [.setSaveFileFormat(n)](#module_JS API_ Environment utilities.setSaveFileFormat)
    • [.defaultFileFormat()](#module_JS API_ Environment utilities.defaultFileFormat) ⇒
    • [.builtinSilabsZclMetafile()](#module_JS API_ Environment utilities.builtinSilabsZclMetafile) ⇒
    • [.builtinSilabsZclSpecialMetafile()](#module_JS API_ Environment utilities.builtinSilabsZclSpecialMetafile) ⇒
    • [.builtinSilabsZclGeneralXmlFile()](#module_JS API_ Environment utilities.builtinSilabsZclGeneralXmlFile) ⇒
    • [.builtinSilabsSpecialZclGeneralSpecialXmlFile()](#module_JS API_ Environment utilities.builtinSilabsSpecialZclGeneralSpecialXmlFile) ⇒
    • [.builtinMatterZclMetafile()](#module_JS API_ Environment utilities.builtinMatterZclMetafile) ⇒
    • [.builtinNewMatterZclMetafile()](#module_JS API_ Environment utilities.builtinNewMatterZclMetafile) ⇒
    • [.builtinDotdotZclMetafile()](#module_JS API_ Environment utilities.builtinDotdotZclMetafile) ⇒
    • [.builtinMatterZclMetafile2()](#module_JS API_ Environment utilities.builtinMatterZclMetafile2) ⇒
    • [.builtinTemplateMetafile()](#module_JS API_ Environment utilities.builtinTemplateMetafile) ⇒
    • [.setDevelopmentEnv()](#module_JS API_ Environment utilities.setDevelopmentEnv)
    • [.setProductionEnv()](#module_JS API_ Environment utilities.setProductionEnv)
    • [.logInitStdout()](#module_JS API_ Environment utilities.logInitStdout)
    • [.logInitLogFile()](#module_JS API_ Environment utilities.logInitLogFile)
    • [.setAppDirectory(path)](#module_JS API_ Environment utilities.setAppDirectory)
    • [.appDirectory()](#module_JS API_ Environment utilities.appDirectory) ⇒
    • [.iconsDirectory()](#module_JS API_ Environment utilities.iconsDirectory) ⇒
    • [.schemaFile()](#module_JS API_ Environment utilities.schemaFile) ⇒
    • [.sqliteFile(filename)](#module_JS API_ Environment utilities.sqliteFile) ⇒
    • [.sqliteTestFile(id, deleteExistingFile)](#module_JS API_ Environment utilities.sqliteTestFile) ⇒
    • [.zapVersionAsString()](#module_JS API_ Environment utilities.zapVersionAsString)
    • [.locateProjectResource(filePath)](#module_JS API_ Environment utilities.locateProjectResource) ⇒
    • [.zapVersion()](#module_JS API_ Environment utilities.zapVersion) ⇒
    • [.baseUrl()](#module_JS API_ Environment utilities.baseUrl) ⇒
    • [.printToStderr(msg)](#module_JS API_ Environment utilities.printToStderr)
    • [.log(level, msg, err)](#module_JS API_ Environment utilities.log)
    • [.logInfo(msg, err)](#module_JS API_ Environment utilities.logInfo)
    • [.logError(msg, err)](#module_JS API_ Environment utilities.logError)
    • [.logWarning(msg, err)](#module_JS API_ Environment utilities.logWarning)
    • [.logSql(msg, err)](#module_JS API_ Environment utilities.logSql)
    • [.logBrowser(msg, err)](#module_JS API_ Environment utilities.logBrowser)
    • [.logIpc(msg, err)](#module_JS API_ Environment utilities.logIpc)
    • [.logDebug(msg, err)](#module_JS API_ Environment utilities.logDebug)
    • [.logWarningToFile(msg)](#module_JS API_ Environment utilities.logWarningToFile)
    • [.isMatchingVersion(versionsArray, providedVersion)](#module_JS API_ Environment utilities.isMatchingVersion) ⇒
    • [.versionsCheck()](#module_JS API_ Environment utilities.versionsCheck) ⇒
    • [.httpStaticContent()](#module_JS API_ Environment utilities.httpStaticContent) ⇒

JS API: Environment utilities.setSaveFileFormat(n)

Set save file format.

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)

Param Type
n *

JS API: Environment utilities.defaultFileFormat() ⇒

Get save file format.

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)
Returns: saveFileFormat

JS API: Environment utilities.builtinSilabsZclMetafile() ⇒

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)
Returns: path to zcl.json file

JS API: Environment utilities.builtinSilabsZclSpecialMetafile() ⇒

Used to retrieve zcl-special.json by zcl reload test in zcl-loader.test.js

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)
Returns: path to zcl-special.json file used by zcl-loader.test.js

JS API: Environment utilities.builtinSilabsZclGeneralXmlFile() ⇒

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)
Returns: path to general.xml file

JS API: Environment utilities.builtinSilabsSpecialZclGeneralSpecialXmlFile() ⇒

Used to retrieve general-special.xml by zcl reload test in zcl-loader.test.js

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)
Returns: path to general-special.xml file used by zcl-loader.test.js

JS API: Environment utilities.builtinMatterZclMetafile() ⇒

Get builtin matter ZCL json file

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)
Returns: matter ZCL json file

JS API: Environment utilities.builtinNewMatterZclMetafile() ⇒

Get builtin matter ZCL json file

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)
Returns: matter ZCL json file

JS API: Environment utilities.builtinDotdotZclMetafile() ⇒

Get builtin dotdot ZCL json file

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)
Returns: dotdot ZCL json file

JS API: Environment utilities.builtinMatterZclMetafile2() ⇒

Get builtin Matter ZCL json file

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)
Returns: matter ZCL json file

JS API: Environment utilities.builtinTemplateMetafile() ⇒

No builtin meta template file.

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)
Returns: null

JS API: Environment utilities.setDevelopmentEnv()

Set up the devlopment environment.

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)

JS API: Environment utilities.setProductionEnv()

Set up the production environment.

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)

JS API: Environment utilities.logInitStdout()

set explicit_logger_set

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)

JS API: Environment utilities.logInitLogFile()

Create zap.log file for logging.

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)

JS API: Environment utilities.setAppDirectory(path)

Set the state directory. This method is intended to be called only at the application startup, when CLI args are being parsed. This method honors '~/' being the first characters in its argument.

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)

Param Type Description
path * Absolute path. Typically '~/.zap'.

JS API: Environment utilities.appDirectory() ⇒

Returns an app directory. It creates it, if it doesn't exist

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)
Returns: state directory, which is guaranteed to be already existing

JS API: Environment utilities.iconsDirectory() ⇒

Get path to icons directory.

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)
Returns: path to icons directory

JS API: Environment utilities.schemaFile() ⇒

Get path to sqlite schema file.

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)
Returns: path to sqlite schema file

JS API: Environment utilities.sqliteFile(filename) ⇒

Get sqlite file path relative to app directory.

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)
Returns: sqlite file path

Param Type
filename *

JS API: Environment utilities.sqliteTestFile(id, deleteExistingFile) ⇒

Get sqlite test file name.

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)
Returns: sqlite test file name

Param Type
id *
deleteExistingFile *

JS API: Environment utilities.zapVersionAsString()

Returns a version as a single on-line string.

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)

JS API: Environment utilities.locateProjectResource(filePath) ⇒

This function locates a resource in the project, such as various JSON files and zcl-builtin stuff.

It needs to adapt to a change in path that can occur when things are copied into the dist/ directory.

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)
Returns: located project resource

Param
filePath

JS API: Environment utilities.zapVersion() ⇒

Returns the zap version.

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)
Returns: zap version, which is an object that contains 'version', 'featureLevel', 'hash', 'timestamp' and 'date'

JS API: Environment utilities.baseUrl() ⇒

Get zapBaseUrl.

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)
Returns: zapBaseUrl

JS API: Environment utilities.printToStderr(msg)

Prints the data to stderr, without much fuss.

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)

Param
msg

JS API: Environment utilities.log(level, msg, err)

Base level common logger.

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)

Param Type
level *
msg *
err *

JS API: Environment utilities.logInfo(msg, err)

Info level message.

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)

Param Type
msg *
err *

JS API: Environment utilities.logError(msg, err)

Error level message.

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)

Param Type
msg *
err *

JS API: Environment utilities.logWarning(msg, err)

Warning level message.

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)

Param Type
msg *
err *

JS API: Environment utilities.logSql(msg, err)

Sql level message.

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)

Param Type
msg *
err *

JS API: Environment utilities.logBrowser(msg, err)

Browser level message.

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)

Param Type
msg *
err *

JS API: Environment utilities.logIpc(msg, err)

IPC level message.

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)

Param Type
msg *
err *

JS API: Environment utilities.logDebug(msg, err)

Debug level message.

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)

Param Type
msg *
err *

JS API: Environment utilities.logWarningToFile(msg)

Log Warning level message to zap.log file.

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)

Param Type
msg *

JS API: Environment utilities.isMatchingVersion(versionsArray, providedVersion) ⇒

Returns true if major or minor component of versions is different.

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)
Returns: boolean

Param Type
versionsArray *
providedVersion *

JS API: Environment utilities.versionsCheck() ⇒

Returns true if versions of node and electron are matching. If versions are not matching, it prints out a warhing and returns false.

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)
Returns: true or false, depending on match

JS API: Environment utilities.httpStaticContent() ⇒

Returns path to HTTP static content while taking into account DEV / PROD modes.

Kind: static method of [JS API: Environment utilities](#module_JS API_ Environment utilities)
Returns: full path to HTTP static content

External API: External API utilities

External helper utilities for ZAP

  • [External API: External API utilities](#module_External API_ External API utilities)
    • [~availableClusters(context)](#module_External API_ External API utilities..availableClusters) ⇒
    • [~availableEvents(context)](#module_External API_ External API utilities..availableEvents) ⇒
    • [~availableCommands(context)](#module_External API_ External API utilities..availableCommands) ⇒
    • [~availableAttributes(context)](#module_External API_ External API utilities..availableAttributes) ⇒
    • [~helperWrapper(wrappedHelper)](#module_External API_ External API utilities..helperWrapper) ⇒ function
    • [~registerHelpers(singleHelper, registerHelper, context)](#module_External API_ External API utilities..registerHelpers)
    • [~executeHelperFunction(functionName, context, helper)](#module_External API_ External API utilities..executeHelperFunction) ⇒ Promise

External API: External API utilities~availableClusters(context) ⇒

Returns all available clusters.

Kind: inner method of [External API: External API utilities](#module_External API_ External API utilities)
Returns: all available clusters

Param Type
context *

External API: External API utilities~availableEvents(context) ⇒

Returns all available events.

Kind: inner method of [External API: External API utilities](#module_External API_ External API utilities)
Returns: all available events

Param Type
context *

External API: External API utilities~availableCommands(context) ⇒

Returns all available commands.

Kind: inner method of [External API: External API utilities](#module_External API_ External API utilities)
Returns: all available ccommands

Param Type
context *

External API: External API utilities~availableAttributes(context) ⇒

Returns all available attributes.

Kind: inner method of [External API: External API utilities](#module_External API_ External API utilities)
Returns: all available attributes

Param Type
context *

External API: External API utilities~helperWrapper(wrappedHelper) ⇒ function

Wraps a helper function to add usage tracking and error handling.

Kind: inner method of [External API: External API utilities](#module_External API_ External API utilities)
Returns: function - - The wrapped helper function.

Param Type Description
wrappedHelper function The helper function to wrap.

External API: External API utilities~registerHelpers(singleHelper, registerHelper, context)

Registers a helper function.

Kind: inner method of [External API: External API utilities](#module_External API_ External API utilities)

Param Type Description
singleHelper string The name of the helper function.
registerHelper function The helper function to register.
context Object The context object.

External API: External API utilities~executeHelperFunction(functionName, context, helper) ⇒ Promise

Executes a helper function from a script file.

Kind: inner method of [External API: External API utilities](#module_External API_ External API utilities)
Returns: Promise - - A Promise that resolves with the result of the helper function.

Param Type Description
functionName string The name of the helper function to execute.
context Object The context object to pass to the helper function.
helper string The path to the helper file containing the helper functions.

External API: External API utilities

External Registry utilities for ZAP

  • [External API: External API utilities](#module_External API_ External API utilities)
    • [~availableClusters(context)](#module_External API_ External API utilities..availableClusters) ⇒
    • [~availableEvents(context)](#module_External API_ External API utilities..availableEvents) ⇒
    • [~availableCommands(context)](#module_External API_ External API utilities..availableCommands) ⇒
    • [~availableAttributes(context)](#module_External API_ External API utilities..availableAttributes) ⇒
    • [~helperWrapper(wrappedHelper)](#module_External API_ External API utilities..helperWrapper) ⇒ function
    • [~registerHelpers(singleHelper, registerHelper, context)](#module_External API_ External API utilities..registerHelpers)
    • [~executeHelperFunction(functionName, context, helper)](#module_External API_ External API utilities..executeHelperFunction) ⇒ Promise

External API: External API utilities~availableClusters(context) ⇒

Returns all available clusters.

Kind: inner method of [External API: External API utilities](#module_External API_ External API utilities)
Returns: all available clusters

Param Type
context *

External API: External API utilities~availableEvents(context) ⇒

Returns all available events.

Kind: inner method of [External API: External API utilities](#module_External API_ External API utilities)
Returns: all available events

Param Type
context *

External API: External API utilities~availableCommands(context) ⇒

Returns all available commands.

Kind: inner method of [External API: External API utilities](#module_External API_ External API utilities)
Returns: all available ccommands

Param Type
context *

External API: External API utilities~availableAttributes(context) ⇒

Returns all available attributes.

Kind: inner method of [External API: External API utilities](#module_External API_ External API utilities)
Returns: all available attributes

Param Type
context *

External API: External API utilities~helperWrapper(wrappedHelper) ⇒ function

Wraps a helper function to add usage tracking and error handling.

Kind: inner method of [External API: External API utilities](#module_External API_ External API utilities)
Returns: function - - The wrapped helper function.

Param Type Description
wrappedHelper function The helper function to wrap.

External API: External API utilities~registerHelpers(singleHelper, registerHelper, context)

Registers a helper function.

Kind: inner method of [External API: External API utilities](#module_External API_ External API utilities)

Param Type Description
singleHelper string The name of the helper function.
registerHelper function The helper function to register.
context Object The context object.

External API: External API utilities~executeHelperFunction(functionName, context, helper) ⇒ Promise

Executes a helper function from a script file.

Kind: inner method of [External API: External API utilities](#module_External API_ External API utilities)
Returns: Promise - - A Promise that resolves with the result of the helper function.

Param Type Description
functionName string The name of the helper function to execute.
context Object The context object to pass to the helper function.
helper string The path to the helper file containing the helper functions.

External API: External API utilities

External helper utilities for ZAP

  • [External API: External API utilities](#module_External API_ External API utilities)
    • [~availableClusters(context)](#module_External API_ External API utilities..availableClusters) ⇒
    • [~availableEvents(context)](#module_External API_ External API utilities..availableEvents) ⇒
    • [~availableCommands(context)](#module_External API_ External API utilities..availableCommands) ⇒
    • [~availableAttributes(context)](#module_External API_ External API utilities..availableAttributes) ⇒
    • [~helperWrapper(wrappedHelper)](#module_External API_ External API utilities..helperWrapper) ⇒ function
    • [~registerHelpers(singleHelper, registerHelper, context)](#module_External API_ External API utilities..registerHelpers)
    • [~executeHelperFunction(functionName, context, helper)](#module_External API_ External API utilities..executeHelperFunction) ⇒ Promise

External API: External API utilities~availableClusters(context) ⇒

Returns all available clusters.

Kind: inner method of [External API: External API utilities](#module_External API_ External API utilities)
Returns: all available clusters

Param Type
context *

External API: External API utilities~availableEvents(context) ⇒

Returns all available events.

Kind: inner method of [External API: External API utilities](#module_External API_ External API utilities)
Returns: all available events

Param Type
context *

External API: External API utilities~availableCommands(context) ⇒

Returns all available commands.

Kind: inner method of [External API: External API utilities](#module_External API_ External API utilities)
Returns: all available ccommands

Param Type
context *

External API: External API utilities~availableAttributes(context) ⇒

Returns all available attributes.

Kind: inner method of [External API: External API utilities](#module_External API_ External API utilities)
Returns: all available attributes

Param Type
context *

External API: External API utilities~helperWrapper(wrappedHelper) ⇒ function

Wraps a helper function to add usage tracking and error handling.

Kind: inner method of [External API: External API utilities](#module_External API_ External API utilities)
Returns: function - - The wrapped helper function.

Param Type Description
wrappedHelper function The helper function to wrap.

External API: External API utilities~registerHelpers(singleHelper, registerHelper, context)

Registers a helper function.

Kind: inner method of [External API: External API utilities](#module_External API_ External API utilities)

Param Type Description
singleHelper string The name of the helper function.
registerHelper function The helper function to register.
context Object The context object.

External API: External API utilities~executeHelperFunction(functionName, context, helper) ⇒ Promise

Executes a helper function from a script file.

Kind: inner method of [External API: External API utilities](#module_External API_ External API utilities)
Returns: Promise - - A Promise that resolves with the result of the helper function.

Param Type Description
functionName string The name of the helper function to execute.
context Object The context object to pass to the helper function.
helper string The path to the helper file containing the helper functions.

JS API: Iterator utilities

This module provides API to access various iterator utilities that can then be used to build iterator helpers.

JS API: Iterator utilities~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: inner method of [JS API: Iterator utilities](#module_JS API_ Iterator utilities)

JS API: post-import.

This module contains the API functions for the post-load scripting functionality.

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](#module_JS API_ SDK utilities)

Param Type
sdkPath *
logger *

JS API: string utilities

  • [JS API: string utilities](#module_JS API_ string utilities)
    • [~toCamelCase(str)](#module_JS API_ string utilities..toCamelCase) ⇒
    • [~toSpacedLowercase(str)](#module_JS API_ string utilities..toSpacedLowercase) ⇒
    • [~toSnakeCaseAllCaps(label)](#module_JS API_ string utilities..toSnakeCaseAllCaps)
    • [~toSnakeCase(str)](#module_JS API_ string utilities..toSnakeCase) ⇒
    • [~toCleanSymbol(label)](#module_JS API_ string utilities..toCleanSymbol)
    • [~toCleanSymbolAsKebabCase(label)](#module_JS API_ string utilities..toCleanSymbolAsKebabCase)
    • [~toCleanMacro(label)](#module_JS API_ string utilities..toCleanMacro) ⇒
    • [~isDigit(ch)](#module_JS API_ string utilities..isDigit)

JS API: string utilities~toCamelCase(str) ⇒

Given a string convert it into a camelCased string

Kind: inner method of [JS API: string utilities](#module_JS API_ string utilities)
Returns: a spaced out string in lowercase
Parem: * firstLower if True the it starts with lowecase.

Param Type
str *

JS API: string utilities~toSpacedLowercase(str) ⇒

Get spaced out lower case string from the given string.

Kind: inner method of [JS API: string utilities](#module_JS API_ string utilities)
Returns: spaced out lower case string

Param Type
str *

JS API: string utilities~toSnakeCaseAllCaps(label)

Takes a label, and delimits is on camelcasing. For example: VerySimpleLabel will turn into VERY_SIMPLE_LABEL

Kind: inner method of [JS API: string utilities](#module_JS API_ string utilities)

Param Type
label *

JS API: string utilities~toSnakeCase(str) ⇒

Get snake case string from the given string.

Kind: inner method of [JS API: string utilities](#module_JS API_ string utilities)
Returns: snake case string

Param Type
str *

JS API: string utilities~toCleanSymbol(label)

returns a string after converting ':' and '-' into '_'

Kind: inner method of [JS API: string utilities](#module_JS API_ string utilities)

Param Type
label *

JS API: string utilities~toCleanSymbolAsKebabCase(label)

returns a string after converting ':' and '_' into '-'

Kind: inner method of [JS API: string utilities](#module_JS API_ string utilities)

Param Type
label *

JS API: string utilities~toCleanMacro(label) ⇒

Formats label as a C macro. This method performs a very simply substition of illegal characters, such as ' ', ':' and such into a '_' character.

Kind: inner method of [JS API: string utilities](#module_JS API_ string utilities)
Returns: Label formatted as C macro.

Param Type
label *

JS API: string utilities~isDigit(ch)

Returns true if given character is a digit.

Kind: inner method of [JS API: string utilities](#module_JS API_ string utilities)

Param Type
ch *

JS API: Studio utilities

JS API: Studio utilities~projectName(db, sessionId) ⇒

Extract project name from the Studio project path

Kind: inner method of [JS API: Studio utilities](#module_JS API_ Studio utilities)
Returns: '' if parsing fails

Param Type
db
sessionId *

JS API: type related utilities

  • [JS API: type related utilities](#module_JS API_ type related utilities)
    • [~typeSize(db, zclPackageId, type)](#module_JS API_ type related utilities..typeSize)
    • [~typeSizeAttribute(db, zclPackageIds, at, [defaultValue])](#module_JS API_ type related utilities..typeSizeAttribute) ⇒
    • [~convertFloatToBigEndian(value, size)](#module_JS API_ type related utilities..convertFloatToBigEndian) ⇒
    • [~convertIntToBigEndian(value, size)](#module_JS API_ type related utilities..convertIntToBigEndian) ⇒
    • [~longTypeDefaultValue(size, type, value)](#module_JS API_ type related utilities..longTypeDefaultValue) ⇒
    • [~convertToCliType(str)](#module_JS API_ type related utilities..convertToCliType) ⇒
    • [~isString(type)](#module_JS API_ type related utilities..isString) ⇒
    • [~isFloat(type)](#module_JS API_ type related utilities..isFloat) ⇒
    • [~isSignedInteger(db, sessionId, type)](#module_JS API_ type related utilities..isSignedInteger) ⇒ Promise.<boolean>
    • [~isOneBytePrefixedString(type)](#module_JS API_ type related utilities..isOneBytePrefixedString) ⇒
    • [~isTwoBytePrefixedString(type)](#module_JS API_ type related utilities..isTwoBytePrefixedString) ⇒
    • [~nullStringDefaultValue(type)](#module_JS API_ type related utilities..nullStringDefaultValue) ⇒ string
    • [~getSignAndSizeOfZclType(type, context, options)](#module_JS API_ type related utilities..getSignAndSizeOfZclType) ⇒
    • [~intToHexString(n, byteCount)](#module_JS API_ type related utilities..intToHexString) ⇒
    • [~hexStringToInt(s)](#module_JS API_ type related utilities..hexStringToInt) ⇒

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](#module_JS API_ type related utilities)

Param Type
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](#module_JS API_ type related utilities)
Returns: Promise that resolves into the size of the attribute.

Param Type Default
db *
zclPackageIds *
at *
[defaultValue] *

JS API: type related utilities~convertFloatToBigEndian(value, size) ⇒

Kind: inner method of [JS API: type related utilities](#module_JS 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'.

Param Type
value *
size *

JS API: type related utilities~convertIntToBigEndian(value, size) ⇒

Kind: inner method of [JS API: type related utilities](#module_JS 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'.

Param Type
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](#module_JS API_ type related utilities)
Returns: string which is a C-formatted byte array.

Param Type Description
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](#module_JS API_ type related utilities)
Returns: converted type

Param Type
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](#module_JS API_ type related utilities)
Returns: true if type is string, false otherwise

Param Type
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](#module_JS API_ type related utilities)
Returns: true if type is float, false otherwise

Param Type
type *

JS API: type related utilities~isSignedInteger(db, sessionId, type) ⇒ Promise.<boolean>

Checks if a given ZCL type is a signed integer.

Kind: inner method of [JS API: type related utilities](#module_JS API_ type related utilities)
Returns: Promise.<boolean> - - A promise that resolves to true if the type is a signed integer, false otherwise.

Param Type Description
db object The database connection object.
sessionId string The session ID.
type string The name of the ZCL 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](#module_JS API_ type related utilities)
Returns: true if the said type is a string prefixed by one byte length

Param Type
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](#module_JS API_ type related utilities)
Returns: true if the said type is a string prefixed by two byte length

Param Type
type *

JS API: type related utilities~nullStringDefaultValue(type) ⇒ string

Generates a default value for a null string based on its type. This function is designed to abstract away the specific null representation of strings from the longTypeDefaultValue function, ensuring that the latter does not need to be aware of these details.

Kind: inner method of [JS API: type related utilities](#module_JS API_ type related utilities)
Returns: string - The default value for a null string of the specified type.
Throws:

  • Error Throws an error if the string type is unknown.
Param Type Description
type string The type of the string, which determines its null representation.

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](#module_JS 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.
Param Type
type *
context *
options *

JS API: type related utilities~intToHexString(n, byteCount) ⇒

Converts a JS number to a hex representation with padding. intToHexString(17, 2) => 0x0011 .

Kind: inner method of [JS API: type related utilities](#module_JS API_ type related utilities)
Returns: hex string

Param Type
n *
byteCount *

JS API: type related utilities~hexStringToInt(s) ⇒

Converts a hex representation created by the intToHexString back into a JS integer.

Kind: inner method of [JS API: type related utilities](#module_JS API_ type related utilities)
Returns: integer

Param Type
s *

JS API: random utilities

  • [JS API: random utilities](#module_JS API_ random utilities)
    • [~checksum(data)](#module_JS API_ random utilities..checksum) ⇒
    • [~ensurePackagesAndPopulateSessionOptions(db, sessionId, options:, selectedZclPropertyPackage, selectedGenTemplatePackages)](#module_JS API_ random utilities..ensurePackagesAndPopulateSessionOptions) ⇒
    • [~populateSessionPackageOptions(db, sessionId, packages)](#module_JS API_ random utilities..populateSessionPackageOptions) ⇒
    • [~createBackupFile(filePath)](#module_JS API_ random utilities..createBackupFile)
    • [~matchFeatureLevel(featureLevel)](#module_JS API_ random utilities..matchFeatureLevel)
    • [~sessionReport(db, sessionId)](#module_JS API_ random utilities..sessionReport) ⇒
    • [~sessionDump(db, sessionId)](#module_JS API_ random utilities..sessionDump) ⇒
    • [~executePromisesSequentially(arrayOfData, promiseCreator)](#module_JS API_ random utilities..executePromisesSequentially)
    • [~createAbsolutePath(relativePath, relativity, zapFilePath)](#module_JS API_ random utilities..createAbsolutePath)
    • [~locateRelativeFilePath(rootFileLocations, relativeFilePath)](#module_JS API_ random utilities..locateRelativeFilePath) ⇒
    • [~executeExternalProgram(cmd)](#module_JS API_ random utilities..executeExternalProgram)
    • [~getClusterExtensionDefault(extensions, extensionId, clusterCode)](#module_JS API_ random utilities..getClusterExtensionDefault) ⇒
    • [~getClusterExtension(extensions, property, clusterCode)](#module_JS API_ random utilities..getClusterExtension) ⇒
    • [~createUuid()](#module_JS API_ random utilities..createUuid)
    • [~waitFor(time)](#module_JS API_ random utilities..waitFor)
    • [~parseXml(fileContent)](#module_JS API_ random utilities..parseXml) ⇒
    • [~readFileContentAndCrc(metadata)](#module_JS API_ random utilities..readFileContentAndCrc) ⇒
    • [~duration(nsDifference)](#module_JS API_ random utilities..duration) ⇒
    • [~mainOrSecondaryInstance()](#module_JS API_ random utilities..mainOrSecondaryInstance)
    • [~disable(testName)](#module_JS API_ random utilities..disable)
    • [~collectJsonData(jsonFile)](#module_JS API_ random utilities..collectJsonData)
    • [~patternFormat(pattern, data)](#module_JS API_ random utilities..patternFormat)

JS API: random utilities~checksum(data) ⇒

Returns the CRC of the data that is passed.

Kind: inner method of [JS API: random utilities](#module_JS API_ random utilities)
Returns: Calculated CRC of a data.

Param Type
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](#module_JS API_ random utilities)
Returns: Promise that resolves with the packages array.

Param Type Description
db *
sessionId *
options: * object containing 'zcl' and 'template'
selectedZclPropertyPackage *
selectedGenTemplatePackages *

JS API: random utilities~populateSessionPackageOptions(db, sessionId, packages) ⇒

Insert session package options.

Kind: inner method of [JS API: random utilities](#module_JS API_ random utilities)
Returns: Promise array on inserting session package options

Param Type
db *
sessionId *
packages *

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](#module_JS API_ random utilities)

Param Type
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](#module_JS API_ random utilities)

Param Type
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](#module_JS API_ random utilities)
Returns: promise that resolves into a text report for the session.

Param Type
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](#module_JS API_ random utilities)
Returns: promise that resolves into a text report for the session.

Param Type
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](#module_JS API_ random utilities)

Param Type
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](#module_JS API_ random utilities)

Param Type
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](#module_JS API_ random utilities)
Returns: A fully resolved path that exists, or null if none is available.

Param Type Description
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](#module_JS API_ random utilities)

Param Type
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](#module_JS API_ random utilities)
Returns: Value of the cluster extension property.
Parem: * clusterRole: one of server/client enums, or null for either.

Param Type Description
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](#module_JS API_ random utilities)
Returns: Object containing all attribuetes specific to the extension

Param Type Description
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](#module_JS 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](#module_JS 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](#module_JS API_ random utilities)
Returns: promise that resolves into parsed object.

Param Type
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](#module_JS API_ random utilities)
Returns: Promise to populate data, filePath and crc into the context.

Param Type Description
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](#module_JS API_ random utilities)
Returns: String with human readable time duration.

Param Type
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](#module_JS API_ random utilities)

JS API: random utilities~disable(testName)

Disable test.

Kind: inner method of [JS API: random utilities](#module_JS API_ random utilities)

Param Type
testName *

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](#module_JS API_ random utilities)

Param Type
jsonFile *

JS API: random utilities~patternFormat(pattern, data)

This function receives pattern and data, and it formats pattern by applyind data to it via it's keys. For example, if pattern is "{a}" and data.a is 1, then this prints out "1".

Kind: inner method of [JS API: random utilities](#module_JS API_ random utilities)

Param Type
pattern *
data *

REST API: various zcl utilities

This module provides the API to access various zcl utilities.

  • [REST API: various zcl utilities](#module_REST API_ various zcl utilities)
    • [~clusterComparator(a, b)](#module_REST API_ various zcl utilities..clusterComparator) ⇒
    • [~attributeComparator(a, b)](#module_REST API_ various zcl utilities..attributeComparator) ⇒
    • [~commandComparator(a, b)](#module_REST API_ various zcl utilities..commandComparator) ⇒
    • [~eventComparator(a, b)](#module_REST API_ various zcl utilities..eventComparator) ⇒
    • [~findStructByName(structs, name)](#module_REST API_ various zcl utilities..findStructByName) ⇒
    • [~sortStructsByDependencyHelper()](#module_REST API_ various zcl utilities..sortStructsByDependencyHelper)
    • [~sortStructsByDependency(structs)](#module_REST API_ various zcl utilities..sortStructsByDependency) ⇒
    • [~calculateBytes(res, options, db, packageIds, isStructType)](#module_REST API_ various zcl utilities..calculateBytes)
    • [~optionsHashOrDefault(options, optionsKey, defaultValue)](#module_REST API_ various zcl utilities..optionsHashOrDefault)
    • [~calculateBytesForTypes(res, options, db, packageIds)](#module_REST API_ various zcl utilities..calculateBytesForTypes) ⇒
    • [~calculateBytesForStructs(res, options, db, packageIds)](#module_REST API_ various zcl utilities..calculateBytesForStructs) ⇒
    • [~returnOptionsForTypes(size, res, options)](#module_REST API_ various zcl utilities..returnOptionsForTypes) ⇒
    • [~dataTypeCharacterFormatter(db, packageIds, type, options, resType)](#module_REST API_ various zcl utilities..dataTypeCharacterFormatter)
    • [~isEnum(db, enum_name, packageIds)](#module_REST API_ various zcl utilities..isEnum) ⇒
    • [~isStruct(db, struct_name, packageIds)](#module_REST API_ various zcl utilities..isStruct) ⇒
    • [~isEvent(db, event_name, packageId)](#module_REST API_ various zcl utilities..isEvent) ⇒
    • [~isBitmap(db, bitmap_name, packageIds)](#module_REST API_ various zcl utilities..isBitmap) ⇒
    • [~defaultMessageForTypeConversion(fromType, toType, noWarning)](#module_REST API_ various zcl utilities..defaultMessageForTypeConversion)
    • [~dataTypeHelper(type, options, packageIds, db, resolvedType, overridable)](#module_REST API_ various zcl utilities..dataTypeHelper) ⇒
    • [~asUnderlyingZclTypeWithPackageId(type, options, packageIds, currentInstance)](#module_REST API_ various zcl utilities..asUnderlyingZclTypeWithPackageId)
    • [~determineType(db, type, packageIds)](#module_REST API_ various zcl utilities..determineType)
    • [~createCommandSignature(db, packageId, cmd)](#module_REST API_ various zcl utilities..createCommandSignature) ⇒
    • [~zcl_data_type_size_and_sign(type, dataType, clusterId, packageIds, context)](#module_REST 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](#module_REST API_ various zcl utilities)
Returns: -1, 0 or 1

Param Type
a *
b *

REST API: various zcl utilities~attributeComparator(a, b) ⇒

Comparator for sorting attribute.

Kind: inner method of [REST API: various zcl utilities](#module_REST API_ various zcl utilities)
Returns: -1, 0 or 1

Param Type
a *
b *

REST API: various zcl utilities~commandComparator(a, b) ⇒

Comparator for sorting commands.

Kind: inner method of [REST API: various zcl utilities](#module_REST API_ various zcl utilities)
Returns: -1, 0 or 1

Param Type
a *
b *

REST API: various zcl utilities~eventComparator(a, b) ⇒

Comparator for sorting events.

Kind: inner method of [REST API: various zcl utilities](#module_REST API_ various zcl utilities)
Returns: -1, 0 or 1

Param Type
a *
b *

REST API: various zcl utilities~findStructByName(structs, name) ⇒

Find struct by name from the given list of structs.

Kind: inner method of [REST API: various zcl utilities](#module_REST API_ various zcl utilities)
Returns: struct

Param Type
structs *
name *

REST API: various zcl utilities~sortStructsByDependencyHelper()

Non-exported helper for sortStructsByDependency.

Kind: inner method of [REST API: various zcl utilities](#module_REST API_ various zcl utilities)

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](#module_REST API_ various zcl utilities)
Returns: sorted structs according to topological search.

Param Type
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](#module_REST API_ various zcl utilities)

Param Type
res *
options *
db *
packageIds *
isStructType *

REST API: various zcl utilities~optionsHashOrDefault(options, optionsKey, defaultValue)

Kind: inner method of [REST API: various zcl utilities](#module_REST API_ various zcl utilities)

Param Description
options
optionsKey
defaultValue Given the values determine to give the user defined value or the calculated value

REST API: various zcl utilities~calculateBytesForTypes(res, options, db, packageIds) ⇒

Get the size of the type given.

Kind: inner method of [REST API: various zcl utilities](#module_REST API_ various zcl utilities)
Returns: size of type

Param Type
res *
options *
db *
packageIds *

REST API: various zcl utilities~calculateBytesForStructs(res, options, db, packageIds) ⇒

Get size of struct. Also allow user to specifiy a default if calculation is not needed.

Kind: inner method of [REST API: various zcl utilities](#module_REST API_ various zcl utilities)
Returns: size of struct

Param Type
res *
options *
db *
packageIds *

REST API: various zcl utilities~returnOptionsForTypes(size, res, options) ⇒

Get user defined values from the template for a given size or else return defaults specified.

Kind: inner method of [REST API: various zcl utilities](#module_REST API_ various zcl utilities)
Returns: user defined or default value based on size

Param Type
size *
res *
options *

REST API: various zcl utilities~dataTypeCharacterFormatter(db, packageIds, type, options, resType)

Kind: inner method of [REST API: various zcl utilities](#module_REST API_ various zcl utilities)

Param Type Description
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](#module_REST API_ various zcl utilities)
Returns: Promise of content.

Param Type
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](#module_REST API_ various zcl utilities)
Returns: Promise of content.

Param Type
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](#module_REST API_ various zcl utilities)
Returns: Promise of content.

Param Type
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](#module_REST API_ various zcl utilities)
Returns: Promise of content.

Param Type
db *
bitmap_name *
packageIds *

REST API: various zcl utilities~defaultMessageForTypeConversion(fromType, toType, noWarning)

Kind: inner method of [REST API: various zcl utilities](#module_REST API_ various zcl utilities)

Param Type Description
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](#module_REST API_ various zcl utilities)
Returns: the data type associated with the resolvedType

Param Type
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](#module_REST API_ various zcl utilities)

Param Description
type
options
packageIds
currentInstance 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. 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](#module_REST API_ various zcl utilities)

Param Type
db *
type *
packageIds *

REST API: various zcl utilities~createCommandSignature(db, packageId, cmd) ⇒

Get command signature of a command.

Kind: inner method of [REST API: various zcl utilities](#module_REST API_ various zcl utilities)
Returns: object

Param Type
db *
packageId *
cmd *

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](#module_REST API_ various zcl utilities)
Returns: The size and sign of a zcl data type

Param Type
type *
dataType *
clusterId *
packageIds *
context *

Validation API: Validation APIs

This module provides the APIs for validating inputs to the database, and returning flags indicating if things were successful or not.

  • [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
    • static
      • [.initAsyncValidation()](#module_Validation API_ Validation APIs.initAsyncValidation)
    • inner
      • [~zigbeeEnforceCommonClusterSpecInit(session)](#module_Validation API_ Validation APIs..zigbeeEnforceCommonClusterSpecInit) ⇒
      • [~zigbeeEnforceCommonClusterSpecCallback(session)](#module_Validation API_ Validation APIs..zigbeeEnforceCommonClusterSpecCallback)
      • [~validateAttribute(db, endpointTypeId, attributeRef, clusterRef, zapSessionId)](#module_Validation API_ Validation APIs..validateAttribute) ⇒
      • [~validateEndpoint(db, endpointId)](#module_Validation API_ Validation APIs..validateEndpoint) ⇒
      • [~validateNoDuplicateEndpoints(db, endpointIdentifier, sessionRef)](#module_Validation API_ Validation APIs..validateNoDuplicateEndpoints) ⇒
      • [~validateSpecificAttribute(endpointAttribute, attribute, db, zapSessionId)](#module_Validation API_ Validation APIs..validateSpecificAttribute) ⇒
      • [~validateSpecificEndpoint(endpoint)](#module_Validation API_ Validation APIs..validateSpecificEndpoint) ⇒
      • [~isValidNumberString(value)](#module_Validation API_ Validation APIs..isValidNumberString) ⇒
      • [~isValidHexString(value)](#module_Validation API_ Validation APIs..isValidHexString) ⇒
      • [~isValidDecimalString(value)](#module_Validation API_ Validation APIs..isValidDecimalString) ⇒
      • [~isValidFloat(value)](#module_Validation API_ Validation APIs..isValidFloat) ⇒
      • [~extractFloatValue(value)](#module_Validation API_ Validation APIs..extractFloatValue) ⇒
      • [~extractIntegerValue(value)](#module_Validation API_ Validation APIs..extractIntegerValue) ⇒
      • [~extractBigIntegerValue(value)](#module_Validation API_ Validation APIs..extractBigIntegerValue) ⇒
      • [~isBigInteger(bits)](#module_Validation API_ Validation APIs..isBigInteger) ⇒
      • [~getBoundsInteger(attribute, typeSize, isSigned)](#module_Validation API_ Validation APIs..getBoundsInteger) ⇒
      • [~getTypeRange(typeSize, isSigned, isMin)](#module_Validation API_ Validation APIs..getTypeRange) ⇒
      • [~unsignedToSignedInteger(value, typeSize)](#module_Validation API_ Validation APIs..unsignedToSignedInteger) ⇒
      • [~getIntegerFromAttribute(attribute, typeSize, isSigned)](#module_Validation API_ Validation APIs..getIntegerFromAttribute) ⇒
      • [~getIntegerAttributeSize(db, zapSessionId, attribType)](#module_Validation API_ Validation APIs..getIntegerAttributeSize) ⇒ *
      • [~checkAttributeBoundsInteger(attribute, endpointAttribute, db, zapSessionId)](#module_Validation API_ Validation APIs..checkAttributeBoundsInteger) ⇒
      • [~checkBoundsInteger(defaultValue, min, max)](#module_Validation API_ Validation APIs..checkBoundsInteger) ⇒
      • [~checkAttributeBoundsFloat(attribute, endpointAttribute)](#module_Validation API_ Validation APIs..checkAttributeBoundsFloat) ⇒
      • [~getBoundsFloat(attribute)](#module_Validation API_ Validation APIs..getBoundsFloat) ⇒
      • [~checkBoundsFloat(defaultValue, min, max)](#module_Validation API_ Validation APIs..checkBoundsFloat) ⇒

Validation API: Validation APIs.initAsyncValidation()

Start session specific validation.

Kind: static method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)

Validation API: Validation APIs~zigbeeEnforceCommonClusterSpecInit(session) ⇒

Enforce zigbee specific common cluster initialization.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: object

Param Type
session *

Validation API: Validation APIs~zigbeeEnforceCommonClusterSpecCallback(session)

Enforce zigbee specific common cluster initialization.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)

Param Type
session *

Validation API: Validation APIs~validateAttribute(db, endpointTypeId, attributeRef, clusterRef, zapSessionId) ⇒

Main attribute validation function. Returns a promise of an object which stores a list of validation issues. Such issues as "Invalid type" or "Out of Range".

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: Promise of the list of issues

Param Type Description
db * db reference
endpointTypeId * endpoint reference
attributeRef * attribute reference
clusterRef * cluster reference
zapSessionId * session reference

Validation API: Validation APIs~validateEndpoint(db, endpointId) ⇒

Get issues in an endpoint.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: object

Param Type
db *
endpointId *

Validation API: Validation APIs~validateNoDuplicateEndpoints(db, endpointIdentifier, sessionRef) ⇒

Check if there are no duplicate endpoints.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: boolean

Param Type
db *
endpointIdentifier *
sessionRef *

Validation API: Validation APIs~validateSpecificAttribute(endpointAttribute, attribute, db, zapSessionId) ⇒

Checks the attributes type then validates the incoming input string.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: List of issues wrapped in an object

Param Type
endpointAttribute *
attribute *
db *
zapSessionId *

Validation API: Validation APIs~validateSpecificEndpoint(endpoint) ⇒

Get endpoint and newtork issue on an endpoint.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: object

Param Type
endpoint *

Validation API: Validation APIs~isValidNumberString(value) ⇒

Check if value is a valid number in string form. This applies to both actual numbers as well as octet strings.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: boolean

Param Type
value *

Validation API: Validation APIs~isValidHexString(value) ⇒

Check if value is a valid hex string.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: boolean

Param Type
value *

Validation API: Validation APIs~isValidDecimalString(value) ⇒

Check if value is a valid decimal string.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: boolean

Param Type
value *

Validation API: Validation APIs~isValidFloat(value) ⇒

Check if value is a valid float value.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: boolean

Param Type
value *

Validation API: Validation APIs~extractFloatValue(value) ⇒

Get float value from the given value.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: float value

Param Type
value *

Validation API: Validation APIs~extractIntegerValue(value) ⇒

Expects a number string , parse it back on a default base 10 if its a decimal. If its a hexadecimal or anything else , parse it back on base 16. Loses precision after javascripts Number.MAX_SAFE_INTEGER range.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: A decimal number

Param Type
value *

Validation API: Validation APIs~extractBigIntegerValue(value) ⇒

Get value of bit integer.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: BigInt

Param Type
value *

Validation API: Validation APIs~isBigInteger(bits) ⇒

Check if integer is greater than 4 bytes.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: boolean

Param Type
bits *

Validation API: Validation APIs~getBoundsInteger(attribute, typeSize, isSigned) ⇒

Get the integer attribute's bounds.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: object

Param Type
attribute *
typeSize *
isSigned *

Validation API: Validation APIs~getTypeRange(typeSize, isSigned, isMin) ⇒

Gets the range of an integer type.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: integer

Param Type
typeSize *
isSigned *
isMin *

Validation API: Validation APIs~unsignedToSignedInteger(value, typeSize) ⇒

Converts an unsigned integer to its signed value. Returns the same integer if its not a signed type. Works for both BigInts and regular numbers.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: A decimal number

Param Type Description
value * integer to convert
typeSize * bit representation

Validation API: Validation APIs~getIntegerFromAttribute(attribute, typeSize, isSigned) ⇒

Converts an attribute (number string) into a decimal number without losing precision. Accepts both decimal and hexadecimal strings (former has priority) in any bit representation. Shifts signed hexadecimals to their correct value.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: A decimal number

Param Type Description
attribute * attribute to convert
typeSize * bit representation size
isSigned * is type is signed

Validation API: Validation APIs~getIntegerAttributeSize(db, zapSessionId, attribType) ⇒ *

Returns information about an integer type.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: * - { size: bit representation , isSigned: is signed type }

Param Type
db *
zapSessionId *
attribType *

Validation API: Validation APIs~checkAttributeBoundsInteger(attribute, endpointAttribute, db, zapSessionId) ⇒

Checks if the incoming integer is within it's attributes bound while handling signed and unsigned cases.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: boolean

Param Type
attribute *
endpointAttribute *
db *
zapSessionId *

Validation API: Validation APIs~checkBoundsInteger(defaultValue, min, max) ⇒

Check if an integer value is within the bounds.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: boolean

Param Type
defaultValue *
min *
max *

Validation API: Validation APIs~checkAttributeBoundsFloat(attribute, endpointAttribute) ⇒

Check if float attribute's value is within the bounds.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: boolean

Param Type
attribute *
endpointAttribute *

Validation API: Validation APIs~getBoundsFloat(attribute) ⇒

Get the bounds on a float attribute's value.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: object

Param Type
attribute *

Validation API: Validation APIs~checkBoundsFloat(defaultValue, min, max) ⇒

Check if float value is within the min/max bounds.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: boolean

Param Type
defaultValue *
min *
max *

Validation API: check element conformance

This module provides utilities for checking if elements meet conformance requirements and generate warnings for non-conformance.

  • [Validation API: check element conformance](#module_Validation API_ check element conformance)
    • [~filterRelatedDescElements(elements, featureCode)](#module_Validation API_ check element conformance..filterRelatedDescElements) ⇒
    • [~generateWarningMessage(featureData, endpointId, elementMap, featureMap, descElements)](#module_Validation API_ check element conformance..generateWarningMessage) ⇒
    • [~checkElementConformance(elements, featureMap, featureData, endpointId)](#module_Validation API_ check element conformance..checkElementConformance) ⇒
    • [~filterElementsToUpdate(elements, elementMap, featureCode)](#module_Validation API_ check element conformance..filterElementsToUpdate) ⇒
    • [~getOutdatedElementWarning(featureData, elements, elementMap)](#module_Validation API_ check element conformance..getOutdatedElementWarning) ⇒
      • [~processElements(elementType)](#module_Validation API_ check element conformance..getOutdatedElementWarning..processElements)
    • [~filterRequiredElements(elements, elementMap, featureMap)](#module_Validation API_ check element conformance..filterRequiredElements) ⇒
    • [~setConformanceWarnings(db, endpointId, endpointTypeId, endpointClusterId, deviceTypeRefs, cluster, sessionId)](#module_Validation API_ check element conformance..setConformanceWarnings) ⇒

Validation API: check element conformance~filterRelatedDescElements(elements, featureCode) ⇒

Kind: inner method of [Validation API: check element conformance](#module_Validation API_ check element conformance)
Returns: elements with conformance containing 'desc' and the feature code

Param Type
elements *
featureCode *

Validation API: check element conformance~generateWarningMessage(featureData, endpointId, elementMap, featureMap, descElements) ⇒

Generate a warning message after processing conformance of the updated device type feature. Set flags to decide whether to show warnings or disable changes in the frontend.

Kind: inner method of [Validation API: check element conformance](#module_Validation API_ check element conformance)
Returns: warning message array, disableChange flag, and displayWarning flag

Param Type
featureData *
endpointId *
elementMap *
featureMap *
descElements *

Validation API: check element conformance~checkElementConformance(elements, featureMap, featureData, endpointId) ⇒

Check if elements need to be updated for correct conformance if featureData provided. Otherwise, check if elements are required or unsupported by their conformance.

Kind: inner method of [Validation API: check element conformance](#module_Validation API_ check element conformance)
Returns: attributes, commands, and events to update, with warnings if featureData provided; required and unsupported attributes, commands, and events, with warnings if not.

Param Type Default
elements *
featureMap *
featureData *
endpointId *

Validation API: check element conformance~filterElementsToUpdate(elements, elementMap, featureCode) ⇒

Return attributes, commands, or events to be updated satisfying: (1) its conformance includes feature code of the updated feature (2) it has mandatory conformance but it is not enabled, OR, it is has notSupported conformance but it is enabled

Kind: inner method of [Validation API: check element conformance](#module_Validation API_ check element conformance)
Returns: elements that should be updated

Param Type
elements *
elementMap *
featureCode *

Validation API: check element conformance~getOutdatedElementWarning(featureData, elements, elementMap) ⇒

Get warnings for element requirements that are outdated after a feature update.

Kind: inner method of [Validation API: check element conformance](#module_Validation API_ check element conformance)
Returns: array of outdated element warnings

Param Type
featureData *
elements *
elementMap *

getOutdatedElementWarning~processElements(elementType)

Build substrings of outdated warnings and add to returned array if: (1) the element conformance includes the feature code (2) the element conformance has changed after the feature update

Kind: inner method of [getOutdatedElementWarning](#module_Validation API_ check element conformance..getOutdatedElementWarning)

Param Type
elementType *

Validation API: check element conformance~filterRequiredElements(elements, elementMap, featureMap) ⇒

Filter required and unsupported elements based on their conformance and generate warnings. An element is required if it conforms to element(s) in elementMap and has 'mandatory' conform. An element is unsupported if it conforms to element(s) in elementMap and has 'notSupported' conform.

Kind: inner method of [Validation API: check element conformance](#module_Validation API_ check element conformance)
Returns: required and not supported elements with warnings

Param Type
elements *
elementMap *
featureMap *

Validation API: check element conformance~setConformanceWarnings(db, endpointId, endpointTypeId, endpointClusterId, deviceTypeRefs, cluster, sessionId) ⇒

Adds warnings to the session notification table during ZAP file imports for features, attributes, commands, and events that do not correctly conform within a cluster.

Kind: inner method of [Validation API: check element conformance](#module_Validation API_ check element conformance)
Returns: list of warning messages if any, otherwise false

Param Type
db *
endpointId *
endpointTypeId *
endpointClusterId *
deviceTypeRefs *
cluster *
sessionId *

Validation API: Evaluate conformance expressions

This module provides utilities for evaluating conformance expressions.

  • [Validation API: Evaluate conformance expressions](#module_Validation API_ Evaluate conformance expressions)
    • [~evaluateConformanceExpression(expression, elementMap)](#module_Validation API_ Evaluate conformance expressions..evaluateConformanceExpression) ⇒
      • [~evaluateBooleanExpression(expr)](#module_Validation API_ Evaluate conformance expressions..evaluateConformanceExpression..evaluateBooleanExpression)
      • [~evaluateWithParentheses(expr)](#module_Validation API_ Evaluate conformance expressions..evaluateConformanceExpression..evaluateWithParentheses)
    • [~checkMissingTerms(expression, elementMap)](#module_Validation API_ Evaluate conformance expressions..checkMissingTerms) ⇒
    • [~checkIfExpressionHasTerm(expression, term)](#module_Validation API_ Evaluate conformance expressions..checkIfExpressionHasTerm) ⇒

Validation API: Evaluate conformance expressions~evaluateConformanceExpression(expression, elementMap) ⇒

Evaluate the value of a boolean conformance expression that includes terms and operators. A term can be an attribute, command, event, feature, or conformance abbreviation. Operators include AND (&), OR (|), and NOT (!). The '[]' indicates optional conformance if the expression inside true. Expression containing comma means otherwise conformance. See spec for details. Examples of conformance expression: 'A & (!B | C)', 'A & B, [!C]'

Kind: inner method of [Validation API: Evaluate conformance expressions](#module_Validation API_ Evaluate conformance expressions)
Returns: 'mandatory', 'optional', 'provisional', or 'notSupported'

Param Type
expression *
elementMap *
  • [~evaluateConformanceExpression(expression, elementMap)](#module_Validation API_ Evaluate conformance expressions..evaluateConformanceExpression) ⇒
    • [~evaluateBooleanExpression(expr)](#module_Validation API_ Evaluate conformance expressions..evaluateConformanceExpression..evaluateBooleanExpression)
    • [~evaluateWithParentheses(expr)](#module_Validation API_ Evaluate conformance expressions..evaluateConformanceExpression..evaluateWithParentheses)

evaluateConformanceExpression~evaluateBooleanExpression(expr)

helper function to evaluate a single boolean expression

Kind: inner method of [evaluateConformanceExpression](#module_Validation API_ Evaluate conformance expressions..evaluateConformanceExpression)

Param Type
expr *

evaluateConformanceExpression~evaluateWithParentheses(expr)

helper function to process parentheses and evaluate inner expressions first

Kind: inner method of [evaluateConformanceExpression](#module_Validation API_ Evaluate conformance expressions..evaluateConformanceExpression)

Param Type
expr *

Validation API: Evaluate conformance expressions~checkMissingTerms(expression, elementMap) ⇒

Check if any terms in the expression are neither a key in the elementMap nor an abbreviation. If so, it means the conformance depends on terms with unknown values and changes are not allowed.

Kind: inner method of [Validation API: Evaluate conformance expressions](#module_Validation API_ Evaluate conformance expressions)
Returns: all missing terms in an array

Param Type
expression *
elementMap *

Validation API: Evaluate conformance expressions~checkIfExpressionHasTerm(expression, term) ⇒

Check if the expression contains a given term.

Kind: inner method of [Validation API: Evaluate conformance expressions](#module_Validation API_ Evaluate conformance expressions)
Returns: true if the expression contains the term, false otherwise

Param
expression
term

Validation API: Parse conformance data from XML

This module provides utilities for parsing conformance data from XML into expressions.

  • [Validation API: Parse conformance data from XML](#module_Validation API_ Parse conformance data from XML)
    • [~parseConformanceFromXML(operand)](#module_Validation API_ Parse conformance data from XML..parseConformanceFromXML) ⇒
    • [~parseConformanceRecursively(operand, depth, parentJoinChar)](#module_Validation API_ Parse conformance data from XML..parseConformanceRecursively) ⇒
    • [~getOptionalAttributeFromXML(element, elementType)](#module_Validation API_ Parse conformance data from XML..getOptionalAttributeFromXML) ⇒

Validation API: Parse conformance data from XML~parseConformanceFromXML(operand) ⇒

Parses conformance from XML data. The conformance could come from features, attributes, commands, or events

Call recursive helper function to parse conformance only if the conformance exists. Otherwise, return empty string directly

An example of parsing the conformance of 'User' device type feature:

Input operand from xml data: { "$": {"code": "USR", "name": "User"}, "mandatoryConform": [ { "andTerm": [ { "condition": [{"$": {"name": "Matter"}}], "orTerm": [ { "feature": [ { "$": {"name": "PIN"}}, { "$": {"name": "RID"}}, { "$": {"name": "FGP"}}, { "$": {"name": "FACE"}} ] } ] } ] } ] }

Output conformance string: "Matter & (PIN | RID | FGP | FACE)"

Kind: inner method of [Validation API: Parse conformance data from XML](#module_Validation API_ Parse conformance data from XML)
Returns: The conformance string

Param Type
operand *

Validation API: Parse conformance data from XML~parseConformanceRecursively(operand, depth, parentJoinChar) ⇒

helper function to parse conformance or an operand in conformance recursively

The baseLevelTerms variable include terms that can not have nested terms. When they appear, stop recursing and return the name inside directly

Kind: inner method of [Validation API: Parse conformance data from XML](#module_Validation API_ Parse conformance data from XML)
Returns: The conformance string.

Param Type Default
operand *
depth * 0
parentJoinChar *

Validation API: Parse conformance data from XML~getOptionalAttributeFromXML(element, elementType) ⇒

if optional attribute is defined, return its value if optional attribute is undefined, check if the element conformance is mandatory if both optional attribute and conformance are undefined, return false Optional attribute takes precedence over conformance for backward compatibility on certain elements Log warnings to zap.log if both optional attribute and conformance are defined

Kind: inner method of [Validation API: Parse conformance data from XML](#module_Validation API_ Parse conformance data from XML)
Returns: true if the element is optional, false if the element is mandatory

Param Type
element *
elementType *

Validation API: Validation APIs

This module provides the APIs for validating inputs to the database, and returning flags indicating if things were successful or not.

  • [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
    • static
      • [.initAsyncValidation()](#module_Validation API_ Validation APIs.initAsyncValidation)
    • inner
      • [~zigbeeEnforceCommonClusterSpecInit(session)](#module_Validation API_ Validation APIs..zigbeeEnforceCommonClusterSpecInit) ⇒
      • [~zigbeeEnforceCommonClusterSpecCallback(session)](#module_Validation API_ Validation APIs..zigbeeEnforceCommonClusterSpecCallback)
      • [~validateAttribute(db, endpointTypeId, attributeRef, clusterRef, zapSessionId)](#module_Validation API_ Validation APIs..validateAttribute) ⇒
      • [~validateEndpoint(db, endpointId)](#module_Validation API_ Validation APIs..validateEndpoint) ⇒
      • [~validateNoDuplicateEndpoints(db, endpointIdentifier, sessionRef)](#module_Validation API_ Validation APIs..validateNoDuplicateEndpoints) ⇒
      • [~validateSpecificAttribute(endpointAttribute, attribute, db, zapSessionId)](#module_Validation API_ Validation APIs..validateSpecificAttribute) ⇒
      • [~validateSpecificEndpoint(endpoint)](#module_Validation API_ Validation APIs..validateSpecificEndpoint) ⇒
      • [~isValidNumberString(value)](#module_Validation API_ Validation APIs..isValidNumberString) ⇒
      • [~isValidHexString(value)](#module_Validation API_ Validation APIs..isValidHexString) ⇒
      • [~isValidDecimalString(value)](#module_Validation API_ Validation APIs..isValidDecimalString) ⇒
      • [~isValidFloat(value)](#module_Validation API_ Validation APIs..isValidFloat) ⇒
      • [~extractFloatValue(value)](#module_Validation API_ Validation APIs..extractFloatValue) ⇒
      • [~extractIntegerValue(value)](#module_Validation API_ Validation APIs..extractIntegerValue) ⇒
      • [~extractBigIntegerValue(value)](#module_Validation API_ Validation APIs..extractBigIntegerValue) ⇒
      • [~isBigInteger(bits)](#module_Validation API_ Validation APIs..isBigInteger) ⇒
      • [~getBoundsInteger(attribute, typeSize, isSigned)](#module_Validation API_ Validation APIs..getBoundsInteger) ⇒
      • [~getTypeRange(typeSize, isSigned, isMin)](#module_Validation API_ Validation APIs..getTypeRange) ⇒
      • [~unsignedToSignedInteger(value, typeSize)](#module_Validation API_ Validation APIs..unsignedToSignedInteger) ⇒
      • [~getIntegerFromAttribute(attribute, typeSize, isSigned)](#module_Validation API_ Validation APIs..getIntegerFromAttribute) ⇒
      • [~getIntegerAttributeSize(db, zapSessionId, attribType)](#module_Validation API_ Validation APIs..getIntegerAttributeSize) ⇒ *
      • [~checkAttributeBoundsInteger(attribute, endpointAttribute, db, zapSessionId)](#module_Validation API_ Validation APIs..checkAttributeBoundsInteger) ⇒
      • [~checkBoundsInteger(defaultValue, min, max)](#module_Validation API_ Validation APIs..checkBoundsInteger) ⇒
      • [~checkAttributeBoundsFloat(attribute, endpointAttribute)](#module_Validation API_ Validation APIs..checkAttributeBoundsFloat) ⇒
      • [~getBoundsFloat(attribute)](#module_Validation API_ Validation APIs..getBoundsFloat) ⇒
      • [~checkBoundsFloat(defaultValue, min, max)](#module_Validation API_ Validation APIs..checkBoundsFloat) ⇒

Validation API: Validation APIs.initAsyncValidation()

Start session specific validation.

Kind: static method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)

Validation API: Validation APIs~zigbeeEnforceCommonClusterSpecInit(session) ⇒

Enforce zigbee specific common cluster initialization.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: object

Param Type
session *

Validation API: Validation APIs~zigbeeEnforceCommonClusterSpecCallback(session)

Enforce zigbee specific common cluster initialization.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)

Param Type
session *

Validation API: Validation APIs~validateAttribute(db, endpointTypeId, attributeRef, clusterRef, zapSessionId) ⇒

Main attribute validation function. Returns a promise of an object which stores a list of validation issues. Such issues as "Invalid type" or "Out of Range".

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: Promise of the list of issues

Param Type Description
db * db reference
endpointTypeId * endpoint reference
attributeRef * attribute reference
clusterRef * cluster reference
zapSessionId * session reference

Validation API: Validation APIs~validateEndpoint(db, endpointId) ⇒

Get issues in an endpoint.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: object

Param Type
db *
endpointId *

Validation API: Validation APIs~validateNoDuplicateEndpoints(db, endpointIdentifier, sessionRef) ⇒

Check if there are no duplicate endpoints.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: boolean

Param Type
db *
endpointIdentifier *
sessionRef *

Validation API: Validation APIs~validateSpecificAttribute(endpointAttribute, attribute, db, zapSessionId) ⇒

Checks the attributes type then validates the incoming input string.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: List of issues wrapped in an object

Param Type
endpointAttribute *
attribute *
db *
zapSessionId *

Validation API: Validation APIs~validateSpecificEndpoint(endpoint) ⇒

Get endpoint and newtork issue on an endpoint.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: object

Param Type
endpoint *

Validation API: Validation APIs~isValidNumberString(value) ⇒

Check if value is a valid number in string form. This applies to both actual numbers as well as octet strings.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: boolean

Param Type
value *

Validation API: Validation APIs~isValidHexString(value) ⇒

Check if value is a valid hex string.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: boolean

Param Type
value *

Validation API: Validation APIs~isValidDecimalString(value) ⇒

Check if value is a valid decimal string.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: boolean

Param Type
value *

Validation API: Validation APIs~isValidFloat(value) ⇒

Check if value is a valid float value.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: boolean

Param Type
value *

Validation API: Validation APIs~extractFloatValue(value) ⇒

Get float value from the given value.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: float value

Param Type
value *

Validation API: Validation APIs~extractIntegerValue(value) ⇒

Expects a number string , parse it back on a default base 10 if its a decimal. If its a hexadecimal or anything else , parse it back on base 16. Loses precision after javascripts Number.MAX_SAFE_INTEGER range.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: A decimal number

Param Type
value *

Validation API: Validation APIs~extractBigIntegerValue(value) ⇒

Get value of bit integer.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: BigInt

Param Type
value *

Validation API: Validation APIs~isBigInteger(bits) ⇒

Check if integer is greater than 4 bytes.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: boolean

Param Type
bits *

Validation API: Validation APIs~getBoundsInteger(attribute, typeSize, isSigned) ⇒

Get the integer attribute's bounds.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: object

Param Type
attribute *
typeSize *
isSigned *

Validation API: Validation APIs~getTypeRange(typeSize, isSigned, isMin) ⇒

Gets the range of an integer type.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: integer

Param Type
typeSize *
isSigned *
isMin *

Validation API: Validation APIs~unsignedToSignedInteger(value, typeSize) ⇒

Converts an unsigned integer to its signed value. Returns the same integer if its not a signed type. Works for both BigInts and regular numbers.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: A decimal number

Param Type Description
value * integer to convert
typeSize * bit representation

Validation API: Validation APIs~getIntegerFromAttribute(attribute, typeSize, isSigned) ⇒

Converts an attribute (number string) into a decimal number without losing precision. Accepts both decimal and hexadecimal strings (former has priority) in any bit representation. Shifts signed hexadecimals to their correct value.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: A decimal number

Param Type Description
attribute * attribute to convert
typeSize * bit representation size
isSigned * is type is signed

Validation API: Validation APIs~getIntegerAttributeSize(db, zapSessionId, attribType) ⇒ *

Returns information about an integer type.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: * - { size: bit representation , isSigned: is signed type }

Param Type
db *
zapSessionId *
attribType *

Validation API: Validation APIs~checkAttributeBoundsInteger(attribute, endpointAttribute, db, zapSessionId) ⇒

Checks if the incoming integer is within it's attributes bound while handling signed and unsigned cases.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: boolean

Param Type
attribute *
endpointAttribute *
db *
zapSessionId *

Validation API: Validation APIs~checkBoundsInteger(defaultValue, min, max) ⇒

Check if an integer value is within the bounds.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: boolean

Param Type
defaultValue *
min *
max *

Validation API: Validation APIs~checkAttributeBoundsFloat(attribute, endpointAttribute) ⇒

Check if float attribute's value is within the bounds.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: boolean

Param Type
attribute *
endpointAttribute *

Validation API: Validation APIs~getBoundsFloat(attribute) ⇒

Get the bounds on a float attribute's value.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: object

Param Type
attribute *

Validation API: Validation APIs~checkBoundsFloat(defaultValue, min, max) ⇒

Check if float value is within the min/max bounds.

Kind: inner method of [Validation API: Validation APIs](#module_Validation API_ Validation APIs)
Returns: boolean

Param Type
defaultValue *
min *
max *

Loader API: Loader APIs

This module provides the APIs for dotdot Loading

  • [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
    • [~collectDataFromLibraryXml(ctx)](#module_Loader API_ Loader APIs..collectDataFromLibraryXml) ⇒
    • [~tagContainsEnum(tag)](#module_Loader API_ Loader APIs..tagContainsEnum) ⇒
    • [~tagContainsStruct(tag)](#module_Loader API_ Loader APIs..tagContainsStruct) ⇒
    • [~tagContainsBitmap(tag)](#module_Loader API_ Loader APIs..tagContainsBitmap) ⇒
    • [~parseSingleZclFile(db, ctx, file)](#module_Loader API_ Loader APIs..parseSingleZclFile) ⇒
    • [~parseZclFiles(db, ctx)](#module_Loader API_ Loader APIs..parseZclFiles) ⇒
    • [~normalizeHexValue(value)](#module_Loader API_ Loader APIs..normalizeHexValue) ⇒
    • [~getNumBytesFromShortName(value)](#module_Loader API_ Loader APIs..getNumBytesFromShortName) ⇒
    • [~prepareAttributes(attributes, side)](#module_Loader API_ Loader APIs..prepareAttributes) ⇒
    • [~prepareCommands(commands, side, types)](#module_Loader API_ Loader APIs..prepareCommands) ⇒
    • [~prepareCluster(cluster, isExtension, types)](#module_Loader API_ Loader APIs..prepareCluster) ⇒
    • [~prepareAtomic(type)](#module_Loader API_ Loader APIs..prepareAtomic) ⇒
    • [~prepareSubAtomic(type, atomics)](#module_Loader API_ Loader APIs..prepareSubAtomic) ⇒
    • [~prepareBitmap(type, isContained)](#module_Loader API_ Loader APIs..prepareBitmap) ⇒
    • [~prepareEnum(type)](#module_Loader API_ Loader APIs..prepareEnum) ⇒
    • [~prepareStruct(type)](#module_Loader API_ Loader APIs..prepareStruct) ⇒
    • [~prepareSubAtomicTypes(types)](#module_Loader API_ Loader APIs..prepareSubAtomicTypes)
    • [~prepareTypes(zclTypes, types)](#module_Loader API_ Loader APIs..prepareTypes)
    • [~prepareAttributeType(attribute, types, cluster)](#module_Loader API_ Loader APIs..prepareAttributeType)
    • [~prepareDeviceType(deviceType)](#module_Loader API_ Loader APIs..prepareDeviceType) ⇒
    • [~prepareDataTypeDiscriminator(a)](#module_Loader API_ Loader APIs..prepareDataTypeDiscriminator) ⇒
    • [~processDataTypeDiscriminator(db, packageId, zclDataTypes)](#module_Loader API_ Loader APIs..processDataTypeDiscriminator) ⇒
    • [~prepareDataType(a, dataType, typeMap)](#module_Loader API_ Loader APIs..prepareDataType) ⇒
    • [~processDataType(db, filePath, packageId, data, dataType)](#module_Loader API_ Loader APIs..processDataType) ⇒
    • [~prepareNumber(a, dataType)](#module_Loader API_ Loader APIs..prepareNumber) ⇒
    • [~processNumber(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processNumber) ⇒
    • [~prepareString(a, dataType)](#module_Loader API_ Loader APIs..prepareString) ⇒
    • [~processString(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processString) ⇒
    • [~prepareEnumsOrBitmaps(a, dataType)](#module_Loader API_ Loader APIs..prepareEnumsOrBitmaps) ⇒
    • [~processEnums(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processEnums) ⇒
    • [~processEnumItems(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processEnumItems) ⇒
    • [~processBitmaps(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processBitmaps) ⇒
    • [~processBitmapFields(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processBitmapFields) ⇒
    • [~prepareStruct2(a, dataType)](#module_Loader API_ Loader APIs..prepareStruct2) ⇒
    • [~processStruct(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processStruct) ⇒
    • [~processStructItems(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processStructItems) ⇒
    • [~prepareEnumsOrBitmapsAtomic(a, dataType)](#module_Loader API_ Loader APIs..prepareEnumsOrBitmapsAtomic) ⇒
    • [~processEnumsFromAtomics(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processEnumsFromAtomics) ⇒
    • [~processBitmapsFromAtomics(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processBitmapsFromAtomics) ⇒
    • [~loadZclData(db, ctx)](#module_Loader API_ Loader APIs..loadZclData) ⇒
    • [~loadIndividualDotDotFile(db, filePath)](#module_Loader API_ Loader APIs..loadIndividualDotDotFile) ⇒ *
    • [~loadToplevelXmlFile(db, ctx)](#module_Loader API_ Loader APIs..loadToplevelXmlFile) ⇒
    • [~parseNewXmlFiles(db, packageId, files, context)](#module_Loader API_ Loader APIs..parseNewXmlFiles) ⇒
    • [~prepXmlFeature(f)](#module_Loader API_ Loader APIs..prepXmlFeature) ⇒
    • [~prepXmlAttribute(a)](#module_Loader API_ Loader APIs..prepXmlAttribute) ⇒
    • [~prepXmlCommand(c)](#module_Loader API_ Loader APIs..prepXmlCommand) ⇒
    • [~prepXmlEvent(e)](#module_Loader API_ Loader APIs..prepXmlEvent) ⇒
    • [~parseSingleNewXmlFile(f)](#module_Loader API_ Loader APIs..parseSingleNewXmlFile) ⇒
    • [~collectDataFromJsonFile(ctx)](#module_Loader API_ Loader APIs..collectDataFromJsonFile) ⇒
    • [~collectDataFromPropertiesFile(ctx)](#module_Loader API_ Loader APIs..collectDataFromPropertiesFile) ⇒
    • [~maskToType(mask)](#module_Loader API_ Loader APIs..maskToType) ⇒
    • [~prepareAtomic(a)](#module_Loader API_ Loader APIs..prepareAtomic)
    • [~processAtomics(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processAtomics) ⇒
    • [~prepareClusterGlobalAttribute(cluster)](#module_Loader API_ Loader APIs..prepareClusterGlobalAttribute) ⇒
    • [~extractAccessTag(ac)](#module_Loader API_ Loader APIs..extractAccessTag) ⇒
    • [~extractAccessIntoArray(xmlElement)](#module_Loader API_ Loader APIs..extractAccessIntoArray) ⇒
    • [~prepareCluster(cluster)](#module_Loader API_ Loader APIs..prepareCluster) ⇒
    • [~processClusters(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processClusters) ⇒
    • [~processClusterGlobalAttributes(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processClusterGlobalAttributes) ⇒
    • [~processClusterExtensions(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processClusterExtensions) ⇒
    • [~processGlobals(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processGlobals) ⇒
    • [~prepareTag(tag)](#module_Loader API_ Loader APIs..prepareTag) ⇒
    • [~processDefaultAccess(db, filePath, packageId, defaultAccessList)](#module_Loader API_ Loader APIs..processDefaultAccess)
    • [~processAccessControl(db, filePath, packageId, accessControlList)](#module_Loader API_ Loader APIs..processAccessControl)
    • [~processTags(db, filePath, packageId, tags)](#module_Loader API_ Loader APIs..processTags)
    • [~prepareDomain(domain)](#module_Loader API_ Loader APIs..prepareDomain) ⇒
    • [~processDomains(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processDomains) ⇒
    • [~prepareDataTypeDiscriminator(a)](#module_Loader API_ Loader APIs..prepareDataTypeDiscriminator) ⇒
    • [~processDataTypeDiscriminator(db, filePath, zclDataTypes)](#module_Loader API_ Loader APIs..processDataTypeDiscriminator) ⇒
    • [~prepareDataType(a, dataType, typeMap)](#module_Loader API_ Loader APIs..prepareDataType) ⇒
    • [~processDataType(db, filePath, packageId, knownPackages, data, dataType)](#module_Loader API_ Loader APIs..processDataType) ⇒
    • [~prepareNumber(a, dataType)](#module_Loader API_ Loader APIs..prepareNumber) ⇒
    • [~processNumber(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processNumber) ⇒
    • [~prepareString(a, dataType)](#module_Loader API_ Loader APIs..prepareString) ⇒
    • [~processString(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processString) ⇒
    • [~prepareEnumOrBitmapAtomic(a, dataType)](#module_Loader API_ Loader APIs..prepareEnumOrBitmapAtomic) ⇒
    • [~processEnumAtomic(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processEnumAtomic) ⇒
    • [~prepareEnumOrBitmap(a, dataType)](#module_Loader API_ Loader APIs..prepareEnumOrBitmap) ⇒
    • [~processEnum(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processEnum) ⇒
    • [~processEnumItems(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processEnumItems) ⇒
    • [~processBitmapAtomic(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processBitmapAtomic) ⇒
    • [~processBitmap(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processBitmap) ⇒
    • [~processBitmapFields(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processBitmapFields) ⇒
    • [~prepareStruct(a, dataType)](#module_Loader API_ Loader APIs..prepareStruct) ⇒
    • [~processStruct(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processStruct) ⇒
    • [~processStructItems(db, filePath, packageIds, data)](#module_Loader API_ Loader APIs..processStructItems) ⇒
    • [~prepareDeviceType(deviceType)](#module_Loader API_ Loader APIs..prepareDeviceType) ⇒ Object
    • [~processDeviceTypes(db, filePath, packageId, data, context)](#module_Loader API_ Loader APIs..processDeviceTypes) ⇒ Promise
    • [~processReloadDeviceTypes()](#module_Loader API_ Loader APIs..processReloadDeviceTypes) ⇒ Promise
    • [~processDataTypes(db, filePath, packageId, knownPackages, toplevel)](#module_Loader API_ Loader APIs..processDataTypes) ⇒
    • [~processAtomicTypes(db, filePath, packageId, knownPackages, toplevel)](#module_Loader API_ Loader APIs..processAtomicTypes) ⇒
    • [~processNonAtomicTypes(db, filePath, packageId, knownPackages, toplevel, featureClusters)](#module_Loader API_ Loader APIs..processNonAtomicTypes) ⇒
    • [~processSubItems(db, filePath, packageId, knownPackages, toplevel, featureClusters, context, collectedStructItems)](#module_Loader API_ Loader APIs..processSubItems) ⇒
    • [~processParsedZclData(db, argument, previouslyKnownPackages, context, collectedStructItems)](#module_Loader API_ Loader APIs..processParsedZclData) ⇒
    • [~parseSingleZclFile(db, packageId, file, context, collectedStructItems)](#module_Loader API_ Loader APIs..parseSingleZclFile) ⇒
    • [~isCrcMismatchOrPackageDoesNotExist(db, packageId, files)](#module_Loader API_ Loader APIs..isCrcMismatchOrPackageDoesNotExist) ⇒
    • [~parseZclFiles(db, packageId, zclFiles, context)](#module_Loader API_ Loader APIs..parseZclFiles) ⇒
    • [~parseManufacturerData(db, ctx)](#module_Loader API_ Loader APIs..parseManufacturerData) ⇒
    • [~parseProfilesData(db, ctx)](#module_Loader API_ Loader APIs..parseProfilesData) ⇒
    • [~parseFeatureFlags(db, packageId, featureFlags)](#module_Loader API_ Loader APIs..parseFeatureFlags) ⇒
    • [~parseUiOptions(db, packageId, featureFlags)](#module_Loader API_ Loader APIs..parseUiOptions) ⇒
    • [~parseOptions(db)](#module_Loader API_ Loader APIs..parseOptions) ⇒
    • [~parseTextOptions(db, pkgRef, textOptions)](#module_Loader API_ Loader APIs..parseTextOptions) ⇒
    • [~parseBoolOptions(db, pkgRef, booleanCategories)](#module_Loader API_ Loader APIs..parseBoolOptions) ⇒
    • [~parseattributeAccessInterfaceAttributes(db, pkgRef, attributeAccessInterfaceAttributes)](#module_Loader API_ Loader APIs..parseattributeAccessInterfaceAttributes) ⇒ Promise.<void>
    • [~parseDefaults(db, ctx)](#module_Loader API_ Loader APIs..parseDefaults) ⇒
    • [~parseTextDefaults(db, pkgRef, textDefaults)](#module_Loader API_ Loader APIs..parseTextDefaults) ⇒
    • [~parseBoolDefaults(db, pkgRef, booleanCategories)](#module_Loader API_ Loader APIs..parseBoolDefaults) ⇒
    • [~loadIndividualSilabsFile(db, filePath)](#module_Loader API_ Loader APIs..loadIndividualSilabsFile) ⇒
    • [~processCustomZclDeviceType(db, ctx)](#module_Loader API_ Loader APIs..processCustomZclDeviceType) ⇒
    • [~loadZclJson(db, metafile)](#module_Loader API_ Loader APIs..loadZclJson) ⇒
    • [~loadZclProperties(db, metafile)](#module_Loader API_ Loader APIs..loadZclProperties) ⇒
    • [~loadZclJsonOrProperties(db, ctx)](#module_Loader API_ Loader APIs..loadZclJsonOrProperties) ⇒
    • [~recordToplevelPackage(db, metadataFile, crc, isTopLevelPackageInSync)](#module_Loader API_ Loader APIs..recordToplevelPackage) ⇒
    • [~recordVersion(db, ctx)](#module_Loader API_ Loader APIs..recordVersion)
    • [~loadZclMetaFilesCommon(db, metadataFile, options)](#module_Loader API_ Loader APIs..loadZclMetaFilesCommon) ⇒
    • [~loadAttributeMappingForMultiProtocol(db, multiProtcolInfo, categoryToPackageIdMap)](#module_Loader API_ Loader APIs..loadAttributeMappingForMultiProtocol)
    • [~loadZclMetafiles(db, metadataFile)](#module_Loader API_ Loader APIs..loadZclMetafiles) ⇒
    • [~loadZcl(db, metadataFile)](#module_Loader API_ Loader APIs..loadZcl) ⇒
    • [~loadIndividualFile(db, filePath, sessionId)](#module_Loader API_ Loader APIs..loadIndividualFile)
    • [~qualifyZclFile(db, info, parentPackageId, isCustom)](#module_Loader API_ Loader APIs..qualifyZclFile) ⇒
    • [~processZclPostLoading(db, packageId)](#module_Loader API_ Loader APIs..processZclPostLoading) ⇒
    • [~getDiscriminatorMap(db, packageIds)](#module_Loader API_ Loader APIs..getDiscriminatorMap) ⇒

Loader API: Loader APIs~collectDataFromLibraryXml(ctx) ⇒

Promises to read the properties file, extract all the actual xml files, and resolve with the array of files.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of resolved files.

Param Type Description
ctx * Context which contains information about the metadataFiles and data

Loader API: Loader APIs~tagContainsEnum(tag) ⇒

Check if tag contains enum.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: boolean

Param Type
tag *

Loader API: Loader APIs~tagContainsStruct(tag) ⇒

Check if tag contains struct.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: boolean

Param Type
tag *

Loader API: Loader APIs~tagContainsBitmap(tag) ⇒

Check if tag contains Bitmap.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: boolean

Param Type
tag *

Loader API: Loader APIs~parseSingleZclFile(db, ctx, file) ⇒

Parses ZCL xml file.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: empty array

Param Type
db *
ctx *
file *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise that resolves when all the individual promises of each file pass.

Param Type
db *
ctx *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Either the normalized hex string (with the 0x prefix) or the original

Param Type Description
value * the string value to be normalized

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: size in bytes or 0 if the # of bytes could not be determined

Param Type Description
value * the string value to be scraped

Loader API: Loader APIs~prepareAttributes(attributes, side) ⇒

Prepare XML attributes for entry into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Array containing all data from XML ready to be inserted into the DB.

Param Type Description
attributes * an array of attributes
side * the side the attribute is on either "client" or "server"

Loader API: Loader APIs~prepareCommands(commands, side, types) ⇒

Prepare XML commands for entry into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Array containing all data from XML ready to be inserted in to the DB.

Param Type Description
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.

Loader API: Loader APIs~prepareCluster(cluster, isExtension, types) ⇒

Prepare XML cluster for insertion into the database. This method can also prepare clusterExtensions.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Object containing all data from XML.

Param Type Default Description
cluster *
isExtension * false if this is an extension or not (there are none in dotdot xml)
types * types object into which cluster can put types it might have

Loader API: Loader APIs~prepareAtomic(type) ⇒

Parses xml type into the atomic object for insertion into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: object ready for insertion into the DB

Param Type Description
type * an xml object which conforms to the atomic format in the dotdot xml

Loader API: Loader APIs~prepareSubAtomic(type, atomics) ⇒

Parses xml type into the sub-atomic object for insertion into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: object ready for insertion into the DB

Param Type Description
type * an xml object which conforms to the sub-atomic format in the dotdot xml
atomics * an array of atomic types

Loader API: Loader APIs~prepareBitmap(type, isContained) ⇒

Parses xml type into the bitmap object for insertion into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: object ready for insertion into the DB

Param Type Default Description
type * an xml object which conforms to the bitmap format in the dotdot xml
isContained * false a boolean indicating if this is coming from a contained tag or not

Loader API: Loader APIs~prepareEnum(type) ⇒

Parses xml type into the enum object for insertion into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: object ready for insertion into the DB

Param Type Description
type * an xml object which conforms to the enum format in the dotdot xml

Loader API: Loader APIs~prepareStruct(type) ⇒

Parses xml type into the struct object for insertion into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: object ready for insertion into the DB

Param Type Description
type * an xml object which conforms to the struct format in the dotdot xml

Loader API: Loader APIs~prepareSubAtomicTypes(types)

Parses array of xml objects that conform to the sub-atomic format in the dotdot xml

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type
types *

Loader API: Loader APIs~prepareTypes(zclTypes, types)

Parses xml types into the types object for insertion into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type Description
zclTypes * an array of xml types
types * an object which includes arrays for enums, bitmaps etc...

Loader API: Loader APIs~prepareAttributeType(attribute, types, cluster)

Parses xml types into the types object for insertion into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type Description
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)

Loader API: Loader APIs~prepareDeviceType(deviceType) ⇒

Preparation step for the device types.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: an object containing the prepared device types.

Param Type
deviceType *

Loader API: Loader APIs~prepareDataTypeDiscriminator(a) ⇒

Prepare Data Type Discriminator for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *

Loader API: Loader APIs~processDataTypeDiscriminator(db, packageId, zclDataTypes) ⇒

Processes Data Type Discriminator.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted Data Type Discriminators.

Param Type
db *
packageId *
zclDataTypes *

Loader API: Loader APIs~prepareDataType(a, dataType, typeMap) ⇒

Prepare Data Types for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *
typeMap *

Loader API: Loader APIs~processDataType(db, filePath, packageId, data, dataType) ⇒

Processes Data Type.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted Data Types into the Data Type table.

Param Type
db *
filePath *
packageId *
data *
dataType *

Loader API: Loader APIs~prepareNumber(a, dataType) ⇒

Prepare numbers for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processNumber(db, filePath, packageId, data) ⇒

Processes Numbers.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted numbers into the number table.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~prepareString(a, dataType) ⇒

Prepare strings for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processString(db, filePath, packageId, data) ⇒

Processes Strings.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted strings into the String table.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~prepareEnumsOrBitmaps(a, dataType) ⇒

Prepare enums or bitmaps for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processEnums(db, filePath, packageId, data) ⇒

Processes the enums.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted enums.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~processEnumItems(db, filePath, packageId, data) ⇒

Processes the enum Items.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted enum items.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~processBitmaps(db, filePath, packageId, data) ⇒

Processes the bitmaps.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted bitmaps.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~processBitmapFields(db, filePath, packageId, data) ⇒

Processes the bitmap fields.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted bitmap fields.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~prepareStruct2(a, dataType) ⇒

Prepare structs for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processStruct(db, filePath, packageId, data) ⇒

Processes the structs.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted structs.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~processStructItems(db, filePath, packageId, data) ⇒

Processes the struct Items.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted struct items.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~prepareEnumsOrBitmapsAtomic(a, dataType) ⇒

Prepare enums or bitmaps for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processEnumsFromAtomics(db, filePath, packageId, data) ⇒

Processes the enums.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted enums.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~processBitmapsFromAtomics(db, filePath, packageId, data) ⇒

Processes the bitmaps.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted bitmaps.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise that resolves when all the individual promises of each file pass.

Param Type
db *
ctx *

Loader API: Loader APIs~loadIndividualDotDotFile(db, filePath) ⇒ *

TODO This is not supported at this time.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: * - object w/ following: { packageId: pkgId } or { err: err }

Param Type
db *
filePath *

Loader API: Loader APIs~loadToplevelXmlFile(db, ctx) ⇒

Toplevel function that loads the xml library file and orchestrates the promise chain.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: a Promise that resolves with the db.

Param Type Description
db *
ctx * Context of loading.

Loader API: Loader APIs~parseNewXmlFiles(db, packageId, files, context) ⇒

Parses the new XML files. Returns an object containing loaded data: clusterIdsLoaded: array of cluster ids that were loaded

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise that resolves when all the new XML data is loaded.

Param Type
db *
packageId *
files *
context *

Loader API: Loader APIs~prepXmlFeature(f) ⇒

Prepare features from xml.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: feature information

Param Type
f *

Loader API: Loader APIs~prepXmlAttribute(a) ⇒

Prepare attributes from xml.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: attribute information

Param Type
a *

Loader API: Loader APIs~prepXmlCommand(c) ⇒

Prepare commands from xml.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: command information

Param Type
c *

Loader API: Loader APIs~prepXmlEvent(e) ⇒

Prepare events from xml

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: event information

Param Type
e *

Loader API: Loader APIs~parseSingleNewXmlFile(f) ⇒

Parse xml file.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: xml information from file

Param Type
f *

Loader API: Loader APIs~collectDataFromJsonFile(ctx) ⇒

Promises to read the JSON file and resolve all the data.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of resolved file.

Param Type Description
ctx * Context containing information about the file

Loader API: Loader APIs~collectDataFromPropertiesFile(ctx) ⇒

Promises to read the properties file, extract all the actual xml files, and resolve with the array of files.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of resolved files.

Param Type Description
ctx * Context which contains information about the propertiesFiles and data

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: bool or corresponding enum

Param Type
mask *

Loader API: Loader APIs~prepareAtomic(a)

Prepare atomic to db insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type
a *

Loader API: Loader APIs~processAtomics(db, filePath, packageId, data) ⇒

Processes atomic types for DB insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted bitmaps

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~prepareClusterGlobalAttribute(cluster) ⇒

Prepares global attribute data.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Object containing the data from XML.

Param Type
cluster *

Loader API: Loader APIs~extractAccessTag(ac) ⇒

Extract access information

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: access tag information

Param Type
ac *

Loader API: Loader APIs~extractAccessIntoArray(xmlElement) ⇒

Extract list of access information

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: array of access information

Param Type
xmlElement *

Loader API: Loader APIs~prepareCluster(cluster) ⇒

Prepare XML cluster for insertion into the database. This method can also prepare clusterExtensions.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Object containing all data from XML.

Param Type
cluster *

Loader API: Loader APIs~processClusters(db, filePath, packageId, data) ⇒

Process clusters for insertion into the database.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of cluster insertion.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~processClusterGlobalAttributes(db, filePath, packageId, data) ⇒

Processes global attributes for insertion into the database.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted data.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: promise to resolve the clusterExtension tags

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: promise to resolve the globals

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~prepareTag(tag) ⇒

Prepare tag object from tag

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: tag information

Param Type
tag *

Loader API: Loader APIs~processDefaultAccess(db, filePath, packageId, defaultAccessList)

Process defaultAccess tag in the XML.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type
db *
filePath *
packageId *
defaultAccessList *

Loader API: Loader APIs~processAccessControl(db, filePath, packageId, accessControlList)

Process accessControl tag in the XML.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type
db *
filePath *
packageId *
accessControlList *

Loader API: Loader APIs~processTags(db, filePath, packageId, tags)

Processes the tags in the XML.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type
db *
filePath *
packageId *
tags *

Loader API: Loader APIs~prepareDomain(domain) ⇒

Convert domain from XMl to domain for DB.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Domain object for DB.

Param Type
domain *

Loader API: Loader APIs~processDomains(db, filePath, packageId, data) ⇒

Process domains for insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of database insertion of domains.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~prepareDataTypeDiscriminator(a) ⇒

Prepare Data Type Discriminator for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *

Loader API: Loader APIs~processDataTypeDiscriminator(db, filePath, zclDataTypes) ⇒

Processes Data Type Discriminator.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted Data Type Discriminators.

Param Type
db *
filePath *
zclDataTypes *

Loader API: Loader APIs~prepareDataType(a, dataType, typeMap) ⇒

Prepare Data Types for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *
typeMap *

Loader API: Loader APIs~processDataType(db, filePath, packageId, knownPackages, data, dataType) ⇒

Processes Data Type.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted Data Types into the Data Type table.

Param Type
db *
filePath *
packageId *
knownPackages *
data *
dataType *

Loader API: Loader APIs~prepareNumber(a, dataType) ⇒

Prepare numbers for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processNumber(db, filePath, packageId, knownPackages, data) ⇒

Processes Numbers.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted numbers into the number table.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~prepareString(a, dataType) ⇒

Prepare strings for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processString(db, filePath, packageId, knownPackages, data) ⇒

Processes Strings.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted strings into the String table.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~prepareEnumOrBitmapAtomic(a, dataType) ⇒

Prepare enums or bitmaps for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processEnumAtomic(db, filePath, packageId, knownPackages, data) ⇒

Processes the enums.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted enums.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~prepareEnumOrBitmap(a, dataType) ⇒

Prepare enums or bitmaps for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processEnum(db, filePath, packageId, knownPackages, data) ⇒

Processes the enums.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted enums.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~processEnumItems(db, filePath, packageId, knownPackages, data) ⇒

Processes the enum Items.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted enum items.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~processBitmapAtomic(db, filePath, packageId, knownPackages, data) ⇒

Processes the bitmaps.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted bitmaps.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~processBitmap(db, filePath, packageId, knownPackages, data) ⇒

Processes the bitmaps.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted bitmaps.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~processBitmapFields(db, filePath, packageId, knownPackages, data) ⇒

Processes the bitmap fields.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted bitmap fields.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~prepareStruct(a, dataType) ⇒

Prepare structs for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processStruct(db, filePath, packageId, knownPackages, data) ⇒

Processes the structs.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted structs.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~processStructItems(db, filePath, packageIds, data) ⇒

Processes the struct Items.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted struct items.

Param Type
db *
filePath *
packageIds *
data *

Loader API: Loader APIs~prepareDeviceType(deviceType) ⇒ Object

Prepares a device type object by extracting and transforming its properties.

This function takes a device type object and processes its properties to create a new object with a specific structure. It handles various properties such as device ID, profile ID, domain, name, description, class, scope, and superset. Additionally, it processes endpoint compositions and clusters if they exist.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Object - The prepared device type object with transformed properties.

Param Type Description
deviceType Object The device type object to be prepared.

Loader API: Loader APIs~processDeviceTypes(db, filePath, packageId, data, context) ⇒ Promise

Processes and inserts device types into the database. This function logs the number of device types being processed for debugging purposes. It maps over the provided data to prepare each device type and then iterates over each prepared device type. If a device type has a compositionType, it inserts the endpoint composition into the database, retrieves the endpoint composition ID, and then inserts the device composition. Finally, it inserts all prepared device types into the database.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise - A promise that resolves after all device types have been inserted into the database.

Param Type Description
db * The database connection object.
filePath string The file path from which the device types are being processed.
packageId * The package ID associated with the device types.
data Array The array of device types to be processed.
context * Additional context that might be required for processing.

Loader API: Loader APIs~processReloadDeviceTypes() ⇒ Promise

Processes and reloads device type entities in the database. This function is called when a custom xml with device types is reloaded.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise - A promise that resolves after all device types have been reloaded.

Loader API: Loader APIs~processDataTypes(db, filePath, packageId, knownPackages, toplevel) ⇒

Process promises for loading the data types

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of data types

Param Type
db *
filePath *
packageId *
knownPackages *
toplevel *

Loader API: Loader APIs~processAtomicTypes(db, filePath, packageId, knownPackages, toplevel) ⇒

Processes promises for loading individual tables per data type for atomics/baseline types.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of atomic/baseline processing.

Param Type
db *
filePath *
packageId *
knownPackages *
toplevel *

Loader API: Loader APIs~processNonAtomicTypes(db, filePath, packageId, knownPackages, toplevel, featureClusters) ⇒

Processes promises for loading individual tables per data type for no-atomic and inherited types.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of non-atomic/inherited data type processing.

Param Type
db *
filePath *
packageId *
knownPackages *
toplevel *
featureClusters *

Loader API: Loader APIs~processSubItems(db, filePath, packageId, knownPackages, toplevel, featureClusters, context, collectedStructItems) ⇒

Processes promises for loading items within a bitmap, struct, and enum data types.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of processing sub items within a bitmap, enum and structs.

Param Type
db *
filePath *
packageId *
knownPackages *
toplevel *
featureClusters *
context *
collectedStructItems *

Loader API: Loader APIs~processParsedZclData(db, argument, previouslyKnownPackages, context, collectedStructItems) ⇒

After XML parser is done with the barebones parsing, this function branches the individual toplevel tags.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: promise that resolves when all the subtags are parsed.

Param Type
db *
argument *
previouslyKnownPackages *
context *
collectedStructItems *

Loader API: Loader APIs~parseSingleZclFile(db, packageId, file, context, collectedStructItems) ⇒

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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise for when the last stage of the loading pipeline finishes.

Param Type
db *
packageId *
file *
context *
collectedStructItems *

Loader API: Loader APIs~isCrcMismatchOrPackageDoesNotExist(db, packageId, files) ⇒

Checks if there is a crc mismatch on any xml file. This can be used to decide if there is a need to reload all the xml files. Also check if the package is not loaded before.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: the status of crc mismatch and whether a package is present in an object

Param Type
db *
packageId *
files *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise that resolves when all the individual promises of each file pass.

Param Type
db *
packageId *
zclFiles *
context *

Loader API: Loader APIs~parseManufacturerData(db, ctx) ⇒

Parses the manufacturers xml.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of a parsed manufacturers file.

Param Type
db *
ctx *

Loader API: Loader APIs~parseProfilesData(db, ctx) ⇒

Parses the profiles xml.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of a parsed profiles file.

Param Type
db *
ctx *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: array of feature flags

Param Type
db *
packageId *
featureFlags *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise that loads the uiOptions object into the database.

Param Type
db *
packageId *
featureFlags *

Loader API: Loader APIs~parseOptions(db) ⇒

Parses and loads the text and boolean options.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: promise of parsed options

Param Type
db *

Loader API: Loader APIs~parseTextOptions(db, pkgRef, textOptions) ⇒

Parses the text options.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of a parsed text options.

Param Type
db *
pkgRef *
textOptions *

Loader API: Loader APIs~parseBoolOptions(db, pkgRef, booleanCategories) ⇒

Parses the boolean options.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of a parsed boolean options.

Param Type
db *
pkgRef *
booleanCategories *

Loader API: Loader APIs~parseattributeAccessInterfaceAttributes(db, pkgRef, attributeAccessInterfaceAttributes) ⇒ Promise.<void>

Asynchronously parses and inserts attribute access interface attributes into the database. This function iterates over the attributeAccessInterfaceAttributes object, processing each cluster by mapping its values to a specific structure and then inserting them into the database using the insertOptionsKeyValues function.

The main purpose of this function is to store cluster/attribute pairs including global attributes and their cluster pair The ATTRIBUTE table has cluster_ref as null for global attributes so this second method was necessary

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise.<void> - A promise that resolves when all attributes have been processed and inserted.

Param Type Description
db * The database connection object.
pkgRef * The package reference id for which the attributes are being parsed.
attributeAccessInterfaceAttributes * An object containing the attribute access interface attributes, structured by cluster.

Loader API: Loader APIs~parseDefaults(db, ctx) ⇒

Parses the default values inside the options.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promised of parsed text and bool defaults.

Param Type
db *
ctx *

Loader API: Loader APIs~parseTextDefaults(db, pkgRef, textDefaults) ⇒

Parse text defaults from default options.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Array of promises

Param Type
db *
pkgRef *
textDefaults *

Loader API: Loader APIs~parseBoolDefaults(db, pkgRef, booleanCategories) ⇒

Parse the boolean defaults inside options.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: List of promises

Param Type
db *
pkgRef *
booleanCategories *

Loader API: Loader APIs~loadIndividualSilabsFile(db, filePath) ⇒

Parses a single file. This function is used specifically for adding a package through an existing ZAP session because of its reliance on relating the new XML content to the packages associated with that session. e.g. for ClusterExtensions.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of a loaded file.

Param Type
db *
filePath *

Loader API: Loader APIs~processCustomZclDeviceType(db, ctx) ⇒

If custom device is supported, then this method creates it.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: context

Param Type
db *
ctx *

Loader API: Loader APIs~loadZclJson(db, metafile) ⇒

Load ZCL metadata

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of loaded zcl json file

Param Type
db *
metafile *

Loader API: Loader APIs~loadZclProperties(db, metafile) ⇒

Load ZCL metadata

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of loaded zcl properties file

Param Type
db *
metafile *

Loader API: Loader APIs~loadZclJsonOrProperties(db, ctx) ⇒

Toplevel function that loads the toplevel metafile and orchestrates the promise chain.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: a Promise that resolves with the db.

Param Type Description
db *
ctx * The context of loading.

Loader API: Loader APIs~recordToplevelPackage(db, metadataFile, crc, isTopLevelPackageInSync) ⇒

Records the toplevel package information and resolves into packageId

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: packageId

Param Type
db *
metadataFile *
crc *
isTopLevelPackageInSync *

Loader API: Loader APIs~recordVersion(db, ctx)

Records the version into the database.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type
db *
ctx *

Loader API: Loader APIs~loadZclMetaFilesCommon(db, metadataFile, options) ⇒

Retrieve zcl package information

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: package zcl package information

Param Type
db *
metadataFile *
options *

Loader API: Loader APIs~loadAttributeMappingForMultiProtocol(db, multiProtcolInfo, categoryToPackageIdMap)

Load attribute mapping table if there is multi-protocol information from a json file.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type
db *
multiProtcolInfo *
categoryToPackageIdMap *

Loader API: Loader APIs~loadZclMetafiles(db, metadataFile) ⇒

Toplevel function that loads the zcl file and passes it off to the correct zcl loader.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Array of loaded packageIds.

Param Type Description
db *
metadataFile * array of paths

Loader API: Loader APIs~loadZcl(db, metadataFile) ⇒

Loads individual zcl.json metafile.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Context object that contains .db and .packageId

Param Type
db *
metadataFile *

Loader API: Loader APIs~loadIndividualFile(db, filePath, sessionId)

Load individual custom XML files.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type Description
db *
filePath *
sessionId * Current session within which we're loading this file.

Loader API: Loader APIs~qualifyZclFile(db, info, parentPackageId, isCustom) ⇒

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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise that resolves int he object of data.

Param Type
db *
info *
parentPackageId *
isCustom *

Loader API: Loader APIs~processZclPostLoading(db, packageId) ⇒

Promises to perform a post loading step.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise to deal with the post-loading cleanup.

Param Type
db *
packageId *

Loader API: Loader APIs~getDiscriminatorMap(db, packageIds) ⇒

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: data type discriminator map

Param Type
db *
packageIds *

Loader API: Loader APIs

This module provides the APIs for new data model loading

  • [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
    • [~collectDataFromLibraryXml(ctx)](#module_Loader API_ Loader APIs..collectDataFromLibraryXml) ⇒
    • [~tagContainsEnum(tag)](#module_Loader API_ Loader APIs..tagContainsEnum) ⇒
    • [~tagContainsStruct(tag)](#module_Loader API_ Loader APIs..tagContainsStruct) ⇒
    • [~tagContainsBitmap(tag)](#module_Loader API_ Loader APIs..tagContainsBitmap) ⇒
    • [~parseSingleZclFile(db, ctx, file)](#module_Loader API_ Loader APIs..parseSingleZclFile) ⇒
    • [~parseZclFiles(db, ctx)](#module_Loader API_ Loader APIs..parseZclFiles) ⇒
    • [~normalizeHexValue(value)](#module_Loader API_ Loader APIs..normalizeHexValue) ⇒
    • [~getNumBytesFromShortName(value)](#module_Loader API_ Loader APIs..getNumBytesFromShortName) ⇒
    • [~prepareAttributes(attributes, side)](#module_Loader API_ Loader APIs..prepareAttributes) ⇒
    • [~prepareCommands(commands, side, types)](#module_Loader API_ Loader APIs..prepareCommands) ⇒
    • [~prepareCluster(cluster, isExtension, types)](#module_Loader API_ Loader APIs..prepareCluster) ⇒
    • [~prepareAtomic(type)](#module_Loader API_ Loader APIs..prepareAtomic) ⇒
    • [~prepareSubAtomic(type, atomics)](#module_Loader API_ Loader APIs..prepareSubAtomic) ⇒
    • [~prepareBitmap(type, isContained)](#module_Loader API_ Loader APIs..prepareBitmap) ⇒
    • [~prepareEnum(type)](#module_Loader API_ Loader APIs..prepareEnum) ⇒
    • [~prepareStruct(type)](#module_Loader API_ Loader APIs..prepareStruct) ⇒
    • [~prepareSubAtomicTypes(types)](#module_Loader API_ Loader APIs..prepareSubAtomicTypes)
    • [~prepareTypes(zclTypes, types)](#module_Loader API_ Loader APIs..prepareTypes)
    • [~prepareAttributeType(attribute, types, cluster)](#module_Loader API_ Loader APIs..prepareAttributeType)
    • [~prepareDeviceType(deviceType)](#module_Loader API_ Loader APIs..prepareDeviceType) ⇒
    • [~prepareDataTypeDiscriminator(a)](#module_Loader API_ Loader APIs..prepareDataTypeDiscriminator) ⇒
    • [~processDataTypeDiscriminator(db, packageId, zclDataTypes)](#module_Loader API_ Loader APIs..processDataTypeDiscriminator) ⇒
    • [~prepareDataType(a, dataType, typeMap)](#module_Loader API_ Loader APIs..prepareDataType) ⇒
    • [~processDataType(db, filePath, packageId, data, dataType)](#module_Loader API_ Loader APIs..processDataType) ⇒
    • [~prepareNumber(a, dataType)](#module_Loader API_ Loader APIs..prepareNumber) ⇒
    • [~processNumber(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processNumber) ⇒
    • [~prepareString(a, dataType)](#module_Loader API_ Loader APIs..prepareString) ⇒
    • [~processString(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processString) ⇒
    • [~prepareEnumsOrBitmaps(a, dataType)](#module_Loader API_ Loader APIs..prepareEnumsOrBitmaps) ⇒
    • [~processEnums(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processEnums) ⇒
    • [~processEnumItems(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processEnumItems) ⇒
    • [~processBitmaps(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processBitmaps) ⇒
    • [~processBitmapFields(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processBitmapFields) ⇒
    • [~prepareStruct2(a, dataType)](#module_Loader API_ Loader APIs..prepareStruct2) ⇒
    • [~processStruct(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processStruct) ⇒
    • [~processStructItems(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processStructItems) ⇒
    • [~prepareEnumsOrBitmapsAtomic(a, dataType)](#module_Loader API_ Loader APIs..prepareEnumsOrBitmapsAtomic) ⇒
    • [~processEnumsFromAtomics(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processEnumsFromAtomics) ⇒
    • [~processBitmapsFromAtomics(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processBitmapsFromAtomics) ⇒
    • [~loadZclData(db, ctx)](#module_Loader API_ Loader APIs..loadZclData) ⇒
    • [~loadIndividualDotDotFile(db, filePath)](#module_Loader API_ Loader APIs..loadIndividualDotDotFile) ⇒ *
    • [~loadToplevelXmlFile(db, ctx)](#module_Loader API_ Loader APIs..loadToplevelXmlFile) ⇒
    • [~parseNewXmlFiles(db, packageId, files, context)](#module_Loader API_ Loader APIs..parseNewXmlFiles) ⇒
    • [~prepXmlFeature(f)](#module_Loader API_ Loader APIs..prepXmlFeature) ⇒
    • [~prepXmlAttribute(a)](#module_Loader API_ Loader APIs..prepXmlAttribute) ⇒
    • [~prepXmlCommand(c)](#module_Loader API_ Loader APIs..prepXmlCommand) ⇒
    • [~prepXmlEvent(e)](#module_Loader API_ Loader APIs..prepXmlEvent) ⇒
    • [~parseSingleNewXmlFile(f)](#module_Loader API_ Loader APIs..parseSingleNewXmlFile) ⇒
    • [~collectDataFromJsonFile(ctx)](#module_Loader API_ Loader APIs..collectDataFromJsonFile) ⇒
    • [~collectDataFromPropertiesFile(ctx)](#module_Loader API_ Loader APIs..collectDataFromPropertiesFile) ⇒
    • [~maskToType(mask)](#module_Loader API_ Loader APIs..maskToType) ⇒
    • [~prepareAtomic(a)](#module_Loader API_ Loader APIs..prepareAtomic)
    • [~processAtomics(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processAtomics) ⇒
    • [~prepareClusterGlobalAttribute(cluster)](#module_Loader API_ Loader APIs..prepareClusterGlobalAttribute) ⇒
    • [~extractAccessTag(ac)](#module_Loader API_ Loader APIs..extractAccessTag) ⇒
    • [~extractAccessIntoArray(xmlElement)](#module_Loader API_ Loader APIs..extractAccessIntoArray) ⇒
    • [~prepareCluster(cluster)](#module_Loader API_ Loader APIs..prepareCluster) ⇒
    • [~processClusters(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processClusters) ⇒
    • [~processClusterGlobalAttributes(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processClusterGlobalAttributes) ⇒
    • [~processClusterExtensions(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processClusterExtensions) ⇒
    • [~processGlobals(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processGlobals) ⇒
    • [~prepareTag(tag)](#module_Loader API_ Loader APIs..prepareTag) ⇒
    • [~processDefaultAccess(db, filePath, packageId, defaultAccessList)](#module_Loader API_ Loader APIs..processDefaultAccess)
    • [~processAccessControl(db, filePath, packageId, accessControlList)](#module_Loader API_ Loader APIs..processAccessControl)
    • [~processTags(db, filePath, packageId, tags)](#module_Loader API_ Loader APIs..processTags)
    • [~prepareDomain(domain)](#module_Loader API_ Loader APIs..prepareDomain) ⇒
    • [~processDomains(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processDomains) ⇒
    • [~prepareDataTypeDiscriminator(a)](#module_Loader API_ Loader APIs..prepareDataTypeDiscriminator) ⇒
    • [~processDataTypeDiscriminator(db, filePath, zclDataTypes)](#module_Loader API_ Loader APIs..processDataTypeDiscriminator) ⇒
    • [~prepareDataType(a, dataType, typeMap)](#module_Loader API_ Loader APIs..prepareDataType) ⇒
    • [~processDataType(db, filePath, packageId, knownPackages, data, dataType)](#module_Loader API_ Loader APIs..processDataType) ⇒
    • [~prepareNumber(a, dataType)](#module_Loader API_ Loader APIs..prepareNumber) ⇒
    • [~processNumber(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processNumber) ⇒
    • [~prepareString(a, dataType)](#module_Loader API_ Loader APIs..prepareString) ⇒
    • [~processString(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processString) ⇒
    • [~prepareEnumOrBitmapAtomic(a, dataType)](#module_Loader API_ Loader APIs..prepareEnumOrBitmapAtomic) ⇒
    • [~processEnumAtomic(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processEnumAtomic) ⇒
    • [~prepareEnumOrBitmap(a, dataType)](#module_Loader API_ Loader APIs..prepareEnumOrBitmap) ⇒
    • [~processEnum(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processEnum) ⇒
    • [~processEnumItems(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processEnumItems) ⇒
    • [~processBitmapAtomic(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processBitmapAtomic) ⇒
    • [~processBitmap(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processBitmap) ⇒
    • [~processBitmapFields(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processBitmapFields) ⇒
    • [~prepareStruct(a, dataType)](#module_Loader API_ Loader APIs..prepareStruct) ⇒
    • [~processStruct(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processStruct) ⇒
    • [~processStructItems(db, filePath, packageIds, data)](#module_Loader API_ Loader APIs..processStructItems) ⇒
    • [~prepareDeviceType(deviceType)](#module_Loader API_ Loader APIs..prepareDeviceType) ⇒ Object
    • [~processDeviceTypes(db, filePath, packageId, data, context)](#module_Loader API_ Loader APIs..processDeviceTypes) ⇒ Promise
    • [~processReloadDeviceTypes()](#module_Loader API_ Loader APIs..processReloadDeviceTypes) ⇒ Promise
    • [~processDataTypes(db, filePath, packageId, knownPackages, toplevel)](#module_Loader API_ Loader APIs..processDataTypes) ⇒
    • [~processAtomicTypes(db, filePath, packageId, knownPackages, toplevel)](#module_Loader API_ Loader APIs..processAtomicTypes) ⇒
    • [~processNonAtomicTypes(db, filePath, packageId, knownPackages, toplevel, featureClusters)](#module_Loader API_ Loader APIs..processNonAtomicTypes) ⇒
    • [~processSubItems(db, filePath, packageId, knownPackages, toplevel, featureClusters, context, collectedStructItems)](#module_Loader API_ Loader APIs..processSubItems) ⇒
    • [~processParsedZclData(db, argument, previouslyKnownPackages, context, collectedStructItems)](#module_Loader API_ Loader APIs..processParsedZclData) ⇒
    • [~parseSingleZclFile(db, packageId, file, context, collectedStructItems)](#module_Loader API_ Loader APIs..parseSingleZclFile) ⇒
    • [~isCrcMismatchOrPackageDoesNotExist(db, packageId, files)](#module_Loader API_ Loader APIs..isCrcMismatchOrPackageDoesNotExist) ⇒
    • [~parseZclFiles(db, packageId, zclFiles, context)](#module_Loader API_ Loader APIs..parseZclFiles) ⇒
    • [~parseManufacturerData(db, ctx)](#module_Loader API_ Loader APIs..parseManufacturerData) ⇒
    • [~parseProfilesData(db, ctx)](#module_Loader API_ Loader APIs..parseProfilesData) ⇒
    • [~parseFeatureFlags(db, packageId, featureFlags)](#module_Loader API_ Loader APIs..parseFeatureFlags) ⇒
    • [~parseUiOptions(db, packageId, featureFlags)](#module_Loader API_ Loader APIs..parseUiOptions) ⇒
    • [~parseOptions(db)](#module_Loader API_ Loader APIs..parseOptions) ⇒
    • [~parseTextOptions(db, pkgRef, textOptions)](#module_Loader API_ Loader APIs..parseTextOptions) ⇒
    • [~parseBoolOptions(db, pkgRef, booleanCategories)](#module_Loader API_ Loader APIs..parseBoolOptions) ⇒
    • [~parseattributeAccessInterfaceAttributes(db, pkgRef, attributeAccessInterfaceAttributes)](#module_Loader API_ Loader APIs..parseattributeAccessInterfaceAttributes) ⇒ Promise.<void>
    • [~parseDefaults(db, ctx)](#module_Loader API_ Loader APIs..parseDefaults) ⇒
    • [~parseTextDefaults(db, pkgRef, textDefaults)](#module_Loader API_ Loader APIs..parseTextDefaults) ⇒
    • [~parseBoolDefaults(db, pkgRef, booleanCategories)](#module_Loader API_ Loader APIs..parseBoolDefaults) ⇒
    • [~loadIndividualSilabsFile(db, filePath)](#module_Loader API_ Loader APIs..loadIndividualSilabsFile) ⇒
    • [~processCustomZclDeviceType(db, ctx)](#module_Loader API_ Loader APIs..processCustomZclDeviceType) ⇒
    • [~loadZclJson(db, metafile)](#module_Loader API_ Loader APIs..loadZclJson) ⇒
    • [~loadZclProperties(db, metafile)](#module_Loader API_ Loader APIs..loadZclProperties) ⇒
    • [~loadZclJsonOrProperties(db, ctx)](#module_Loader API_ Loader APIs..loadZclJsonOrProperties) ⇒
    • [~recordToplevelPackage(db, metadataFile, crc, isTopLevelPackageInSync)](#module_Loader API_ Loader APIs..recordToplevelPackage) ⇒
    • [~recordVersion(db, ctx)](#module_Loader API_ Loader APIs..recordVersion)
    • [~loadZclMetaFilesCommon(db, metadataFile, options)](#module_Loader API_ Loader APIs..loadZclMetaFilesCommon) ⇒
    • [~loadAttributeMappingForMultiProtocol(db, multiProtcolInfo, categoryToPackageIdMap)](#module_Loader API_ Loader APIs..loadAttributeMappingForMultiProtocol)
    • [~loadZclMetafiles(db, metadataFile)](#module_Loader API_ Loader APIs..loadZclMetafiles) ⇒
    • [~loadZcl(db, metadataFile)](#module_Loader API_ Loader APIs..loadZcl) ⇒
    • [~loadIndividualFile(db, filePath, sessionId)](#module_Loader API_ Loader APIs..loadIndividualFile)
    • [~qualifyZclFile(db, info, parentPackageId, isCustom)](#module_Loader API_ Loader APIs..qualifyZclFile) ⇒
    • [~processZclPostLoading(db, packageId)](#module_Loader API_ Loader APIs..processZclPostLoading) ⇒
    • [~getDiscriminatorMap(db, packageIds)](#module_Loader API_ Loader APIs..getDiscriminatorMap) ⇒

Loader API: Loader APIs~collectDataFromLibraryXml(ctx) ⇒

Promises to read the properties file, extract all the actual xml files, and resolve with the array of files.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of resolved files.

Param Type Description
ctx * Context which contains information about the metadataFiles and data

Loader API: Loader APIs~tagContainsEnum(tag) ⇒

Check if tag contains enum.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: boolean

Param Type
tag *

Loader API: Loader APIs~tagContainsStruct(tag) ⇒

Check if tag contains struct.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: boolean

Param Type
tag *

Loader API: Loader APIs~tagContainsBitmap(tag) ⇒

Check if tag contains Bitmap.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: boolean

Param Type
tag *

Loader API: Loader APIs~parseSingleZclFile(db, ctx, file) ⇒

Parses ZCL xml file.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: empty array

Param Type
db *
ctx *
file *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise that resolves when all the individual promises of each file pass.

Param Type
db *
ctx *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Either the normalized hex string (with the 0x prefix) or the original

Param Type Description
value * the string value to be normalized

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: size in bytes or 0 if the # of bytes could not be determined

Param Type Description
value * the string value to be scraped

Loader API: Loader APIs~prepareAttributes(attributes, side) ⇒

Prepare XML attributes for entry into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Array containing all data from XML ready to be inserted into the DB.

Param Type Description
attributes * an array of attributes
side * the side the attribute is on either "client" or "server"

Loader API: Loader APIs~prepareCommands(commands, side, types) ⇒

Prepare XML commands for entry into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Array containing all data from XML ready to be inserted in to the DB.

Param Type Description
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.

Loader API: Loader APIs~prepareCluster(cluster, isExtension, types) ⇒

Prepare XML cluster for insertion into the database. This method can also prepare clusterExtensions.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Object containing all data from XML.

Param Type Default Description
cluster *
isExtension * false if this is an extension or not (there are none in dotdot xml)
types * types object into which cluster can put types it might have

Loader API: Loader APIs~prepareAtomic(type) ⇒

Parses xml type into the atomic object for insertion into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: object ready for insertion into the DB

Param Type Description
type * an xml object which conforms to the atomic format in the dotdot xml

Loader API: Loader APIs~prepareSubAtomic(type, atomics) ⇒

Parses xml type into the sub-atomic object for insertion into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: object ready for insertion into the DB

Param Type Description
type * an xml object which conforms to the sub-atomic format in the dotdot xml
atomics * an array of atomic types

Loader API: Loader APIs~prepareBitmap(type, isContained) ⇒

Parses xml type into the bitmap object for insertion into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: object ready for insertion into the DB

Param Type Default Description
type * an xml object which conforms to the bitmap format in the dotdot xml
isContained * false a boolean indicating if this is coming from a contained tag or not

Loader API: Loader APIs~prepareEnum(type) ⇒

Parses xml type into the enum object for insertion into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: object ready for insertion into the DB

Param Type Description
type * an xml object which conforms to the enum format in the dotdot xml

Loader API: Loader APIs~prepareStruct(type) ⇒

Parses xml type into the struct object for insertion into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: object ready for insertion into the DB

Param Type Description
type * an xml object which conforms to the struct format in the dotdot xml

Loader API: Loader APIs~prepareSubAtomicTypes(types)

Parses array of xml objects that conform to the sub-atomic format in the dotdot xml

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type
types *

Loader API: Loader APIs~prepareTypes(zclTypes, types)

Parses xml types into the types object for insertion into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type Description
zclTypes * an array of xml types
types * an object which includes arrays for enums, bitmaps etc...

Loader API: Loader APIs~prepareAttributeType(attribute, types, cluster)

Parses xml types into the types object for insertion into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type Description
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)

Loader API: Loader APIs~prepareDeviceType(deviceType) ⇒

Preparation step for the device types.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: an object containing the prepared device types.

Param Type
deviceType *

Loader API: Loader APIs~prepareDataTypeDiscriminator(a) ⇒

Prepare Data Type Discriminator for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *

Loader API: Loader APIs~processDataTypeDiscriminator(db, packageId, zclDataTypes) ⇒

Processes Data Type Discriminator.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted Data Type Discriminators.

Param Type
db *
packageId *
zclDataTypes *

Loader API: Loader APIs~prepareDataType(a, dataType, typeMap) ⇒

Prepare Data Types for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *
typeMap *

Loader API: Loader APIs~processDataType(db, filePath, packageId, data, dataType) ⇒

Processes Data Type.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted Data Types into the Data Type table.

Param Type
db *
filePath *
packageId *
data *
dataType *

Loader API: Loader APIs~prepareNumber(a, dataType) ⇒

Prepare numbers for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processNumber(db, filePath, packageId, data) ⇒

Processes Numbers.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted numbers into the number table.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~prepareString(a, dataType) ⇒

Prepare strings for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processString(db, filePath, packageId, data) ⇒

Processes Strings.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted strings into the String table.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~prepareEnumsOrBitmaps(a, dataType) ⇒

Prepare enums or bitmaps for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processEnums(db, filePath, packageId, data) ⇒

Processes the enums.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted enums.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~processEnumItems(db, filePath, packageId, data) ⇒

Processes the enum Items.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted enum items.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~processBitmaps(db, filePath, packageId, data) ⇒

Processes the bitmaps.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted bitmaps.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~processBitmapFields(db, filePath, packageId, data) ⇒

Processes the bitmap fields.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted bitmap fields.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~prepareStruct2(a, dataType) ⇒

Prepare structs for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processStruct(db, filePath, packageId, data) ⇒

Processes the structs.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted structs.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~processStructItems(db, filePath, packageId, data) ⇒

Processes the struct Items.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted struct items.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~prepareEnumsOrBitmapsAtomic(a, dataType) ⇒

Prepare enums or bitmaps for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processEnumsFromAtomics(db, filePath, packageId, data) ⇒

Processes the enums.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted enums.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~processBitmapsFromAtomics(db, filePath, packageId, data) ⇒

Processes the bitmaps.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted bitmaps.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise that resolves when all the individual promises of each file pass.

Param Type
db *
ctx *

Loader API: Loader APIs~loadIndividualDotDotFile(db, filePath) ⇒ *

TODO This is not supported at this time.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: * - object w/ following: { packageId: pkgId } or { err: err }

Param Type
db *
filePath *

Loader API: Loader APIs~loadToplevelXmlFile(db, ctx) ⇒

Toplevel function that loads the xml library file and orchestrates the promise chain.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: a Promise that resolves with the db.

Param Type Description
db *
ctx * Context of loading.

Loader API: Loader APIs~parseNewXmlFiles(db, packageId, files, context) ⇒

Parses the new XML files. Returns an object containing loaded data: clusterIdsLoaded: array of cluster ids that were loaded

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise that resolves when all the new XML data is loaded.

Param Type
db *
packageId *
files *
context *

Loader API: Loader APIs~prepXmlFeature(f) ⇒

Prepare features from xml.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: feature information

Param Type
f *

Loader API: Loader APIs~prepXmlAttribute(a) ⇒

Prepare attributes from xml.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: attribute information

Param Type
a *

Loader API: Loader APIs~prepXmlCommand(c) ⇒

Prepare commands from xml.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: command information

Param Type
c *

Loader API: Loader APIs~prepXmlEvent(e) ⇒

Prepare events from xml

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: event information

Param Type
e *

Loader API: Loader APIs~parseSingleNewXmlFile(f) ⇒

Parse xml file.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: xml information from file

Param Type
f *

Loader API: Loader APIs~collectDataFromJsonFile(ctx) ⇒

Promises to read the JSON file and resolve all the data.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of resolved file.

Param Type Description
ctx * Context containing information about the file

Loader API: Loader APIs~collectDataFromPropertiesFile(ctx) ⇒

Promises to read the properties file, extract all the actual xml files, and resolve with the array of files.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of resolved files.

Param Type Description
ctx * Context which contains information about the propertiesFiles and data

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: bool or corresponding enum

Param Type
mask *

Loader API: Loader APIs~prepareAtomic(a)

Prepare atomic to db insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type
a *

Loader API: Loader APIs~processAtomics(db, filePath, packageId, data) ⇒

Processes atomic types for DB insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted bitmaps

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~prepareClusterGlobalAttribute(cluster) ⇒

Prepares global attribute data.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Object containing the data from XML.

Param Type
cluster *

Loader API: Loader APIs~extractAccessTag(ac) ⇒

Extract access information

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: access tag information

Param Type
ac *

Loader API: Loader APIs~extractAccessIntoArray(xmlElement) ⇒

Extract list of access information

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: array of access information

Param Type
xmlElement *

Loader API: Loader APIs~prepareCluster(cluster) ⇒

Prepare XML cluster for insertion into the database. This method can also prepare clusterExtensions.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Object containing all data from XML.

Param Type
cluster *

Loader API: Loader APIs~processClusters(db, filePath, packageId, data) ⇒

Process clusters for insertion into the database.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of cluster insertion.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~processClusterGlobalAttributes(db, filePath, packageId, data) ⇒

Processes global attributes for insertion into the database.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted data.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: promise to resolve the clusterExtension tags

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: promise to resolve the globals

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~prepareTag(tag) ⇒

Prepare tag object from tag

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: tag information

Param Type
tag *

Loader API: Loader APIs~processDefaultAccess(db, filePath, packageId, defaultAccessList)

Process defaultAccess tag in the XML.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type
db *
filePath *
packageId *
defaultAccessList *

Loader API: Loader APIs~processAccessControl(db, filePath, packageId, accessControlList)

Process accessControl tag in the XML.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type
db *
filePath *
packageId *
accessControlList *

Loader API: Loader APIs~processTags(db, filePath, packageId, tags)

Processes the tags in the XML.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type
db *
filePath *
packageId *
tags *

Loader API: Loader APIs~prepareDomain(domain) ⇒

Convert domain from XMl to domain for DB.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Domain object for DB.

Param Type
domain *

Loader API: Loader APIs~processDomains(db, filePath, packageId, data) ⇒

Process domains for insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of database insertion of domains.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~prepareDataTypeDiscriminator(a) ⇒

Prepare Data Type Discriminator for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *

Loader API: Loader APIs~processDataTypeDiscriminator(db, filePath, zclDataTypes) ⇒

Processes Data Type Discriminator.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted Data Type Discriminators.

Param Type
db *
filePath *
zclDataTypes *

Loader API: Loader APIs~prepareDataType(a, dataType, typeMap) ⇒

Prepare Data Types for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *
typeMap *

Loader API: Loader APIs~processDataType(db, filePath, packageId, knownPackages, data, dataType) ⇒

Processes Data Type.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted Data Types into the Data Type table.

Param Type
db *
filePath *
packageId *
knownPackages *
data *
dataType *

Loader API: Loader APIs~prepareNumber(a, dataType) ⇒

Prepare numbers for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processNumber(db, filePath, packageId, knownPackages, data) ⇒

Processes Numbers.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted numbers into the number table.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~prepareString(a, dataType) ⇒

Prepare strings for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processString(db, filePath, packageId, knownPackages, data) ⇒

Processes Strings.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted strings into the String table.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~prepareEnumOrBitmapAtomic(a, dataType) ⇒

Prepare enums or bitmaps for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processEnumAtomic(db, filePath, packageId, knownPackages, data) ⇒

Processes the enums.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted enums.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~prepareEnumOrBitmap(a, dataType) ⇒

Prepare enums or bitmaps for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processEnum(db, filePath, packageId, knownPackages, data) ⇒

Processes the enums.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted enums.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~processEnumItems(db, filePath, packageId, knownPackages, data) ⇒

Processes the enum Items.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted enum items.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~processBitmapAtomic(db, filePath, packageId, knownPackages, data) ⇒

Processes the bitmaps.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted bitmaps.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~processBitmap(db, filePath, packageId, knownPackages, data) ⇒

Processes the bitmaps.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted bitmaps.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~processBitmapFields(db, filePath, packageId, knownPackages, data) ⇒

Processes the bitmap fields.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted bitmap fields.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~prepareStruct(a, dataType) ⇒

Prepare structs for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processStruct(db, filePath, packageId, knownPackages, data) ⇒

Processes the structs.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted structs.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~processStructItems(db, filePath, packageIds, data) ⇒

Processes the struct Items.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted struct items.

Param Type
db *
filePath *
packageIds *
data *

Loader API: Loader APIs~prepareDeviceType(deviceType) ⇒ Object

Prepares a device type object by extracting and transforming its properties.

This function takes a device type object and processes its properties to create a new object with a specific structure. It handles various properties such as device ID, profile ID, domain, name, description, class, scope, and superset. Additionally, it processes endpoint compositions and clusters if they exist.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Object - The prepared device type object with transformed properties.

Param Type Description
deviceType Object The device type object to be prepared.

Loader API: Loader APIs~processDeviceTypes(db, filePath, packageId, data, context) ⇒ Promise

Processes and inserts device types into the database. This function logs the number of device types being processed for debugging purposes. It maps over the provided data to prepare each device type and then iterates over each prepared device type. If a device type has a compositionType, it inserts the endpoint composition into the database, retrieves the endpoint composition ID, and then inserts the device composition. Finally, it inserts all prepared device types into the database.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise - A promise that resolves after all device types have been inserted into the database.

Param Type Description
db * The database connection object.
filePath string The file path from which the device types are being processed.
packageId * The package ID associated with the device types.
data Array The array of device types to be processed.
context * Additional context that might be required for processing.

Loader API: Loader APIs~processReloadDeviceTypes() ⇒ Promise

Processes and reloads device type entities in the database. This function is called when a custom xml with device types is reloaded.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise - A promise that resolves after all device types have been reloaded.

Loader API: Loader APIs~processDataTypes(db, filePath, packageId, knownPackages, toplevel) ⇒

Process promises for loading the data types

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of data types

Param Type
db *
filePath *
packageId *
knownPackages *
toplevel *

Loader API: Loader APIs~processAtomicTypes(db, filePath, packageId, knownPackages, toplevel) ⇒

Processes promises for loading individual tables per data type for atomics/baseline types.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of atomic/baseline processing.

Param Type
db *
filePath *
packageId *
knownPackages *
toplevel *

Loader API: Loader APIs~processNonAtomicTypes(db, filePath, packageId, knownPackages, toplevel, featureClusters) ⇒

Processes promises for loading individual tables per data type for no-atomic and inherited types.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of non-atomic/inherited data type processing.

Param Type
db *
filePath *
packageId *
knownPackages *
toplevel *
featureClusters *

Loader API: Loader APIs~processSubItems(db, filePath, packageId, knownPackages, toplevel, featureClusters, context, collectedStructItems) ⇒

Processes promises for loading items within a bitmap, struct, and enum data types.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of processing sub items within a bitmap, enum and structs.

Param Type
db *
filePath *
packageId *
knownPackages *
toplevel *
featureClusters *
context *
collectedStructItems *

Loader API: Loader APIs~processParsedZclData(db, argument, previouslyKnownPackages, context, collectedStructItems) ⇒

After XML parser is done with the barebones parsing, this function branches the individual toplevel tags.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: promise that resolves when all the subtags are parsed.

Param Type
db *
argument *
previouslyKnownPackages *
context *
collectedStructItems *

Loader API: Loader APIs~parseSingleZclFile(db, packageId, file, context, collectedStructItems) ⇒

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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise for when the last stage of the loading pipeline finishes.

Param Type
db *
packageId *
file *
context *
collectedStructItems *

Loader API: Loader APIs~isCrcMismatchOrPackageDoesNotExist(db, packageId, files) ⇒

Checks if there is a crc mismatch on any xml file. This can be used to decide if there is a need to reload all the xml files. Also check if the package is not loaded before.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: the status of crc mismatch and whether a package is present in an object

Param Type
db *
packageId *
files *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise that resolves when all the individual promises of each file pass.

Param Type
db *
packageId *
zclFiles *
context *

Loader API: Loader APIs~parseManufacturerData(db, ctx) ⇒

Parses the manufacturers xml.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of a parsed manufacturers file.

Param Type
db *
ctx *

Loader API: Loader APIs~parseProfilesData(db, ctx) ⇒

Parses the profiles xml.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of a parsed profiles file.

Param Type
db *
ctx *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: array of feature flags

Param Type
db *
packageId *
featureFlags *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise that loads the uiOptions object into the database.

Param Type
db *
packageId *
featureFlags *

Loader API: Loader APIs~parseOptions(db) ⇒

Parses and loads the text and boolean options.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: promise of parsed options

Param Type
db *

Loader API: Loader APIs~parseTextOptions(db, pkgRef, textOptions) ⇒

Parses the text options.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of a parsed text options.

Param Type
db *
pkgRef *
textOptions *

Loader API: Loader APIs~parseBoolOptions(db, pkgRef, booleanCategories) ⇒

Parses the boolean options.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of a parsed boolean options.

Param Type
db *
pkgRef *
booleanCategories *

Loader API: Loader APIs~parseattributeAccessInterfaceAttributes(db, pkgRef, attributeAccessInterfaceAttributes) ⇒ Promise.<void>

Asynchronously parses and inserts attribute access interface attributes into the database. This function iterates over the attributeAccessInterfaceAttributes object, processing each cluster by mapping its values to a specific structure and then inserting them into the database using the insertOptionsKeyValues function.

The main purpose of this function is to store cluster/attribute pairs including global attributes and their cluster pair The ATTRIBUTE table has cluster_ref as null for global attributes so this second method was necessary

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise.<void> - A promise that resolves when all attributes have been processed and inserted.

Param Type Description
db * The database connection object.
pkgRef * The package reference id for which the attributes are being parsed.
attributeAccessInterfaceAttributes * An object containing the attribute access interface attributes, structured by cluster.

Loader API: Loader APIs~parseDefaults(db, ctx) ⇒

Parses the default values inside the options.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promised of parsed text and bool defaults.

Param Type
db *
ctx *

Loader API: Loader APIs~parseTextDefaults(db, pkgRef, textDefaults) ⇒

Parse text defaults from default options.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Array of promises

Param Type
db *
pkgRef *
textDefaults *

Loader API: Loader APIs~parseBoolDefaults(db, pkgRef, booleanCategories) ⇒

Parse the boolean defaults inside options.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: List of promises

Param Type
db *
pkgRef *
booleanCategories *

Loader API: Loader APIs~loadIndividualSilabsFile(db, filePath) ⇒

Parses a single file. This function is used specifically for adding a package through an existing ZAP session because of its reliance on relating the new XML content to the packages associated with that session. e.g. for ClusterExtensions.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of a loaded file.

Param Type
db *
filePath *

Loader API: Loader APIs~processCustomZclDeviceType(db, ctx) ⇒

If custom device is supported, then this method creates it.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: context

Param Type
db *
ctx *

Loader API: Loader APIs~loadZclJson(db, metafile) ⇒

Load ZCL metadata

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of loaded zcl json file

Param Type
db *
metafile *

Loader API: Loader APIs~loadZclProperties(db, metafile) ⇒

Load ZCL metadata

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of loaded zcl properties file

Param Type
db *
metafile *

Loader API: Loader APIs~loadZclJsonOrProperties(db, ctx) ⇒

Toplevel function that loads the toplevel metafile and orchestrates the promise chain.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: a Promise that resolves with the db.

Param Type Description
db *
ctx * The context of loading.

Loader API: Loader APIs~recordToplevelPackage(db, metadataFile, crc, isTopLevelPackageInSync) ⇒

Records the toplevel package information and resolves into packageId

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: packageId

Param Type
db *
metadataFile *
crc *
isTopLevelPackageInSync *

Loader API: Loader APIs~recordVersion(db, ctx)

Records the version into the database.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type
db *
ctx *

Loader API: Loader APIs~loadZclMetaFilesCommon(db, metadataFile, options) ⇒

Retrieve zcl package information

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: package zcl package information

Param Type
db *
metadataFile *
options *

Loader API: Loader APIs~loadAttributeMappingForMultiProtocol(db, multiProtcolInfo, categoryToPackageIdMap)

Load attribute mapping table if there is multi-protocol information from a json file.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type
db *
multiProtcolInfo *
categoryToPackageIdMap *

Loader API: Loader APIs~loadZclMetafiles(db, metadataFile) ⇒

Toplevel function that loads the zcl file and passes it off to the correct zcl loader.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Array of loaded packageIds.

Param Type Description
db *
metadataFile * array of paths

Loader API: Loader APIs~loadZcl(db, metadataFile) ⇒

Loads individual zcl.json metafile.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Context object that contains .db and .packageId

Param Type
db *
metadataFile *

Loader API: Loader APIs~loadIndividualFile(db, filePath, sessionId)

Load individual custom XML files.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type Description
db *
filePath *
sessionId * Current session within which we're loading this file.

Loader API: Loader APIs~qualifyZclFile(db, info, parentPackageId, isCustom) ⇒

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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise that resolves int he object of data.

Param Type
db *
info *
parentPackageId *
isCustom *

Loader API: Loader APIs~processZclPostLoading(db, packageId) ⇒

Promises to perform a post loading step.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise to deal with the post-loading cleanup.

Param Type
db *
packageId *

Loader API: Loader APIs~getDiscriminatorMap(db, packageIds) ⇒

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: data type discriminator map

Param Type
db *
packageIds *

Loader API: Loader APIs

This module provides the APIs for ZCL/Data-Model loading.

  • [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
    • [~collectDataFromLibraryXml(ctx)](#module_Loader API_ Loader APIs..collectDataFromLibraryXml) ⇒
    • [~tagContainsEnum(tag)](#module_Loader API_ Loader APIs..tagContainsEnum) ⇒
    • [~tagContainsStruct(tag)](#module_Loader API_ Loader APIs..tagContainsStruct) ⇒
    • [~tagContainsBitmap(tag)](#module_Loader API_ Loader APIs..tagContainsBitmap) ⇒
    • [~parseSingleZclFile(db, ctx, file)](#module_Loader API_ Loader APIs..parseSingleZclFile) ⇒
    • [~parseZclFiles(db, ctx)](#module_Loader API_ Loader APIs..parseZclFiles) ⇒
    • [~normalizeHexValue(value)](#module_Loader API_ Loader APIs..normalizeHexValue) ⇒
    • [~getNumBytesFromShortName(value)](#module_Loader API_ Loader APIs..getNumBytesFromShortName) ⇒
    • [~prepareAttributes(attributes, side)](#module_Loader API_ Loader APIs..prepareAttributes) ⇒
    • [~prepareCommands(commands, side, types)](#module_Loader API_ Loader APIs..prepareCommands) ⇒
    • [~prepareCluster(cluster, isExtension, types)](#module_Loader API_ Loader APIs..prepareCluster) ⇒
    • [~prepareAtomic(type)](#module_Loader API_ Loader APIs..prepareAtomic) ⇒
    • [~prepareSubAtomic(type, atomics)](#module_Loader API_ Loader APIs..prepareSubAtomic) ⇒
    • [~prepareBitmap(type, isContained)](#module_Loader API_ Loader APIs..prepareBitmap) ⇒
    • [~prepareEnum(type)](#module_Loader API_ Loader APIs..prepareEnum) ⇒
    • [~prepareStruct(type)](#module_Loader API_ Loader APIs..prepareStruct) ⇒
    • [~prepareSubAtomicTypes(types)](#module_Loader API_ Loader APIs..prepareSubAtomicTypes)
    • [~prepareTypes(zclTypes, types)](#module_Loader API_ Loader APIs..prepareTypes)
    • [~prepareAttributeType(attribute, types, cluster)](#module_Loader API_ Loader APIs..prepareAttributeType)
    • [~prepareDeviceType(deviceType)](#module_Loader API_ Loader APIs..prepareDeviceType) ⇒
    • [~prepareDataTypeDiscriminator(a)](#module_Loader API_ Loader APIs..prepareDataTypeDiscriminator) ⇒
    • [~processDataTypeDiscriminator(db, packageId, zclDataTypes)](#module_Loader API_ Loader APIs..processDataTypeDiscriminator) ⇒
    • [~prepareDataType(a, dataType, typeMap)](#module_Loader API_ Loader APIs..prepareDataType) ⇒
    • [~processDataType(db, filePath, packageId, data, dataType)](#module_Loader API_ Loader APIs..processDataType) ⇒
    • [~prepareNumber(a, dataType)](#module_Loader API_ Loader APIs..prepareNumber) ⇒
    • [~processNumber(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processNumber) ⇒
    • [~prepareString(a, dataType)](#module_Loader API_ Loader APIs..prepareString) ⇒
    • [~processString(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processString) ⇒
    • [~prepareEnumsOrBitmaps(a, dataType)](#module_Loader API_ Loader APIs..prepareEnumsOrBitmaps) ⇒
    • [~processEnums(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processEnums) ⇒
    • [~processEnumItems(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processEnumItems) ⇒
    • [~processBitmaps(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processBitmaps) ⇒
    • [~processBitmapFields(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processBitmapFields) ⇒
    • [~prepareStruct2(a, dataType)](#module_Loader API_ Loader APIs..prepareStruct2) ⇒
    • [~processStruct(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processStruct) ⇒
    • [~processStructItems(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processStructItems) ⇒
    • [~prepareEnumsOrBitmapsAtomic(a, dataType)](#module_Loader API_ Loader APIs..prepareEnumsOrBitmapsAtomic) ⇒
    • [~processEnumsFromAtomics(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processEnumsFromAtomics) ⇒
    • [~processBitmapsFromAtomics(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processBitmapsFromAtomics) ⇒
    • [~loadZclData(db, ctx)](#module_Loader API_ Loader APIs..loadZclData) ⇒
    • [~loadIndividualDotDotFile(db, filePath)](#module_Loader API_ Loader APIs..loadIndividualDotDotFile) ⇒ *
    • [~loadToplevelXmlFile(db, ctx)](#module_Loader API_ Loader APIs..loadToplevelXmlFile) ⇒
    • [~parseNewXmlFiles(db, packageId, files, context)](#module_Loader API_ Loader APIs..parseNewXmlFiles) ⇒
    • [~prepXmlFeature(f)](#module_Loader API_ Loader APIs..prepXmlFeature) ⇒
    • [~prepXmlAttribute(a)](#module_Loader API_ Loader APIs..prepXmlAttribute) ⇒
    • [~prepXmlCommand(c)](#module_Loader API_ Loader APIs..prepXmlCommand) ⇒
    • [~prepXmlEvent(e)](#module_Loader API_ Loader APIs..prepXmlEvent) ⇒
    • [~parseSingleNewXmlFile(f)](#module_Loader API_ Loader APIs..parseSingleNewXmlFile) ⇒
    • [~collectDataFromJsonFile(ctx)](#module_Loader API_ Loader APIs..collectDataFromJsonFile) ⇒
    • [~collectDataFromPropertiesFile(ctx)](#module_Loader API_ Loader APIs..collectDataFromPropertiesFile) ⇒
    • [~maskToType(mask)](#module_Loader API_ Loader APIs..maskToType) ⇒
    • [~prepareAtomic(a)](#module_Loader API_ Loader APIs..prepareAtomic)
    • [~processAtomics(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processAtomics) ⇒
    • [~prepareClusterGlobalAttribute(cluster)](#module_Loader API_ Loader APIs..prepareClusterGlobalAttribute) ⇒
    • [~extractAccessTag(ac)](#module_Loader API_ Loader APIs..extractAccessTag) ⇒
    • [~extractAccessIntoArray(xmlElement)](#module_Loader API_ Loader APIs..extractAccessIntoArray) ⇒
    • [~prepareCluster(cluster)](#module_Loader API_ Loader APIs..prepareCluster) ⇒
    • [~processClusters(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processClusters) ⇒
    • [~processClusterGlobalAttributes(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processClusterGlobalAttributes) ⇒
    • [~processClusterExtensions(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processClusterExtensions) ⇒
    • [~processGlobals(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processGlobals) ⇒
    • [~prepareTag(tag)](#module_Loader API_ Loader APIs..prepareTag) ⇒
    • [~processDefaultAccess(db, filePath, packageId, defaultAccessList)](#module_Loader API_ Loader APIs..processDefaultAccess)
    • [~processAccessControl(db, filePath, packageId, accessControlList)](#module_Loader API_ Loader APIs..processAccessControl)
    • [~processTags(db, filePath, packageId, tags)](#module_Loader API_ Loader APIs..processTags)
    • [~prepareDomain(domain)](#module_Loader API_ Loader APIs..prepareDomain) ⇒
    • [~processDomains(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processDomains) ⇒
    • [~prepareDataTypeDiscriminator(a)](#module_Loader API_ Loader APIs..prepareDataTypeDiscriminator) ⇒
    • [~processDataTypeDiscriminator(db, filePath, zclDataTypes)](#module_Loader API_ Loader APIs..processDataTypeDiscriminator) ⇒
    • [~prepareDataType(a, dataType, typeMap)](#module_Loader API_ Loader APIs..prepareDataType) ⇒
    • [~processDataType(db, filePath, packageId, knownPackages, data, dataType)](#module_Loader API_ Loader APIs..processDataType) ⇒
    • [~prepareNumber(a, dataType)](#module_Loader API_ Loader APIs..prepareNumber) ⇒
    • [~processNumber(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processNumber) ⇒
    • [~prepareString(a, dataType)](#module_Loader API_ Loader APIs..prepareString) ⇒
    • [~processString(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processString) ⇒
    • [~prepareEnumOrBitmapAtomic(a, dataType)](#module_Loader API_ Loader APIs..prepareEnumOrBitmapAtomic) ⇒
    • [~processEnumAtomic(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processEnumAtomic) ⇒
    • [~prepareEnumOrBitmap(a, dataType)](#module_Loader API_ Loader APIs..prepareEnumOrBitmap) ⇒
    • [~processEnum(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processEnum) ⇒
    • [~processEnumItems(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processEnumItems) ⇒
    • [~processBitmapAtomic(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processBitmapAtomic) ⇒
    • [~processBitmap(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processBitmap) ⇒
    • [~processBitmapFields(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processBitmapFields) ⇒
    • [~prepareStruct(a, dataType)](#module_Loader API_ Loader APIs..prepareStruct) ⇒
    • [~processStruct(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processStruct) ⇒
    • [~processStructItems(db, filePath, packageIds, data)](#module_Loader API_ Loader APIs..processStructItems) ⇒
    • [~prepareDeviceType(deviceType)](#module_Loader API_ Loader APIs..prepareDeviceType) ⇒ Object
    • [~processDeviceTypes(db, filePath, packageId, data, context)](#module_Loader API_ Loader APIs..processDeviceTypes) ⇒ Promise
    • [~processReloadDeviceTypes()](#module_Loader API_ Loader APIs..processReloadDeviceTypes) ⇒ Promise
    • [~processDataTypes(db, filePath, packageId, knownPackages, toplevel)](#module_Loader API_ Loader APIs..processDataTypes) ⇒
    • [~processAtomicTypes(db, filePath, packageId, knownPackages, toplevel)](#module_Loader API_ Loader APIs..processAtomicTypes) ⇒
    • [~processNonAtomicTypes(db, filePath, packageId, knownPackages, toplevel, featureClusters)](#module_Loader API_ Loader APIs..processNonAtomicTypes) ⇒
    • [~processSubItems(db, filePath, packageId, knownPackages, toplevel, featureClusters, context, collectedStructItems)](#module_Loader API_ Loader APIs..processSubItems) ⇒
    • [~processParsedZclData(db, argument, previouslyKnownPackages, context, collectedStructItems)](#module_Loader API_ Loader APIs..processParsedZclData) ⇒
    • [~parseSingleZclFile(db, packageId, file, context, collectedStructItems)](#module_Loader API_ Loader APIs..parseSingleZclFile) ⇒
    • [~isCrcMismatchOrPackageDoesNotExist(db, packageId, files)](#module_Loader API_ Loader APIs..isCrcMismatchOrPackageDoesNotExist) ⇒
    • [~parseZclFiles(db, packageId, zclFiles, context)](#module_Loader API_ Loader APIs..parseZclFiles) ⇒
    • [~parseManufacturerData(db, ctx)](#module_Loader API_ Loader APIs..parseManufacturerData) ⇒
    • [~parseProfilesData(db, ctx)](#module_Loader API_ Loader APIs..parseProfilesData) ⇒
    • [~parseFeatureFlags(db, packageId, featureFlags)](#module_Loader API_ Loader APIs..parseFeatureFlags) ⇒
    • [~parseUiOptions(db, packageId, featureFlags)](#module_Loader API_ Loader APIs..parseUiOptions) ⇒
    • [~parseOptions(db)](#module_Loader API_ Loader APIs..parseOptions) ⇒
    • [~parseTextOptions(db, pkgRef, textOptions)](#module_Loader API_ Loader APIs..parseTextOptions) ⇒
    • [~parseBoolOptions(db, pkgRef, booleanCategories)](#module_Loader API_ Loader APIs..parseBoolOptions) ⇒
    • [~parseattributeAccessInterfaceAttributes(db, pkgRef, attributeAccessInterfaceAttributes)](#module_Loader API_ Loader APIs..parseattributeAccessInterfaceAttributes) ⇒ Promise.<void>
    • [~parseDefaults(db, ctx)](#module_Loader API_ Loader APIs..parseDefaults) ⇒
    • [~parseTextDefaults(db, pkgRef, textDefaults)](#module_Loader API_ Loader APIs..parseTextDefaults) ⇒
    • [~parseBoolDefaults(db, pkgRef, booleanCategories)](#module_Loader API_ Loader APIs..parseBoolDefaults) ⇒
    • [~loadIndividualSilabsFile(db, filePath)](#module_Loader API_ Loader APIs..loadIndividualSilabsFile) ⇒
    • [~processCustomZclDeviceType(db, ctx)](#module_Loader API_ Loader APIs..processCustomZclDeviceType) ⇒
    • [~loadZclJson(db, metafile)](#module_Loader API_ Loader APIs..loadZclJson) ⇒
    • [~loadZclProperties(db, metafile)](#module_Loader API_ Loader APIs..loadZclProperties) ⇒
    • [~loadZclJsonOrProperties(db, ctx)](#module_Loader API_ Loader APIs..loadZclJsonOrProperties) ⇒
    • [~recordToplevelPackage(db, metadataFile, crc, isTopLevelPackageInSync)](#module_Loader API_ Loader APIs..recordToplevelPackage) ⇒
    • [~recordVersion(db, ctx)](#module_Loader API_ Loader APIs..recordVersion)
    • [~loadZclMetaFilesCommon(db, metadataFile, options)](#module_Loader API_ Loader APIs..loadZclMetaFilesCommon) ⇒
    • [~loadAttributeMappingForMultiProtocol(db, multiProtcolInfo, categoryToPackageIdMap)](#module_Loader API_ Loader APIs..loadAttributeMappingForMultiProtocol)
    • [~loadZclMetafiles(db, metadataFile)](#module_Loader API_ Loader APIs..loadZclMetafiles) ⇒
    • [~loadZcl(db, metadataFile)](#module_Loader API_ Loader APIs..loadZcl) ⇒
    • [~loadIndividualFile(db, filePath, sessionId)](#module_Loader API_ Loader APIs..loadIndividualFile)
    • [~qualifyZclFile(db, info, parentPackageId, isCustom)](#module_Loader API_ Loader APIs..qualifyZclFile) ⇒
    • [~processZclPostLoading(db, packageId)](#module_Loader API_ Loader APIs..processZclPostLoading) ⇒
    • [~getDiscriminatorMap(db, packageIds)](#module_Loader API_ Loader APIs..getDiscriminatorMap) ⇒

Loader API: Loader APIs~collectDataFromLibraryXml(ctx) ⇒

Promises to read the properties file, extract all the actual xml files, and resolve with the array of files.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of resolved files.

Param Type Description
ctx * Context which contains information about the metadataFiles and data

Loader API: Loader APIs~tagContainsEnum(tag) ⇒

Check if tag contains enum.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: boolean

Param Type
tag *

Loader API: Loader APIs~tagContainsStruct(tag) ⇒

Check if tag contains struct.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: boolean

Param Type
tag *

Loader API: Loader APIs~tagContainsBitmap(tag) ⇒

Check if tag contains Bitmap.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: boolean

Param Type
tag *

Loader API: Loader APIs~parseSingleZclFile(db, ctx, file) ⇒

Parses ZCL xml file.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: empty array

Param Type
db *
ctx *
file *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise that resolves when all the individual promises of each file pass.

Param Type
db *
ctx *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Either the normalized hex string (with the 0x prefix) or the original

Param Type Description
value * the string value to be normalized

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: size in bytes or 0 if the # of bytes could not be determined

Param Type Description
value * the string value to be scraped

Loader API: Loader APIs~prepareAttributes(attributes, side) ⇒

Prepare XML attributes for entry into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Array containing all data from XML ready to be inserted into the DB.

Param Type Description
attributes * an array of attributes
side * the side the attribute is on either "client" or "server"

Loader API: Loader APIs~prepareCommands(commands, side, types) ⇒

Prepare XML commands for entry into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Array containing all data from XML ready to be inserted in to the DB.

Param Type Description
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.

Loader API: Loader APIs~prepareCluster(cluster, isExtension, types) ⇒

Prepare XML cluster for insertion into the database. This method can also prepare clusterExtensions.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Object containing all data from XML.

Param Type Default Description
cluster *
isExtension * false if this is an extension or not (there are none in dotdot xml)
types * types object into which cluster can put types it might have

Loader API: Loader APIs~prepareAtomic(type) ⇒

Parses xml type into the atomic object for insertion into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: object ready for insertion into the DB

Param Type Description
type * an xml object which conforms to the atomic format in the dotdot xml

Loader API: Loader APIs~prepareSubAtomic(type, atomics) ⇒

Parses xml type into the sub-atomic object for insertion into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: object ready for insertion into the DB

Param Type Description
type * an xml object which conforms to the sub-atomic format in the dotdot xml
atomics * an array of atomic types

Loader API: Loader APIs~prepareBitmap(type, isContained) ⇒

Parses xml type into the bitmap object for insertion into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: object ready for insertion into the DB

Param Type Default Description
type * an xml object which conforms to the bitmap format in the dotdot xml
isContained * false a boolean indicating if this is coming from a contained tag or not

Loader API: Loader APIs~prepareEnum(type) ⇒

Parses xml type into the enum object for insertion into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: object ready for insertion into the DB

Param Type Description
type * an xml object which conforms to the enum format in the dotdot xml

Loader API: Loader APIs~prepareStruct(type) ⇒

Parses xml type into the struct object for insertion into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: object ready for insertion into the DB

Param Type Description
type * an xml object which conforms to the struct format in the dotdot xml

Loader API: Loader APIs~prepareSubAtomicTypes(types)

Parses array of xml objects that conform to the sub-atomic format in the dotdot xml

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type
types *

Loader API: Loader APIs~prepareTypes(zclTypes, types)

Parses xml types into the types object for insertion into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type Description
zclTypes * an array of xml types
types * an object which includes arrays for enums, bitmaps etc...

Loader API: Loader APIs~prepareAttributeType(attribute, types, cluster)

Parses xml types into the types object for insertion into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type Description
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)

Loader API: Loader APIs~prepareDeviceType(deviceType) ⇒

Preparation step for the device types.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: an object containing the prepared device types.

Param Type
deviceType *

Loader API: Loader APIs~prepareDataTypeDiscriminator(a) ⇒

Prepare Data Type Discriminator for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *

Loader API: Loader APIs~processDataTypeDiscriminator(db, packageId, zclDataTypes) ⇒

Processes Data Type Discriminator.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted Data Type Discriminators.

Param Type
db *
packageId *
zclDataTypes *

Loader API: Loader APIs~prepareDataType(a, dataType, typeMap) ⇒

Prepare Data Types for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *
typeMap *

Loader API: Loader APIs~processDataType(db, filePath, packageId, data, dataType) ⇒

Processes Data Type.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted Data Types into the Data Type table.

Param Type
db *
filePath *
packageId *
data *
dataType *

Loader API: Loader APIs~prepareNumber(a, dataType) ⇒

Prepare numbers for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processNumber(db, filePath, packageId, data) ⇒

Processes Numbers.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted numbers into the number table.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~prepareString(a, dataType) ⇒

Prepare strings for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processString(db, filePath, packageId, data) ⇒

Processes Strings.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted strings into the String table.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~prepareEnumsOrBitmaps(a, dataType) ⇒

Prepare enums or bitmaps for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processEnums(db, filePath, packageId, data) ⇒

Processes the enums.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted enums.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~processEnumItems(db, filePath, packageId, data) ⇒

Processes the enum Items.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted enum items.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~processBitmaps(db, filePath, packageId, data) ⇒

Processes the bitmaps.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted bitmaps.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~processBitmapFields(db, filePath, packageId, data) ⇒

Processes the bitmap fields.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted bitmap fields.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~prepareStruct2(a, dataType) ⇒

Prepare structs for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processStruct(db, filePath, packageId, data) ⇒

Processes the structs.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted structs.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~processStructItems(db, filePath, packageId, data) ⇒

Processes the struct Items.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted struct items.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~prepareEnumsOrBitmapsAtomic(a, dataType) ⇒

Prepare enums or bitmaps for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processEnumsFromAtomics(db, filePath, packageId, data) ⇒

Processes the enums.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted enums.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~processBitmapsFromAtomics(db, filePath, packageId, data) ⇒

Processes the bitmaps.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted bitmaps.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise that resolves when all the individual promises of each file pass.

Param Type
db *
ctx *

Loader API: Loader APIs~loadIndividualDotDotFile(db, filePath) ⇒ *

TODO This is not supported at this time.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: * - object w/ following: { packageId: pkgId } or { err: err }

Param Type
db *
filePath *

Loader API: Loader APIs~loadToplevelXmlFile(db, ctx) ⇒

Toplevel function that loads the xml library file and orchestrates the promise chain.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: a Promise that resolves with the db.

Param Type Description
db *
ctx * Context of loading.

Loader API: Loader APIs~parseNewXmlFiles(db, packageId, files, context) ⇒

Parses the new XML files. Returns an object containing loaded data: clusterIdsLoaded: array of cluster ids that were loaded

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise that resolves when all the new XML data is loaded.

Param Type
db *
packageId *
files *
context *

Loader API: Loader APIs~prepXmlFeature(f) ⇒

Prepare features from xml.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: feature information

Param Type
f *

Loader API: Loader APIs~prepXmlAttribute(a) ⇒

Prepare attributes from xml.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: attribute information

Param Type
a *

Loader API: Loader APIs~prepXmlCommand(c) ⇒

Prepare commands from xml.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: command information

Param Type
c *

Loader API: Loader APIs~prepXmlEvent(e) ⇒

Prepare events from xml

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: event information

Param Type
e *

Loader API: Loader APIs~parseSingleNewXmlFile(f) ⇒

Parse xml file.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: xml information from file

Param Type
f *

Loader API: Loader APIs~collectDataFromJsonFile(ctx) ⇒

Promises to read the JSON file and resolve all the data.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of resolved file.

Param Type Description
ctx * Context containing information about the file

Loader API: Loader APIs~collectDataFromPropertiesFile(ctx) ⇒

Promises to read the properties file, extract all the actual xml files, and resolve with the array of files.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of resolved files.

Param Type Description
ctx * Context which contains information about the propertiesFiles and data

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: bool or corresponding enum

Param Type
mask *

Loader API: Loader APIs~prepareAtomic(a)

Prepare atomic to db insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type
a *

Loader API: Loader APIs~processAtomics(db, filePath, packageId, data) ⇒

Processes atomic types for DB insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted bitmaps

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~prepareClusterGlobalAttribute(cluster) ⇒

Prepares global attribute data.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Object containing the data from XML.

Param Type
cluster *

Loader API: Loader APIs~extractAccessTag(ac) ⇒

Extract access information

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: access tag information

Param Type
ac *

Loader API: Loader APIs~extractAccessIntoArray(xmlElement) ⇒

Extract list of access information

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: array of access information

Param Type
xmlElement *

Loader API: Loader APIs~prepareCluster(cluster) ⇒

Prepare XML cluster for insertion into the database. This method can also prepare clusterExtensions.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Object containing all data from XML.

Param Type
cluster *

Loader API: Loader APIs~processClusters(db, filePath, packageId, data) ⇒

Process clusters for insertion into the database.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of cluster insertion.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~processClusterGlobalAttributes(db, filePath, packageId, data) ⇒

Processes global attributes for insertion into the database.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted data.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: promise to resolve the clusterExtension tags

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: promise to resolve the globals

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~prepareTag(tag) ⇒

Prepare tag object from tag

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: tag information

Param Type
tag *

Loader API: Loader APIs~processDefaultAccess(db, filePath, packageId, defaultAccessList)

Process defaultAccess tag in the XML.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type
db *
filePath *
packageId *
defaultAccessList *

Loader API: Loader APIs~processAccessControl(db, filePath, packageId, accessControlList)

Process accessControl tag in the XML.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type
db *
filePath *
packageId *
accessControlList *

Loader API: Loader APIs~processTags(db, filePath, packageId, tags)

Processes the tags in the XML.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type
db *
filePath *
packageId *
tags *

Loader API: Loader APIs~prepareDomain(domain) ⇒

Convert domain from XMl to domain for DB.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Domain object for DB.

Param Type
domain *

Loader API: Loader APIs~processDomains(db, filePath, packageId, data) ⇒

Process domains for insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of database insertion of domains.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~prepareDataTypeDiscriminator(a) ⇒

Prepare Data Type Discriminator for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *

Loader API: Loader APIs~processDataTypeDiscriminator(db, filePath, zclDataTypes) ⇒

Processes Data Type Discriminator.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted Data Type Discriminators.

Param Type
db *
filePath *
zclDataTypes *

Loader API: Loader APIs~prepareDataType(a, dataType, typeMap) ⇒

Prepare Data Types for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *
typeMap *

Loader API: Loader APIs~processDataType(db, filePath, packageId, knownPackages, data, dataType) ⇒

Processes Data Type.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted Data Types into the Data Type table.

Param Type
db *
filePath *
packageId *
knownPackages *
data *
dataType *

Loader API: Loader APIs~prepareNumber(a, dataType) ⇒

Prepare numbers for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processNumber(db, filePath, packageId, knownPackages, data) ⇒

Processes Numbers.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted numbers into the number table.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~prepareString(a, dataType) ⇒

Prepare strings for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processString(db, filePath, packageId, knownPackages, data) ⇒

Processes Strings.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted strings into the String table.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~prepareEnumOrBitmapAtomic(a, dataType) ⇒

Prepare enums or bitmaps for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processEnumAtomic(db, filePath, packageId, knownPackages, data) ⇒

Processes the enums.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted enums.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~prepareEnumOrBitmap(a, dataType) ⇒

Prepare enums or bitmaps for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processEnum(db, filePath, packageId, knownPackages, data) ⇒

Processes the enums.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted enums.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~processEnumItems(db, filePath, packageId, knownPackages, data) ⇒

Processes the enum Items.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted enum items.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~processBitmapAtomic(db, filePath, packageId, knownPackages, data) ⇒

Processes the bitmaps.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted bitmaps.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~processBitmap(db, filePath, packageId, knownPackages, data) ⇒

Processes the bitmaps.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted bitmaps.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~processBitmapFields(db, filePath, packageId, knownPackages, data) ⇒

Processes the bitmap fields.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted bitmap fields.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~prepareStruct(a, dataType) ⇒

Prepare structs for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processStruct(db, filePath, packageId, knownPackages, data) ⇒

Processes the structs.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted structs.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~processStructItems(db, filePath, packageIds, data) ⇒

Processes the struct Items.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted struct items.

Param Type
db *
filePath *
packageIds *
data *

Loader API: Loader APIs~prepareDeviceType(deviceType) ⇒ Object

Prepares a device type object by extracting and transforming its properties.

This function takes a device type object and processes its properties to create a new object with a specific structure. It handles various properties such as device ID, profile ID, domain, name, description, class, scope, and superset. Additionally, it processes endpoint compositions and clusters if they exist.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Object - The prepared device type object with transformed properties.

Param Type Description
deviceType Object The device type object to be prepared.

Loader API: Loader APIs~processDeviceTypes(db, filePath, packageId, data, context) ⇒ Promise

Processes and inserts device types into the database. This function logs the number of device types being processed for debugging purposes. It maps over the provided data to prepare each device type and then iterates over each prepared device type. If a device type has a compositionType, it inserts the endpoint composition into the database, retrieves the endpoint composition ID, and then inserts the device composition. Finally, it inserts all prepared device types into the database.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise - A promise that resolves after all device types have been inserted into the database.

Param Type Description
db * The database connection object.
filePath string The file path from which the device types are being processed.
packageId * The package ID associated with the device types.
data Array The array of device types to be processed.
context * Additional context that might be required for processing.

Loader API: Loader APIs~processReloadDeviceTypes() ⇒ Promise

Processes and reloads device type entities in the database. This function is called when a custom xml with device types is reloaded.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise - A promise that resolves after all device types have been reloaded.

Loader API: Loader APIs~processDataTypes(db, filePath, packageId, knownPackages, toplevel) ⇒

Process promises for loading the data types

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of data types

Param Type
db *
filePath *
packageId *
knownPackages *
toplevel *

Loader API: Loader APIs~processAtomicTypes(db, filePath, packageId, knownPackages, toplevel) ⇒

Processes promises for loading individual tables per data type for atomics/baseline types.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of atomic/baseline processing.

Param Type
db *
filePath *
packageId *
knownPackages *
toplevel *

Loader API: Loader APIs~processNonAtomicTypes(db, filePath, packageId, knownPackages, toplevel, featureClusters) ⇒

Processes promises for loading individual tables per data type for no-atomic and inherited types.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of non-atomic/inherited data type processing.

Param Type
db *
filePath *
packageId *
knownPackages *
toplevel *
featureClusters *

Loader API: Loader APIs~processSubItems(db, filePath, packageId, knownPackages, toplevel, featureClusters, context, collectedStructItems) ⇒

Processes promises for loading items within a bitmap, struct, and enum data types.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of processing sub items within a bitmap, enum and structs.

Param Type
db *
filePath *
packageId *
knownPackages *
toplevel *
featureClusters *
context *
collectedStructItems *

Loader API: Loader APIs~processParsedZclData(db, argument, previouslyKnownPackages, context, collectedStructItems) ⇒

After XML parser is done with the barebones parsing, this function branches the individual toplevel tags.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: promise that resolves when all the subtags are parsed.

Param Type
db *
argument *
previouslyKnownPackages *
context *
collectedStructItems *

Loader API: Loader APIs~parseSingleZclFile(db, packageId, file, context, collectedStructItems) ⇒

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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise for when the last stage of the loading pipeline finishes.

Param Type
db *
packageId *
file *
context *
collectedStructItems *

Loader API: Loader APIs~isCrcMismatchOrPackageDoesNotExist(db, packageId, files) ⇒

Checks if there is a crc mismatch on any xml file. This can be used to decide if there is a need to reload all the xml files. Also check if the package is not loaded before.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: the status of crc mismatch and whether a package is present in an object

Param Type
db *
packageId *
files *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise that resolves when all the individual promises of each file pass.

Param Type
db *
packageId *
zclFiles *
context *

Loader API: Loader APIs~parseManufacturerData(db, ctx) ⇒

Parses the manufacturers xml.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of a parsed manufacturers file.

Param Type
db *
ctx *

Loader API: Loader APIs~parseProfilesData(db, ctx) ⇒

Parses the profiles xml.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of a parsed profiles file.

Param Type
db *
ctx *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: array of feature flags

Param Type
db *
packageId *
featureFlags *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise that loads the uiOptions object into the database.

Param Type
db *
packageId *
featureFlags *

Loader API: Loader APIs~parseOptions(db) ⇒

Parses and loads the text and boolean options.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: promise of parsed options

Param Type
db *

Loader API: Loader APIs~parseTextOptions(db, pkgRef, textOptions) ⇒

Parses the text options.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of a parsed text options.

Param Type
db *
pkgRef *
textOptions *

Loader API: Loader APIs~parseBoolOptions(db, pkgRef, booleanCategories) ⇒

Parses the boolean options.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of a parsed boolean options.

Param Type
db *
pkgRef *
booleanCategories *

Loader API: Loader APIs~parseattributeAccessInterfaceAttributes(db, pkgRef, attributeAccessInterfaceAttributes) ⇒ Promise.<void>

Asynchronously parses and inserts attribute access interface attributes into the database. This function iterates over the attributeAccessInterfaceAttributes object, processing each cluster by mapping its values to a specific structure and then inserting them into the database using the insertOptionsKeyValues function.

The main purpose of this function is to store cluster/attribute pairs including global attributes and their cluster pair The ATTRIBUTE table has cluster_ref as null for global attributes so this second method was necessary

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise.<void> - A promise that resolves when all attributes have been processed and inserted.

Param Type Description
db * The database connection object.
pkgRef * The package reference id for which the attributes are being parsed.
attributeAccessInterfaceAttributes * An object containing the attribute access interface attributes, structured by cluster.

Loader API: Loader APIs~parseDefaults(db, ctx) ⇒

Parses the default values inside the options.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promised of parsed text and bool defaults.

Param Type
db *
ctx *

Loader API: Loader APIs~parseTextDefaults(db, pkgRef, textDefaults) ⇒

Parse text defaults from default options.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Array of promises

Param Type
db *
pkgRef *
textDefaults *

Loader API: Loader APIs~parseBoolDefaults(db, pkgRef, booleanCategories) ⇒

Parse the boolean defaults inside options.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: List of promises

Param Type
db *
pkgRef *
booleanCategories *

Loader API: Loader APIs~loadIndividualSilabsFile(db, filePath) ⇒

Parses a single file. This function is used specifically for adding a package through an existing ZAP session because of its reliance on relating the new XML content to the packages associated with that session. e.g. for ClusterExtensions.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of a loaded file.

Param Type
db *
filePath *

Loader API: Loader APIs~processCustomZclDeviceType(db, ctx) ⇒

If custom device is supported, then this method creates it.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: context

Param Type
db *
ctx *

Loader API: Loader APIs~loadZclJson(db, metafile) ⇒

Load ZCL metadata

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of loaded zcl json file

Param Type
db *
metafile *

Loader API: Loader APIs~loadZclProperties(db, metafile) ⇒

Load ZCL metadata

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of loaded zcl properties file

Param Type
db *
metafile *

Loader API: Loader APIs~loadZclJsonOrProperties(db, ctx) ⇒

Toplevel function that loads the toplevel metafile and orchestrates the promise chain.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: a Promise that resolves with the db.

Param Type Description
db *
ctx * The context of loading.

Loader API: Loader APIs~recordToplevelPackage(db, metadataFile, crc, isTopLevelPackageInSync) ⇒

Records the toplevel package information and resolves into packageId

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: packageId

Param Type
db *
metadataFile *
crc *
isTopLevelPackageInSync *

Loader API: Loader APIs~recordVersion(db, ctx)

Records the version into the database.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type
db *
ctx *

Loader API: Loader APIs~loadZclMetaFilesCommon(db, metadataFile, options) ⇒

Retrieve zcl package information

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: package zcl package information

Param Type
db *
metadataFile *
options *

Loader API: Loader APIs~loadAttributeMappingForMultiProtocol(db, multiProtcolInfo, categoryToPackageIdMap)

Load attribute mapping table if there is multi-protocol information from a json file.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type
db *
multiProtcolInfo *
categoryToPackageIdMap *

Loader API: Loader APIs~loadZclMetafiles(db, metadataFile) ⇒

Toplevel function that loads the zcl file and passes it off to the correct zcl loader.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Array of loaded packageIds.

Param Type Description
db *
metadataFile * array of paths

Loader API: Loader APIs~loadZcl(db, metadataFile) ⇒

Loads individual zcl.json metafile.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Context object that contains .db and .packageId

Param Type
db *
metadataFile *

Loader API: Loader APIs~loadIndividualFile(db, filePath, sessionId)

Load individual custom XML files.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type Description
db *
filePath *
sessionId * Current session within which we're loading this file.

Loader API: Loader APIs~qualifyZclFile(db, info, parentPackageId, isCustom) ⇒

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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise that resolves int he object of data.

Param Type
db *
info *
parentPackageId *
isCustom *

Loader API: Loader APIs~processZclPostLoading(db, packageId) ⇒

Promises to perform a post loading step.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise to deal with the post-loading cleanup.

Param Type
db *
packageId *

Loader API: Loader APIs~getDiscriminatorMap(db, packageIds) ⇒

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: data type discriminator map

Param Type
db *
packageIds *

Loader API: Loader APIs

This module provides the APIs for for common functionality related to loading.

  • [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
    • [~collectDataFromLibraryXml(ctx)](#module_Loader API_ Loader APIs..collectDataFromLibraryXml) ⇒
    • [~tagContainsEnum(tag)](#module_Loader API_ Loader APIs..tagContainsEnum) ⇒
    • [~tagContainsStruct(tag)](#module_Loader API_ Loader APIs..tagContainsStruct) ⇒
    • [~tagContainsBitmap(tag)](#module_Loader API_ Loader APIs..tagContainsBitmap) ⇒
    • [~parseSingleZclFile(db, ctx, file)](#module_Loader API_ Loader APIs..parseSingleZclFile) ⇒
    • [~parseZclFiles(db, ctx)](#module_Loader API_ Loader APIs..parseZclFiles) ⇒
    • [~normalizeHexValue(value)](#module_Loader API_ Loader APIs..normalizeHexValue) ⇒
    • [~getNumBytesFromShortName(value)](#module_Loader API_ Loader APIs..getNumBytesFromShortName) ⇒
    • [~prepareAttributes(attributes, side)](#module_Loader API_ Loader APIs..prepareAttributes) ⇒
    • [~prepareCommands(commands, side, types)](#module_Loader API_ Loader APIs..prepareCommands) ⇒
    • [~prepareCluster(cluster, isExtension, types)](#module_Loader API_ Loader APIs..prepareCluster) ⇒
    • [~prepareAtomic(type)](#module_Loader API_ Loader APIs..prepareAtomic) ⇒
    • [~prepareSubAtomic(type, atomics)](#module_Loader API_ Loader APIs..prepareSubAtomic) ⇒
    • [~prepareBitmap(type, isContained)](#module_Loader API_ Loader APIs..prepareBitmap) ⇒
    • [~prepareEnum(type)](#module_Loader API_ Loader APIs..prepareEnum) ⇒
    • [~prepareStruct(type)](#module_Loader API_ Loader APIs..prepareStruct) ⇒
    • [~prepareSubAtomicTypes(types)](#module_Loader API_ Loader APIs..prepareSubAtomicTypes)
    • [~prepareTypes(zclTypes, types)](#module_Loader API_ Loader APIs..prepareTypes)
    • [~prepareAttributeType(attribute, types, cluster)](#module_Loader API_ Loader APIs..prepareAttributeType)
    • [~prepareDeviceType(deviceType)](#module_Loader API_ Loader APIs..prepareDeviceType) ⇒
    • [~prepareDataTypeDiscriminator(a)](#module_Loader API_ Loader APIs..prepareDataTypeDiscriminator) ⇒
    • [~processDataTypeDiscriminator(db, packageId, zclDataTypes)](#module_Loader API_ Loader APIs..processDataTypeDiscriminator) ⇒
    • [~prepareDataType(a, dataType, typeMap)](#module_Loader API_ Loader APIs..prepareDataType) ⇒
    • [~processDataType(db, filePath, packageId, data, dataType)](#module_Loader API_ Loader APIs..processDataType) ⇒
    • [~prepareNumber(a, dataType)](#module_Loader API_ Loader APIs..prepareNumber) ⇒
    • [~processNumber(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processNumber) ⇒
    • [~prepareString(a, dataType)](#module_Loader API_ Loader APIs..prepareString) ⇒
    • [~processString(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processString) ⇒
    • [~prepareEnumsOrBitmaps(a, dataType)](#module_Loader API_ Loader APIs..prepareEnumsOrBitmaps) ⇒
    • [~processEnums(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processEnums) ⇒
    • [~processEnumItems(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processEnumItems) ⇒
    • [~processBitmaps(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processBitmaps) ⇒
    • [~processBitmapFields(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processBitmapFields) ⇒
    • [~prepareStruct2(a, dataType)](#module_Loader API_ Loader APIs..prepareStruct2) ⇒
    • [~processStruct(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processStruct) ⇒
    • [~processStructItems(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processStructItems) ⇒
    • [~prepareEnumsOrBitmapsAtomic(a, dataType)](#module_Loader API_ Loader APIs..prepareEnumsOrBitmapsAtomic) ⇒
    • [~processEnumsFromAtomics(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processEnumsFromAtomics) ⇒
    • [~processBitmapsFromAtomics(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processBitmapsFromAtomics) ⇒
    • [~loadZclData(db, ctx)](#module_Loader API_ Loader APIs..loadZclData) ⇒
    • [~loadIndividualDotDotFile(db, filePath)](#module_Loader API_ Loader APIs..loadIndividualDotDotFile) ⇒ *
    • [~loadToplevelXmlFile(db, ctx)](#module_Loader API_ Loader APIs..loadToplevelXmlFile) ⇒
    • [~parseNewXmlFiles(db, packageId, files, context)](#module_Loader API_ Loader APIs..parseNewXmlFiles) ⇒
    • [~prepXmlFeature(f)](#module_Loader API_ Loader APIs..prepXmlFeature) ⇒
    • [~prepXmlAttribute(a)](#module_Loader API_ Loader APIs..prepXmlAttribute) ⇒
    • [~prepXmlCommand(c)](#module_Loader API_ Loader APIs..prepXmlCommand) ⇒
    • [~prepXmlEvent(e)](#module_Loader API_ Loader APIs..prepXmlEvent) ⇒
    • [~parseSingleNewXmlFile(f)](#module_Loader API_ Loader APIs..parseSingleNewXmlFile) ⇒
    • [~collectDataFromJsonFile(ctx)](#module_Loader API_ Loader APIs..collectDataFromJsonFile) ⇒
    • [~collectDataFromPropertiesFile(ctx)](#module_Loader API_ Loader APIs..collectDataFromPropertiesFile) ⇒
    • [~maskToType(mask)](#module_Loader API_ Loader APIs..maskToType) ⇒
    • [~prepareAtomic(a)](#module_Loader API_ Loader APIs..prepareAtomic)
    • [~processAtomics(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processAtomics) ⇒
    • [~prepareClusterGlobalAttribute(cluster)](#module_Loader API_ Loader APIs..prepareClusterGlobalAttribute) ⇒
    • [~extractAccessTag(ac)](#module_Loader API_ Loader APIs..extractAccessTag) ⇒
    • [~extractAccessIntoArray(xmlElement)](#module_Loader API_ Loader APIs..extractAccessIntoArray) ⇒
    • [~prepareCluster(cluster)](#module_Loader API_ Loader APIs..prepareCluster) ⇒
    • [~processClusters(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processClusters) ⇒
    • [~processClusterGlobalAttributes(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processClusterGlobalAttributes) ⇒
    • [~processClusterExtensions(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processClusterExtensions) ⇒
    • [~processGlobals(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processGlobals) ⇒
    • [~prepareTag(tag)](#module_Loader API_ Loader APIs..prepareTag) ⇒
    • [~processDefaultAccess(db, filePath, packageId, defaultAccessList)](#module_Loader API_ Loader APIs..processDefaultAccess)
    • [~processAccessControl(db, filePath, packageId, accessControlList)](#module_Loader API_ Loader APIs..processAccessControl)
    • [~processTags(db, filePath, packageId, tags)](#module_Loader API_ Loader APIs..processTags)
    • [~prepareDomain(domain)](#module_Loader API_ Loader APIs..prepareDomain) ⇒
    • [~processDomains(db, filePath, packageId, data)](#module_Loader API_ Loader APIs..processDomains) ⇒
    • [~prepareDataTypeDiscriminator(a)](#module_Loader API_ Loader APIs..prepareDataTypeDiscriminator) ⇒
    • [~processDataTypeDiscriminator(db, filePath, zclDataTypes)](#module_Loader API_ Loader APIs..processDataTypeDiscriminator) ⇒
    • [~prepareDataType(a, dataType, typeMap)](#module_Loader API_ Loader APIs..prepareDataType) ⇒
    • [~processDataType(db, filePath, packageId, knownPackages, data, dataType)](#module_Loader API_ Loader APIs..processDataType) ⇒
    • [~prepareNumber(a, dataType)](#module_Loader API_ Loader APIs..prepareNumber) ⇒
    • [~processNumber(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processNumber) ⇒
    • [~prepareString(a, dataType)](#module_Loader API_ Loader APIs..prepareString) ⇒
    • [~processString(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processString) ⇒
    • [~prepareEnumOrBitmapAtomic(a, dataType)](#module_Loader API_ Loader APIs..prepareEnumOrBitmapAtomic) ⇒
    • [~processEnumAtomic(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processEnumAtomic) ⇒
    • [~prepareEnumOrBitmap(a, dataType)](#module_Loader API_ Loader APIs..prepareEnumOrBitmap) ⇒
    • [~processEnum(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processEnum) ⇒
    • [~processEnumItems(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processEnumItems) ⇒
    • [~processBitmapAtomic(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processBitmapAtomic) ⇒
    • [~processBitmap(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processBitmap) ⇒
    • [~processBitmapFields(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processBitmapFields) ⇒
    • [~prepareStruct(a, dataType)](#module_Loader API_ Loader APIs..prepareStruct) ⇒
    • [~processStruct(db, filePath, packageId, knownPackages, data)](#module_Loader API_ Loader APIs..processStruct) ⇒
    • [~processStructItems(db, filePath, packageIds, data)](#module_Loader API_ Loader APIs..processStructItems) ⇒
    • [~prepareDeviceType(deviceType)](#module_Loader API_ Loader APIs..prepareDeviceType) ⇒ Object
    • [~processDeviceTypes(db, filePath, packageId, data, context)](#module_Loader API_ Loader APIs..processDeviceTypes) ⇒ Promise
    • [~processReloadDeviceTypes()](#module_Loader API_ Loader APIs..processReloadDeviceTypes) ⇒ Promise
    • [~processDataTypes(db, filePath, packageId, knownPackages, toplevel)](#module_Loader API_ Loader APIs..processDataTypes) ⇒
    • [~processAtomicTypes(db, filePath, packageId, knownPackages, toplevel)](#module_Loader API_ Loader APIs..processAtomicTypes) ⇒
    • [~processNonAtomicTypes(db, filePath, packageId, knownPackages, toplevel, featureClusters)](#module_Loader API_ Loader APIs..processNonAtomicTypes) ⇒
    • [~processSubItems(db, filePath, packageId, knownPackages, toplevel, featureClusters, context, collectedStructItems)](#module_Loader API_ Loader APIs..processSubItems) ⇒
    • [~processParsedZclData(db, argument, previouslyKnownPackages, context, collectedStructItems)](#module_Loader API_ Loader APIs..processParsedZclData) ⇒
    • [~parseSingleZclFile(db, packageId, file, context, collectedStructItems)](#module_Loader API_ Loader APIs..parseSingleZclFile) ⇒
    • [~isCrcMismatchOrPackageDoesNotExist(db, packageId, files)](#module_Loader API_ Loader APIs..isCrcMismatchOrPackageDoesNotExist) ⇒
    • [~parseZclFiles(db, packageId, zclFiles, context)](#module_Loader API_ Loader APIs..parseZclFiles) ⇒
    • [~parseManufacturerData(db, ctx)](#module_Loader API_ Loader APIs..parseManufacturerData) ⇒
    • [~parseProfilesData(db, ctx)](#module_Loader API_ Loader APIs..parseProfilesData) ⇒
    • [~parseFeatureFlags(db, packageId, featureFlags)](#module_Loader API_ Loader APIs..parseFeatureFlags) ⇒
    • [~parseUiOptions(db, packageId, featureFlags)](#module_Loader API_ Loader APIs..parseUiOptions) ⇒
    • [~parseOptions(db)](#module_Loader API_ Loader APIs..parseOptions) ⇒
    • [~parseTextOptions(db, pkgRef, textOptions)](#module_Loader API_ Loader APIs..parseTextOptions) ⇒
    • [~parseBoolOptions(db, pkgRef, booleanCategories)](#module_Loader API_ Loader APIs..parseBoolOptions) ⇒
    • [~parseattributeAccessInterfaceAttributes(db, pkgRef, attributeAccessInterfaceAttributes)](#module_Loader API_ Loader APIs..parseattributeAccessInterfaceAttributes) ⇒ Promise.<void>
    • [~parseDefaults(db, ctx)](#module_Loader API_ Loader APIs..parseDefaults) ⇒
    • [~parseTextDefaults(db, pkgRef, textDefaults)](#module_Loader API_ Loader APIs..parseTextDefaults) ⇒
    • [~parseBoolDefaults(db, pkgRef, booleanCategories)](#module_Loader API_ Loader APIs..parseBoolDefaults) ⇒
    • [~loadIndividualSilabsFile(db, filePath)](#module_Loader API_ Loader APIs..loadIndividualSilabsFile) ⇒
    • [~processCustomZclDeviceType(db, ctx)](#module_Loader API_ Loader APIs..processCustomZclDeviceType) ⇒
    • [~loadZclJson(db, metafile)](#module_Loader API_ Loader APIs..loadZclJson) ⇒
    • [~loadZclProperties(db, metafile)](#module_Loader API_ Loader APIs..loadZclProperties) ⇒
    • [~loadZclJsonOrProperties(db, ctx)](#module_Loader API_ Loader APIs..loadZclJsonOrProperties) ⇒
    • [~recordToplevelPackage(db, metadataFile, crc, isTopLevelPackageInSync)](#module_Loader API_ Loader APIs..recordToplevelPackage) ⇒
    • [~recordVersion(db, ctx)](#module_Loader API_ Loader APIs..recordVersion)
    • [~loadZclMetaFilesCommon(db, metadataFile, options)](#module_Loader API_ Loader APIs..loadZclMetaFilesCommon) ⇒
    • [~loadAttributeMappingForMultiProtocol(db, multiProtcolInfo, categoryToPackageIdMap)](#module_Loader API_ Loader APIs..loadAttributeMappingForMultiProtocol)
    • [~loadZclMetafiles(db, metadataFile)](#module_Loader API_ Loader APIs..loadZclMetafiles) ⇒
    • [~loadZcl(db, metadataFile)](#module_Loader API_ Loader APIs..loadZcl) ⇒
    • [~loadIndividualFile(db, filePath, sessionId)](#module_Loader API_ Loader APIs..loadIndividualFile)
    • [~qualifyZclFile(db, info, parentPackageId, isCustom)](#module_Loader API_ Loader APIs..qualifyZclFile) ⇒
    • [~processZclPostLoading(db, packageId)](#module_Loader API_ Loader APIs..processZclPostLoading) ⇒
    • [~getDiscriminatorMap(db, packageIds)](#module_Loader API_ Loader APIs..getDiscriminatorMap) ⇒

Loader API: Loader APIs~collectDataFromLibraryXml(ctx) ⇒

Promises to read the properties file, extract all the actual xml files, and resolve with the array of files.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of resolved files.

Param Type Description
ctx * Context which contains information about the metadataFiles and data

Loader API: Loader APIs~tagContainsEnum(tag) ⇒

Check if tag contains enum.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: boolean

Param Type
tag *

Loader API: Loader APIs~tagContainsStruct(tag) ⇒

Check if tag contains struct.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: boolean

Param Type
tag *

Loader API: Loader APIs~tagContainsBitmap(tag) ⇒

Check if tag contains Bitmap.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: boolean

Param Type
tag *

Loader API: Loader APIs~parseSingleZclFile(db, ctx, file) ⇒

Parses ZCL xml file.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: empty array

Param Type
db *
ctx *
file *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise that resolves when all the individual promises of each file pass.

Param Type
db *
ctx *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Either the normalized hex string (with the 0x prefix) or the original

Param Type Description
value * the string value to be normalized

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: size in bytes or 0 if the # of bytes could not be determined

Param Type Description
value * the string value to be scraped

Loader API: Loader APIs~prepareAttributes(attributes, side) ⇒

Prepare XML attributes for entry into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Array containing all data from XML ready to be inserted into the DB.

Param Type Description
attributes * an array of attributes
side * the side the attribute is on either "client" or "server"

Loader API: Loader APIs~prepareCommands(commands, side, types) ⇒

Prepare XML commands for entry into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Array containing all data from XML ready to be inserted in to the DB.

Param Type Description
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.

Loader API: Loader APIs~prepareCluster(cluster, isExtension, types) ⇒

Prepare XML cluster for insertion into the database. This method can also prepare clusterExtensions.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Object containing all data from XML.

Param Type Default Description
cluster *
isExtension * false if this is an extension or not (there are none in dotdot xml)
types * types object into which cluster can put types it might have

Loader API: Loader APIs~prepareAtomic(type) ⇒

Parses xml type into the atomic object for insertion into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: object ready for insertion into the DB

Param Type Description
type * an xml object which conforms to the atomic format in the dotdot xml

Loader API: Loader APIs~prepareSubAtomic(type, atomics) ⇒

Parses xml type into the sub-atomic object for insertion into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: object ready for insertion into the DB

Param Type Description
type * an xml object which conforms to the sub-atomic format in the dotdot xml
atomics * an array of atomic types

Loader API: Loader APIs~prepareBitmap(type, isContained) ⇒

Parses xml type into the bitmap object for insertion into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: object ready for insertion into the DB

Param Type Default Description
type * an xml object which conforms to the bitmap format in the dotdot xml
isContained * false a boolean indicating if this is coming from a contained tag or not

Loader API: Loader APIs~prepareEnum(type) ⇒

Parses xml type into the enum object for insertion into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: object ready for insertion into the DB

Param Type Description
type * an xml object which conforms to the enum format in the dotdot xml

Loader API: Loader APIs~prepareStruct(type) ⇒

Parses xml type into the struct object for insertion into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: object ready for insertion into the DB

Param Type Description
type * an xml object which conforms to the struct format in the dotdot xml

Loader API: Loader APIs~prepareSubAtomicTypes(types)

Parses array of xml objects that conform to the sub-atomic format in the dotdot xml

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type
types *

Loader API: Loader APIs~prepareTypes(zclTypes, types)

Parses xml types into the types object for insertion into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type Description
zclTypes * an array of xml types
types * an object which includes arrays for enums, bitmaps etc...

Loader API: Loader APIs~prepareAttributeType(attribute, types, cluster)

Parses xml types into the types object for insertion into the DB

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type Description
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)

Loader API: Loader APIs~prepareDeviceType(deviceType) ⇒

Preparation step for the device types.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: an object containing the prepared device types.

Param Type
deviceType *

Loader API: Loader APIs~prepareDataTypeDiscriminator(a) ⇒

Prepare Data Type Discriminator for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *

Loader API: Loader APIs~processDataTypeDiscriminator(db, packageId, zclDataTypes) ⇒

Processes Data Type Discriminator.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted Data Type Discriminators.

Param Type
db *
packageId *
zclDataTypes *

Loader API: Loader APIs~prepareDataType(a, dataType, typeMap) ⇒

Prepare Data Types for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *
typeMap *

Loader API: Loader APIs~processDataType(db, filePath, packageId, data, dataType) ⇒

Processes Data Type.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted Data Types into the Data Type table.

Param Type
db *
filePath *
packageId *
data *
dataType *

Loader API: Loader APIs~prepareNumber(a, dataType) ⇒

Prepare numbers for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processNumber(db, filePath, packageId, data) ⇒

Processes Numbers.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted numbers into the number table.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~prepareString(a, dataType) ⇒

Prepare strings for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processString(db, filePath, packageId, data) ⇒

Processes Strings.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted strings into the String table.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~prepareEnumsOrBitmaps(a, dataType) ⇒

Prepare enums or bitmaps for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processEnums(db, filePath, packageId, data) ⇒

Processes the enums.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted enums.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~processEnumItems(db, filePath, packageId, data) ⇒

Processes the enum Items.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted enum items.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~processBitmaps(db, filePath, packageId, data) ⇒

Processes the bitmaps.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted bitmaps.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~processBitmapFields(db, filePath, packageId, data) ⇒

Processes the bitmap fields.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted bitmap fields.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~prepareStruct2(a, dataType) ⇒

Prepare structs for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processStruct(db, filePath, packageId, data) ⇒

Processes the structs.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted structs.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~processStructItems(db, filePath, packageId, data) ⇒

Processes the struct Items.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted struct items.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~prepareEnumsOrBitmapsAtomic(a, dataType) ⇒

Prepare enums or bitmaps for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processEnumsFromAtomics(db, filePath, packageId, data) ⇒

Processes the enums.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted enums.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~processBitmapsFromAtomics(db, filePath, packageId, data) ⇒

Processes the bitmaps.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted bitmaps.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise that resolves when all the individual promises of each file pass.

Param Type
db *
ctx *

Loader API: Loader APIs~loadIndividualDotDotFile(db, filePath) ⇒ *

TODO This is not supported at this time.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: * - object w/ following: { packageId: pkgId } or { err: err }

Param Type
db *
filePath *

Loader API: Loader APIs~loadToplevelXmlFile(db, ctx) ⇒

Toplevel function that loads the xml library file and orchestrates the promise chain.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: a Promise that resolves with the db.

Param Type Description
db *
ctx * Context of loading.

Loader API: Loader APIs~parseNewXmlFiles(db, packageId, files, context) ⇒

Parses the new XML files. Returns an object containing loaded data: clusterIdsLoaded: array of cluster ids that were loaded

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise that resolves when all the new XML data is loaded.

Param Type
db *
packageId *
files *
context *

Loader API: Loader APIs~prepXmlFeature(f) ⇒

Prepare features from xml.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: feature information

Param Type
f *

Loader API: Loader APIs~prepXmlAttribute(a) ⇒

Prepare attributes from xml.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: attribute information

Param Type
a *

Loader API: Loader APIs~prepXmlCommand(c) ⇒

Prepare commands from xml.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: command information

Param Type
c *

Loader API: Loader APIs~prepXmlEvent(e) ⇒

Prepare events from xml

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: event information

Param Type
e *

Loader API: Loader APIs~parseSingleNewXmlFile(f) ⇒

Parse xml file.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: xml information from file

Param Type
f *

Loader API: Loader APIs~collectDataFromJsonFile(ctx) ⇒

Promises to read the JSON file and resolve all the data.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of resolved file.

Param Type Description
ctx * Context containing information about the file

Loader API: Loader APIs~collectDataFromPropertiesFile(ctx) ⇒

Promises to read the properties file, extract all the actual xml files, and resolve with the array of files.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of resolved files.

Param Type Description
ctx * Context which contains information about the propertiesFiles and data

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: bool or corresponding enum

Param Type
mask *

Loader API: Loader APIs~prepareAtomic(a)

Prepare atomic to db insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type
a *

Loader API: Loader APIs~processAtomics(db, filePath, packageId, data) ⇒

Processes atomic types for DB insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted bitmaps

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~prepareClusterGlobalAttribute(cluster) ⇒

Prepares global attribute data.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Object containing the data from XML.

Param Type
cluster *

Loader API: Loader APIs~extractAccessTag(ac) ⇒

Extract access information

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: access tag information

Param Type
ac *

Loader API: Loader APIs~extractAccessIntoArray(xmlElement) ⇒

Extract list of access information

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: array of access information

Param Type
xmlElement *

Loader API: Loader APIs~prepareCluster(cluster) ⇒

Prepare XML cluster for insertion into the database. This method can also prepare clusterExtensions.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Object containing all data from XML.

Param Type
cluster *

Loader API: Loader APIs~processClusters(db, filePath, packageId, data) ⇒

Process clusters for insertion into the database.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of cluster insertion.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~processClusterGlobalAttributes(db, filePath, packageId, data) ⇒

Processes global attributes for insertion into the database.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted data.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: promise to resolve the clusterExtension tags

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: promise to resolve the globals

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~prepareTag(tag) ⇒

Prepare tag object from tag

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: tag information

Param Type
tag *

Loader API: Loader APIs~processDefaultAccess(db, filePath, packageId, defaultAccessList)

Process defaultAccess tag in the XML.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type
db *
filePath *
packageId *
defaultAccessList *

Loader API: Loader APIs~processAccessControl(db, filePath, packageId, accessControlList)

Process accessControl tag in the XML.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type
db *
filePath *
packageId *
accessControlList *

Loader API: Loader APIs~processTags(db, filePath, packageId, tags)

Processes the tags in the XML.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type
db *
filePath *
packageId *
tags *

Loader API: Loader APIs~prepareDomain(domain) ⇒

Convert domain from XMl to domain for DB.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Domain object for DB.

Param Type
domain *

Loader API: Loader APIs~processDomains(db, filePath, packageId, data) ⇒

Process domains for insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of database insertion of domains.

Param Type
db *
filePath *
packageId *
data *

Loader API: Loader APIs~prepareDataTypeDiscriminator(a) ⇒

Prepare Data Type Discriminator for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *

Loader API: Loader APIs~processDataTypeDiscriminator(db, filePath, zclDataTypes) ⇒

Processes Data Type Discriminator.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted Data Type Discriminators.

Param Type
db *
filePath *
zclDataTypes *

Loader API: Loader APIs~prepareDataType(a, dataType, typeMap) ⇒

Prepare Data Types for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *
typeMap *

Loader API: Loader APIs~processDataType(db, filePath, packageId, knownPackages, data, dataType) ⇒

Processes Data Type.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted Data Types into the Data Type table.

Param Type
db *
filePath *
packageId *
knownPackages *
data *
dataType *

Loader API: Loader APIs~prepareNumber(a, dataType) ⇒

Prepare numbers for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processNumber(db, filePath, packageId, knownPackages, data) ⇒

Processes Numbers.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted numbers into the number table.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~prepareString(a, dataType) ⇒

Prepare strings for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processString(db, filePath, packageId, knownPackages, data) ⇒

Processes Strings.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of inserted strings into the String table.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~prepareEnumOrBitmapAtomic(a, dataType) ⇒

Prepare enums or bitmaps for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processEnumAtomic(db, filePath, packageId, knownPackages, data) ⇒

Processes the enums.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted enums.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~prepareEnumOrBitmap(a, dataType) ⇒

Prepare enums or bitmaps for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processEnum(db, filePath, packageId, knownPackages, data) ⇒

Processes the enums.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted enums.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~processEnumItems(db, filePath, packageId, knownPackages, data) ⇒

Processes the enum Items.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted enum items.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~processBitmapAtomic(db, filePath, packageId, knownPackages, data) ⇒

Processes the bitmaps.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted bitmaps.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~processBitmap(db, filePath, packageId, knownPackages, data) ⇒

Processes the bitmaps.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted bitmaps.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~processBitmapFields(db, filePath, packageId, knownPackages, data) ⇒

Processes the bitmap fields.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted bitmap fields.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~prepareStruct(a, dataType) ⇒

Prepare structs for database table insertion.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: An Object

Param Type
a *
dataType *

Loader API: Loader APIs~processStruct(db, filePath, packageId, knownPackages, data) ⇒

Processes the structs.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted structs.

Param Type
db *
filePath *
packageId *
knownPackages *
data *

Loader API: Loader APIs~processStructItems(db, filePath, packageIds, data) ⇒

Processes the struct Items.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise of inserted struct items.

Param Type
db *
filePath *
packageIds *
data *

Loader API: Loader APIs~prepareDeviceType(deviceType) ⇒ Object

Prepares a device type object by extracting and transforming its properties.

This function takes a device type object and processes its properties to create a new object with a specific structure. It handles various properties such as device ID, profile ID, domain, name, description, class, scope, and superset. Additionally, it processes endpoint compositions and clusters if they exist.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Object - The prepared device type object with transformed properties.

Param Type Description
deviceType Object The device type object to be prepared.

Loader API: Loader APIs~processDeviceTypes(db, filePath, packageId, data, context) ⇒ Promise

Processes and inserts device types into the database. This function logs the number of device types being processed for debugging purposes. It maps over the provided data to prepare each device type and then iterates over each prepared device type. If a device type has a compositionType, it inserts the endpoint composition into the database, retrieves the endpoint composition ID, and then inserts the device composition. Finally, it inserts all prepared device types into the database.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise - A promise that resolves after all device types have been inserted into the database.

Param Type Description
db * The database connection object.
filePath string The file path from which the device types are being processed.
packageId * The package ID associated with the device types.
data Array The array of device types to be processed.
context * Additional context that might be required for processing.

Loader API: Loader APIs~processReloadDeviceTypes() ⇒ Promise

Processes and reloads device type entities in the database. This function is called when a custom xml with device types is reloaded.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise - A promise that resolves after all device types have been reloaded.

Loader API: Loader APIs~processDataTypes(db, filePath, packageId, knownPackages, toplevel) ⇒

Process promises for loading the data types

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of data types

Param Type
db *
filePath *
packageId *
knownPackages *
toplevel *

Loader API: Loader APIs~processAtomicTypes(db, filePath, packageId, knownPackages, toplevel) ⇒

Processes promises for loading individual tables per data type for atomics/baseline types.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of atomic/baseline processing.

Param Type
db *
filePath *
packageId *
knownPackages *
toplevel *

Loader API: Loader APIs~processNonAtomicTypes(db, filePath, packageId, knownPackages, toplevel, featureClusters) ⇒

Processes promises for loading individual tables per data type for no-atomic and inherited types.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of non-atomic/inherited data type processing.

Param Type
db *
filePath *
packageId *
knownPackages *
toplevel *
featureClusters *

Loader API: Loader APIs~processSubItems(db, filePath, packageId, knownPackages, toplevel, featureClusters, context, collectedStructItems) ⇒

Processes promises for loading items within a bitmap, struct, and enum data types.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of processing sub items within a bitmap, enum and structs.

Param Type
db *
filePath *
packageId *
knownPackages *
toplevel *
featureClusters *
context *
collectedStructItems *

Loader API: Loader APIs~processParsedZclData(db, argument, previouslyKnownPackages, context, collectedStructItems) ⇒

After XML parser is done with the barebones parsing, this function branches the individual toplevel tags.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: promise that resolves when all the subtags are parsed.

Param Type
db *
argument *
previouslyKnownPackages *
context *
collectedStructItems *

Loader API: Loader APIs~parseSingleZclFile(db, packageId, file, context, collectedStructItems) ⇒

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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: A promise for when the last stage of the loading pipeline finishes.

Param Type
db *
packageId *
file *
context *
collectedStructItems *

Loader API: Loader APIs~isCrcMismatchOrPackageDoesNotExist(db, packageId, files) ⇒

Checks if there is a crc mismatch on any xml file. This can be used to decide if there is a need to reload all the xml files. Also check if the package is not loaded before.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: the status of crc mismatch and whether a package is present in an object

Param Type
db *
packageId *
files *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise that resolves when all the individual promises of each file pass.

Param Type
db *
packageId *
zclFiles *
context *

Loader API: Loader APIs~parseManufacturerData(db, ctx) ⇒

Parses the manufacturers xml.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of a parsed manufacturers file.

Param Type
db *
ctx *

Loader API: Loader APIs~parseProfilesData(db, ctx) ⇒

Parses the profiles xml.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of a parsed profiles file.

Param Type
db *
ctx *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: array of feature flags

Param Type
db *
packageId *
featureFlags *

Loader API: Loader APIs~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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise that loads the uiOptions object into the database.

Param Type
db *
packageId *
featureFlags *

Loader API: Loader APIs~parseOptions(db) ⇒

Parses and loads the text and boolean options.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: promise of parsed options

Param Type
db *

Loader API: Loader APIs~parseTextOptions(db, pkgRef, textOptions) ⇒

Parses the text options.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of a parsed text options.

Param Type
db *
pkgRef *
textOptions *

Loader API: Loader APIs~parseBoolOptions(db, pkgRef, booleanCategories) ⇒

Parses the boolean options.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of a parsed boolean options.

Param Type
db *
pkgRef *
booleanCategories *

Loader API: Loader APIs~parseattributeAccessInterfaceAttributes(db, pkgRef, attributeAccessInterfaceAttributes) ⇒ Promise.<void>

Asynchronously parses and inserts attribute access interface attributes into the database. This function iterates over the attributeAccessInterfaceAttributes object, processing each cluster by mapping its values to a specific structure and then inserting them into the database using the insertOptionsKeyValues function.

The main purpose of this function is to store cluster/attribute pairs including global attributes and their cluster pair The ATTRIBUTE table has cluster_ref as null for global attributes so this second method was necessary

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise.<void> - A promise that resolves when all attributes have been processed and inserted.

Param Type Description
db * The database connection object.
pkgRef * The package reference id for which the attributes are being parsed.
attributeAccessInterfaceAttributes * An object containing the attribute access interface attributes, structured by cluster.

Loader API: Loader APIs~parseDefaults(db, ctx) ⇒

Parses the default values inside the options.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promised of parsed text and bool defaults.

Param Type
db *
ctx *

Loader API: Loader APIs~parseTextDefaults(db, pkgRef, textDefaults) ⇒

Parse text defaults from default options.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Array of promises

Param Type
db *
pkgRef *
textDefaults *

Loader API: Loader APIs~parseBoolDefaults(db, pkgRef, booleanCategories) ⇒

Parse the boolean defaults inside options.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: List of promises

Param Type
db *
pkgRef *
booleanCategories *

Loader API: Loader APIs~loadIndividualSilabsFile(db, filePath) ⇒

Parses a single file. This function is used specifically for adding a package through an existing ZAP session because of its reliance on relating the new XML content to the packages associated with that session. e.g. for ClusterExtensions.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of a loaded file.

Param Type
db *
filePath *

Loader API: Loader APIs~processCustomZclDeviceType(db, ctx) ⇒

If custom device is supported, then this method creates it.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: context

Param Type
db *
ctx *

Loader API: Loader APIs~loadZclJson(db, metafile) ⇒

Load ZCL metadata

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of loaded zcl json file

Param Type
db *
metafile *

Loader API: Loader APIs~loadZclProperties(db, metafile) ⇒

Load ZCL metadata

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise of loaded zcl properties file

Param Type
db *
metafile *

Loader API: Loader APIs~loadZclJsonOrProperties(db, ctx) ⇒

Toplevel function that loads the toplevel metafile and orchestrates the promise chain.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: a Promise that resolves with the db.

Param Type Description
db *
ctx * The context of loading.

Loader API: Loader APIs~recordToplevelPackage(db, metadataFile, crc, isTopLevelPackageInSync) ⇒

Records the toplevel package information and resolves into packageId

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: packageId

Param Type
db *
metadataFile *
crc *
isTopLevelPackageInSync *

Loader API: Loader APIs~recordVersion(db, ctx)

Records the version into the database.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type
db *
ctx *

Loader API: Loader APIs~loadZclMetaFilesCommon(db, metadataFile, options) ⇒

Retrieve zcl package information

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: package zcl package information

Param Type
db *
metadataFile *
options *

Loader API: Loader APIs~loadAttributeMappingForMultiProtocol(db, multiProtcolInfo, categoryToPackageIdMap)

Load attribute mapping table if there is multi-protocol information from a json file.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type
db *
multiProtcolInfo *
categoryToPackageIdMap *

Loader API: Loader APIs~loadZclMetafiles(db, metadataFile) ⇒

Toplevel function that loads the zcl file and passes it off to the correct zcl loader.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Array of loaded packageIds.

Param Type Description
db *
metadataFile * array of paths

Loader API: Loader APIs~loadZcl(db, metadataFile) ⇒

Loads individual zcl.json metafile.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Context object that contains .db and .packageId

Param Type
db *
metadataFile *

Loader API: Loader APIs~loadIndividualFile(db, filePath, sessionId)

Load individual custom XML files.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)

Param Type Description
db *
filePath *
sessionId * Current session within which we're loading this file.

Loader API: Loader APIs~qualifyZclFile(db, info, parentPackageId, isCustom) ⇒

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: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise that resolves int he object of data.

Param Type
db *
info *
parentPackageId *
isCustom *

Loader API: Loader APIs~processZclPostLoading(db, packageId) ⇒

Promises to perform a post loading step.

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: Promise to deal with the post-loading cleanup.

Param Type
db *
packageId *

Loader API: Loader APIs~getDiscriminatorMap(db, packageIds) ⇒

Kind: inner method of [Loader API: Loader APIs](#module_Loader API_ Loader APIs)
Returns: data type discriminator map

Param Type
db *
packageIds *