- 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.
This module provides common external URLs.
This module provides mappings between database columns and JS keys.
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)
Global symbol that carries the API info metadata
Kind: static property of [Renderer API: Renderer API.
](#module_Renderer API_ Renderer API.)
Global function that can execute the APIs.
Kind: static property of [Renderer API: Renderer API.
](#module_Renderer API_ Renderer API.)
Global function that can be overloaded by jxbrowser for notifications
Kind: static property of [Renderer API: Renderer API.
](#module_Renderer API_ Renderer API.)
This module provides REST API Exports.
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)
Log ipc client message
Kind: inner method of [IPC Client API: Inter-process communication
](#module_IPC Client API_ Inter-process communication)
Param | Type |
---|---|
msg | * |
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
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 | * |
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
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
Disconnects a client asynchronously.
Kind: inner method of [IPC Client API: Inter-process communication
](#module_IPC Client API_ Inter-process communication)
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 | * |
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) ⇒
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 | * |
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 | * |
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 | * |
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 | * |
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.
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
Imediatelly closes the database.
Kind: inner method of [JS API: low level database access
](#module_JS API_ low level database access)
Param | Type |
---|---|
database | * |
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.
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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) ⇒
Clears the entire cache.
Kind: inner method of [DB API: zcl database access
](#module_DB API_ zcl database access)
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 | * |
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 | * |
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 | * |
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 | * |
Returns the cache statistics.
Kind: inner method of [DB API: zcl database access
](#module_DB API_ zcl database access)
Enable the Database Query cache
Kind: inner method of [DB API: zcl database access
](#module_DB API_ zcl database access)
Disable the database cache
Kind: inner method of [DB API: zcl database access
](#module_DB API_ zcl database access)
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 | * |
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 | * |
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. |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 |
|
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 | * |
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 | * |
|
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
This module provides mappings between database columns and JS keys.
This module provides queries related to 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) ⇒
Clears the entire cache.
Kind: inner method of [DB API: zcl database access
](#module_DB API_ zcl database access)
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 | * |
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 | * |
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 | * |
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 | * |
Returns the cache statistics.
Kind: inner method of [DB API: zcl database access
](#module_DB API_ zcl database access)
Enable the Database Query cache
Kind: inner method of [DB API: zcl database access
](#module_DB API_ zcl database access)
Disable the database cache
Kind: inner method of [DB API: zcl database access
](#module_DB API_ zcl database access)
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 | * |
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 | * |
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. |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 |
|
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 | * |
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 | * |
|
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
This module provides queries related to attributes.
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) ⇒
Clears the entire cache.
Kind: inner method of [DB API: zcl database access
](#module_DB API_ zcl database access)
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 | * |
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 | * |
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 | * |
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 | * |
Returns the cache statistics.
Kind: inner method of [DB API: zcl database access
](#module_DB API_ zcl database access)
Enable the Database Query cache
Kind: inner method of [DB API: zcl database access
](#module_DB API_ zcl database access)
Disable the database cache
Kind: inner method of [DB API: zcl database access
](#module_DB API_ zcl database access)
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 | * |
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 | * |
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. |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 |
|
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 | * |
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 | * |
|
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
This module provides queries related to cluster.
This module provides queries related to commands.
This module provides queries for user configuration.
This module provides queries for data type discriminator
This module provides queries for data types
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) ⇒
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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) |
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 | * |
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 | * |
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 | * |
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. |
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 | * |
This module provides queries for endpoint type.
This module provides queries for endpoint configuration.
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) ⇒
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
This module provides queries related to events.
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) ⇒
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 | * |
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 | * |
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 | * |
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 | * |
This module provides queries related to imports and exports of files.
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)
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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: |
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 | * |
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 | * |
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 |
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. |
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 |
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 | * |
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. |
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 |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 |
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 | * |
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 | * |
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 | * |
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 |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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) ⇒
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 |
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 |
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 |
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 |
This module provides package notification related queries.
This module provides queries related to packages.
This module provides session notification related queries.
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) ⇒
Clears the entire cache.
Kind: inner method of [DB API: zcl database access
](#module_DB API_ zcl database access)
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 | * |
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 | * |
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 | * |
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 | * |
Returns the cache statistics.
Kind: inner method of [DB API: zcl database access
](#module_DB API_ zcl database access)
Enable the Database Query cache
Kind: inner method of [DB API: zcl database access
](#module_DB API_ zcl database access)
Disable the database cache
Kind: inner method of [DB API: zcl database access
](#module_DB API_ zcl database access)
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 | * |
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 | * |
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. |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 |
|
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 | * |
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 | * |
|
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
This module provides session related queries.
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) ⇒
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 |
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 |
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 |
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) ⇒
Clears the entire cache.
Kind: inner method of [DB API: zcl database access
](#module_DB API_ zcl database access)
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 | * |
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 | * |
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 | * |
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 | * |
Returns the cache statistics.
Kind: inner method of [DB API: zcl database access
](#module_DB API_ zcl database access)
Enable the Database Query cache
Kind: inner method of [DB API: zcl database access
](#module_DB API_ zcl database access)
Disable the database cache
Kind: inner method of [DB API: zcl database access
](#module_DB API_ zcl database access)
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 | * |
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 | * |
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. |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 |
|
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 | * |
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 | * |
|
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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) ⇒
Clears the entire cache.
Kind: inner method of [DB API: zcl database access
](#module_DB API_ zcl database access)
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 | * |
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 | * |
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 | * |
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 | * |
Returns the cache statistics.
Kind: inner method of [DB API: zcl database access
](#module_DB API_ zcl database access)
Enable the Database Query cache
Kind: inner method of [DB API: zcl database access
](#module_DB API_ zcl database access)
Disable the database cache
Kind: inner method of [DB API: zcl database access
](#module_DB API_ zcl database access)
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 | * |
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 | * |
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. |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 |
|
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 | * |
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 | * |
|
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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) ⇒
Clears the entire cache.
Kind: inner method of [DB API: zcl database access
](#module_DB API_ zcl database access)
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 | * |
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 | * |
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 | * |
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 | * |
Returns the cache statistics.
Kind: inner method of [DB API: zcl database access
](#module_DB API_ zcl database access)
Enable the Database Query cache
Kind: inner method of [DB API: zcl database access
](#module_DB API_ zcl database access)
Disable the database cache
Kind: inner method of [DB API: zcl database access
](#module_DB API_ zcl database access)
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 | * |
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 | * |
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. |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 |
|
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 | * |
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 | * |
|
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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](#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) ⇒
- [~findAndReadJsonFiles(obj, basePath)](#module_JS API_ generator logic..findAndReadJsonFiles) ⇒
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. |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 |
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 | * |
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. |
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 | * |
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 | * |
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 | * |
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 | * |
Create a generation log.
Kind: inner method of [JS API: generator logic
](#module_JS API_ generator logic)
Param | Type |
---|---|
logFile | * |
genData | * |
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 | * |
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. |
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 | * |
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 | * |
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 |
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 | * |
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 |
Function that loads the partials.
Kind: inner method of [JS API: generator logic
](#module_JS API_ generator logic)
Param | Type |
---|---|
hb | * |
name | * |
data | * |
Kind: inner method of [JS API: generator logic
](#module_JS API_ generator logic)
Returns: function
Param | Type |
---|---|
wrappedHelper | * |
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 | * |
|
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.
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 | * |
Global helper initialization
Kind: inner method of [JS API: generator logic
](#module_JS API_ generator logic)
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.
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 | * |
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. |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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. |
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) ⇒
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 | * |
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 | * |
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 | * |
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 | * |
Get the access list information.
Kind: inner method of [Templating API: Access helpers
](#module_Templating API_ Access helpers)
Returns: access list
Param | Type |
---|---|
options | * |
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)
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 | * |
Valid within a cluster context, requires code.
Kind: inner method of [Templating API: Attribute helpers
](#module_Templating API_ Attribute helpers)
Returns: Produces attribute defaults.
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 | * |
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) ⇒
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 |
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 |
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 | * |
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 | * |
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 | * |
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 |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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. |
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 |
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. |
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. |
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) ⇒
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 | * |
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 | * |
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
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 | * |
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 | * |
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
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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)
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 | * |
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 | * |
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 | * |
This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}
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) ⇒
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 |
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 |
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 | * |
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 | * |
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 | * |
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 |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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) ⇒
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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
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 | * |
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 | * |
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 |
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 | * |
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 |
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 | * |
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 | * |
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 | * |
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)
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)
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. |
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 |
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 | * |
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)
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 | * |
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 |
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 | * |
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 | * |
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 | * |
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) ⇒
Get a transformed config object.
Kind: inner method of [Templating API: Token helpers
](#module_Templating API_ Token helpers)
Returns: object
Param | Type |
---|---|
config | * |
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)
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)
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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) ⇒
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
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.
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 | * |
return back slash
Kind: inner method of [Templating API: toplevel utility helpers
](#module_Templating API_ toplevel utility helpers)
Returns: string
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
Forced fail halper.
Kind: inner method of [Templating API: toplevel utility helpers
](#module_Templating API_ toplevel utility helpers)
Param | Type |
---|---|
options | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
Iteration block.
Kind: inner method of [Templating API: toplevel utility helpers
](#module_Templating API_ toplevel utility helpers)
Add to accumulator results.
Kind: inner method of [Templating API: toplevel utility helpers
](#module_Templating API_ toplevel utility helpers)
Param | Type |
---|---|
accumulator | * |
value | * |
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 | * |
Resolves all the given globalPromises promises.
Kind: inner method of [Templating API: toplevel utility helpers
](#module_Templating API_ toplevel utility helpers)
Param | Type |
---|---|
globalPromises | * |
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 | * |
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)
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 |
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 |
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 |
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
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 | * |
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 | * |
Kind: inner method of [Templating API: toplevel utility helpers
](#module_Templating API_ toplevel utility helpers)
Returns: val in uppercase
Param | Type |
---|---|
val | * |
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) ⇒
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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
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 |
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. |
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. |
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 | * |
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 | * |
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 | * |
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' |
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") |
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. |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 |
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 | * |
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 | * |
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 |
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 | * |
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 | * |
Compares 2 strings.
Kind: inner method of [Templating API: static zcl helpers
](#module_Templating API_ static zcl helpers)
Returns: boolean
Param | Type |
---|---|
str1 | * |
str2 | * |
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 | * |
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 | * |
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 | * |
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 |
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 |
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 |
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 | * |
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 | * |
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}} |
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 | * |
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 | * |
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 | * |
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 | * |
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)
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 | * |
This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}
- [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) ⇒
- [~findAndReadJsonFiles(obj, basePath)](#module_JS API_ generator logic..findAndReadJsonFiles) ⇒
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. |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 |
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 | * |
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. |
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 | * |
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 | * |
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 | * |
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 | * |
Create a generation log.
Kind: inner method of [JS API: generator logic
](#module_JS API_ generator logic)
Param | Type |
---|---|
logFile | * |
genData | * |
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 | * |
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. |
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 | * |
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 | * |
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 |
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 | * |
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 |
Function that loads the partials.
Kind: inner method of [JS API: generator logic
](#module_JS API_ generator logic)
Param | Type |
---|---|
hb | * |
name | * |
data | * |
Kind: inner method of [JS API: generator logic
](#module_JS API_ generator logic)
Returns: function
Param | Type |
---|---|
wrappedHelper | * |
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 | * |
|
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.
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 | * |
Global helper initialization
Kind: inner method of [JS API: generator logic
](#module_JS API_ generator logic)
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.
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 | * |
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. |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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: 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) ⇒
- [~findAndReadJsonFiles(obj, basePath)](#module_JS API_ generator logic..findAndReadJsonFiles) ⇒
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. |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 |
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 | * |
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. |
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 | * |
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 | * |
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 | * |
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 | * |
Create a generation log.
Kind: inner method of [JS API: generator logic
](#module_JS API_ generator logic)
Param | Type |
---|---|
logFile | * |
genData | * |
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 | * |
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. |
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 | * |
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 | * |
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 |
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 | * |
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 |
Function that loads the partials.
Kind: inner method of [JS API: generator logic
](#module_JS API_ generator logic)
Param | Type |
---|---|
hb | * |
name | * |
data | * |
Kind: inner method of [JS API: generator logic
](#module_JS API_ generator logic)
Returns: function
Param | Type |
---|---|
wrappedHelper | * |
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 | * |
|
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.
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 | * |
Global helper initialization
Kind: inner method of [JS API: generator logic
](#module_JS API_ generator logic)
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.
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 | * |
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. |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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. |
This module provides the APIs to Silabs Simplicity Studio's Jetty server.
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)
- [~getComponentIdsByCluster(db, sessionId, clusterId, side)](#module_REST API_ user data..getComponentIdsByCluster) ⇒
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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. |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
HTTP GET: Project packages
Kind: inner method of [REST API: user data
](#module_REST API_ user data)
HTTP GET: All Packages
Kind: inner method of [REST API: user data
](#module_REST API_ user data)
HTTP POST: Add new project package
Kind: inner method of [REST API: user data
](#module_REST API_ user data)
HTTP POST: Unify all Attributes / Command states if a certain cluster is enabled on more than one endpoint.
- 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.
- (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)
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 | * |
Insert command defaults into the database.
Kind: inner method of [REST API: user data
](#module_REST API_ user data)
Param | Type |
---|---|
db | * |
defaults | * |
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 | * |
Write attribute defaults.
Kind: inner method of [REST API: user data
](#module_REST API_ user data)
Param | Type |
---|---|
db | * |
defaults | * |
Compares 2 commands for equality.
Kind: inner method of [REST API: user data
](#module_REST API_ user data)
Returns: boolean
Param | Type |
---|---|
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
This module provides the functionality that reads the ZAP data from a database and exports it into a 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)
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 | * |
Converts attribute object for internal representation.
Kind: inner method of [zap file
](#Format API_ Formats .module_zap file)
Returns: string
Param | Type |
---|---|
a | * |
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 | * |
Converts command object for file representation.
Kind: inner method of [zap file
](#Format API_ Formats .module_zap file)
Returns: string
Param | Type |
---|---|
cmd | * |
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 | * |
Converts event object for file representation
Kind: inner method of [zap file
](#Format API_ Formats .module_zap file)
Returns: String
Param | Type |
---|---|
ev | * |
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 | * |
Packs key value pairs for extenrnal representation
Kind: inner method of [zap file
](#Format API_ Formats .module_zap file)
Returns: none
Param | Type |
---|---|
keyValuePairs | * |
Cleanses toplevel cluster data.
Kind: inner method of [zap file
](#Format API_ Formats .module_zap file)
Param | Type |
---|---|
c | * |
Uncleanses the toplevel cluster data.
Kind: inner method of [zap file
](#Format API_ Formats .module_zap file)
Param | Type |
---|---|
c | * |
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 | * |
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 | * |
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)
This module provides the functionality that reads a .isc file
This module provides the functionality that reads a .json(.zap) file
This file provides the functionality that reads the ZAP data from a JSON file and imports it into a database.
This module provides the APIs for initializing timers specifically for sessions.
This file contains various startup modes.
This file contains watchdogs.
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)
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 | * |
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 | * |
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 | * |
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) ⇒
HTTP DELETE: endpoint
Kind: inner method of [REST API: endpoint
](#module_REST API_ endpoint)
Returns: callback for the express uri registration
Param | Type |
---|---|
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 | * |
HTTP POST: endpoint
Kind: inner method of [REST API: endpoint
](#module_REST API_ endpoint)
Returns: callback for the express uri registration
Param | Type |
---|---|
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. |
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 | * |
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. |
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 | * |
This module provides the interface to an extenal IDE: Simplicity Studio.
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) ⇒
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 | * |
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 | * |
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 | * |
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 | * |
Get component tree.
Kind: inner method of [REST API: generation functions
](#module_REST API_ generation functions)
Returns: Response data
Param | Type |
---|---|
db | * |
Update component.
Kind: inner method of [REST API: generation functions
](#module_REST API_ generation functions)
Param | Type |
---|---|
db | * |
request | * |
response | * |
add | * |
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 | * |
Remove component.
Kind: inner method of [REST API: generation functions
](#module_REST API_ generation functions)
Returns: Promise of component removed
Param | Type |
---|---|
db | * |
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) ⇒
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 | * |
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 | * |
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 | * |
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 | * |
Get component tree.
Kind: inner method of [REST API: generation functions
](#module_REST API_ generation functions)
Returns: Response data
Param | Type |
---|---|
db | * |
Update component.
Kind: inner method of [REST API: generation functions
](#module_REST API_ generation functions)
Param | Type |
---|---|
db | * |
request | * |
response | * |
add | * |
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 | * |
Remove component.
Kind: inner method of [REST API: generation functions
](#module_REST API_ generation functions)
Returns: Promise of component removed
Param | Type |
---|---|
db | * |
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) ⇒
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 |
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 |
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' |
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 | * |
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 | * |
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) ⇒
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 | * |
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 | * |
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 | * |
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. |
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 | * |
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)
- [~getComponentIdsByCluster(db, sessionId, clusterId, side)](#module_REST API_ user data..getComponentIdsByCluster) ⇒
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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. |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
HTTP GET: Project packages
Kind: inner method of [REST API: user data
](#module_REST API_ user data)
HTTP GET: All Packages
Kind: inner method of [REST API: user data
](#module_REST API_ user data)
HTTP POST: Add new project package
Kind: inner method of [REST API: user data
](#module_REST API_ user data)
HTTP POST: Unify all Attributes / Command states if a certain cluster is enabled on more than one endpoint.
- 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.
- (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)
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 | * |
Insert command defaults into the database.
Kind: inner method of [REST API: user data
](#module_REST API_ user data)
Param | Type |
---|---|
db | * |
defaults | * |
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 | * |
Write attribute defaults.
Kind: inner method of [REST API: user data
](#module_REST API_ user data)
Param | Type |
---|---|
db | * |
defaults | * |
Compares 2 commands for equality.
Kind: inner method of [REST API: user data
](#module_REST API_ user data)
Returns: boolean
Param | Type |
---|---|
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
This module contains Matter specific APIs.
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)
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 | * |
Register all REST modeules.
Kind: inner method of [JS API: http server
](#module_JS API_ http server)
Param | Type |
---|---|
db | * |
app | * |
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. |
Handle user session.
Kind: inner method of [JS API: http server
](#module_JS API_ http server)
Returns: function
Param | Type |
---|---|
db | * |
options | * |
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.
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.
Port http server is listening on.
Kind: inner method of [JS API: http server
](#module_JS API_ http server)
Returns: port
Returns the URL of the server.
Kind: inner method of [JS API: http server
](#module_JS API_ http server)
Returns: the server URL
Returns the startup message that needs to be printed out.
Kind: inner method of [JS API: http server
](#module_JS API_ http server)
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)
Returns the socket path for the IPC.
Kind: inner method of [IPC Server API: Inter-process communication
](#module_IPC Server API_ Inter-process communication)
Log IPC message.
Kind: inner method of [IPC Server API: Inter-process communication
](#module_IPC Server API_ Inter-process communication)
Param | Type |
---|---|
msg | * |
Ping IPC server.
Kind: inner method of [IPC Server API: Inter-process communication
](#module_IPC Server API_ Inter-process communication)
Param | Type |
---|---|
context | * |
data | * |
Get IPC server status.
Kind: inner method of [IPC Server API: Inter-process communication
](#module_IPC Server API_ Inter-process communication)
Param | Type |
---|---|
context | * |
Convert zap files.
Kind: inner method of [IPC Server API: Inter-process communication
](#module_IPC Server API_ Inter-process communication)
Param | Type |
---|---|
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 | * |
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 | * |
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 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 | * |
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.
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 | * |
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)
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 | * |
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 | * |
Send websocket payload with the tick category.
Kind: inner method of [JS API: websocket server
](#module_JS API_ websocket server)
Param | Type |
---|---|
socket | * |
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 | * |
Send websocket payload with a given category.
Kind: inner method of [JS API: websocket server
](#module_JS API_ websocket server)
Param | Type |
---|---|
category | * |
payload | * |
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 | * |
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. |
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)
Create the about window in ZAP.
Kind: inner method of [JS API: About page
](#module_JS API_ About page)
Param | Type |
---|---|
parentWindow | * |
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](#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)
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 | * |
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 |
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 | * |
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 | * |
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 | * |
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 | * |
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 |
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 | * |
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.
Main UI
- [JS API: UI](#module_JS API_ UI)
- [~hookSecondInstanceEvents(argv)](#module_JS API_ UI..hookSecondInstanceEvents)
- [~hookMainInstanceEvents()](#module_JS API_ UI..hookMainInstanceEvents)
Hook second instance.
Kind: inner method of [JS API: UI
](#module_JS API_ UI)
Param | Type |
---|---|
argv | * |
Hook up all the events for the electron app object.
Kind: inner method of [JS API: UI
](#module_JS API_ 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)
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
Show the menu.
Kind: inner method of [JS API: Menu for ZAP UI
](#module_JS API_ Menu for ZAP UI)
Param | Type |
---|---|
httpPort | * |
Hide the menu.
Kind: inner method of [JS API: Menu for ZAP UI
](#module_JS API_ Menu for ZAP UI)
Param | Type |
---|---|
httpPort | * |
Toggling of menu
Kind: inner method of [JS API: Menu for ZAP UI
](#module_JS API_ Menu for ZAP UI)
Param | Type |
---|---|
port | * |
Initial menu show.
Kind: inner method of [JS API: Menu for ZAP UI
](#module_JS API_ Menu for ZAP UI)
Param | Type |
---|---|
httpPort | * |
Tray for ZAP UI
Initialize tray.
Kind: inner method of [JS API: Tray for ZAP UI
](#module_JS API_ Tray for ZAP UI)
Returns: none
Param | Type |
---|---|
port | * |
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) ⇒
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 | * |
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 |
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 |
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 |
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' |
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 | * |
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) ⇒
- static
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 | * |
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 | * |
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] | * |
|
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 | * |
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) ⇒
- static
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 | * |
Get environment variable details.
Kind: inner method of [JS API: Arguments for ZAP
](#module_JS API_ Arguments for ZAP)
Returns: environment varibale details
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)
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 | * |
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 | * |
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 | * |
Stop the interval that will check and report dirty flags
Kind: inner method of [JS API: async reporting
](#module_JS API_ async reporting)
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) ⇒
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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. |
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. |
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) ⇒
Set save file format.
Kind: static method of [JS API: Environment utilities
](#module_JS API_ Environment utilities)
Param | Type |
---|---|
n | * |
Get save file format.
Kind: static method of [JS API: Environment utilities
](#module_JS API_ Environment utilities)
Returns: saveFileFormat
Kind: static method of [JS API: Environment utilities
](#module_JS API_ Environment utilities)
Returns: path to zcl.json file
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
Kind: static method of [JS API: Environment utilities
](#module_JS API_ Environment utilities)
Returns: path to general.xml file
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
Get builtin matter ZCL json file
Kind: static method of [JS API: Environment utilities
](#module_JS API_ Environment utilities)
Returns: matter ZCL json file
Get builtin matter ZCL json file
Kind: static method of [JS API: Environment utilities
](#module_JS API_ Environment utilities)
Returns: matter ZCL json file
Get builtin dotdot ZCL json file
Kind: static method of [JS API: Environment utilities
](#module_JS API_ Environment utilities)
Returns: dotdot ZCL json file
Get builtin Matter ZCL json file
Kind: static method of [JS API: Environment utilities
](#module_JS API_ Environment utilities)
Returns: matter ZCL json file
No builtin meta template file.
Kind: static method of [JS API: Environment utilities
](#module_JS API_ Environment utilities)
Returns: null
Set up the devlopment environment.
Kind: static method of [JS API: Environment utilities
](#module_JS API_ Environment utilities)
Set up the production environment.
Kind: static method of [JS API: Environment utilities
](#module_JS API_ Environment utilities)
set explicit_logger_set
Kind: static method of [JS API: Environment utilities
](#module_JS API_ Environment utilities)
Create zap.log file for logging.
Kind: static method of [JS API: Environment utilities
](#module_JS API_ Environment utilities)
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'. |
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
Get path to icons directory.
Kind: static method of [JS API: Environment utilities
](#module_JS API_ Environment utilities)
Returns: path to icons directory
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
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 | * |
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 | * |
Returns a version as a single on-line string.
Kind: static method of [JS API: Environment utilities
](#module_JS API_ Environment utilities)
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 |
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'
Get zapBaseUrl.
Kind: static method of [JS API: Environment utilities
](#module_JS API_ Environment utilities)
Returns: zapBaseUrl
Prints the data to stderr, without much fuss.
Kind: static method of [JS API: Environment utilities
](#module_JS API_ Environment utilities)
Param |
---|
msg |
Base level common logger.
Kind: static method of [JS API: Environment utilities
](#module_JS API_ Environment utilities)
Param | Type |
---|---|
level | * |
msg | * |
err | * |
Info level message.
Kind: static method of [JS API: Environment utilities
](#module_JS API_ Environment utilities)
Param | Type |
---|---|
msg | * |
err | * |
Error level message.
Kind: static method of [JS API: Environment utilities
](#module_JS API_ Environment utilities)
Param | Type |
---|---|
msg | * |
err | * |
Warning level message.
Kind: static method of [JS API: Environment utilities
](#module_JS API_ Environment utilities)
Param | Type |
---|---|
msg | * |
err | * |
Sql level message.
Kind: static method of [JS API: Environment utilities
](#module_JS API_ Environment utilities)
Param | Type |
---|---|
msg | * |
err | * |
Browser level message.
Kind: static method of [JS API: Environment utilities
](#module_JS API_ Environment utilities)
Param | Type |
---|---|
msg | * |
err | * |
IPC level message.
Kind: static method of [JS API: Environment utilities
](#module_JS API_ Environment utilities)
Param | Type |
---|---|
msg | * |
err | * |
Debug level message.
Kind: static method of [JS API: Environment utilities
](#module_JS API_ Environment utilities)
Param | Type |
---|---|
msg | * |
err | * |
Log Warning level message to zap.log file.
Kind: static method of [JS API: Environment utilities
](#module_JS API_ Environment utilities)
Param | Type |
---|---|
msg | * |
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 | * |
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
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 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
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 | * |
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 | * |
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 | * |
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 | * |
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. |
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. |
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 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
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 | * |
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 | * |
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 | * |
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 | * |
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. |
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. |
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 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
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 | * |
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 | * |
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 | * |
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 | * |
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. |
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. |
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. |
This module provides API to access various iterator utilities that can then be used to build iterator helpers.
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)
This module contains the API functions for the post-load scripting functionality.
This module contains the API functions for the post-load scripting functionality.
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](#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)
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 | * |
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 | * |
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 | * |
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 | * |
returns a string after converting ':' and '-' into '_'
Kind: inner method of [JS API: string utilities
](#module_JS API_ string utilities)
Param | Type |
---|---|
label | * |
returns a string after converting ':' and '_' into '-'
Kind: inner method of [JS API: string utilities
](#module_JS API_ string utilities)
Param | Type |
---|---|
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 | * |
Returns true if given character is a digit.
Kind: inner method of [JS API: string utilities
](#module_JS API_ string utilities)
Param | Type |
---|---|
ch | * |
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](#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) ⇒
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 | * |
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] | * |
|
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 | * |
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 | * |
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. |
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 | * |
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 | * |
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 | * |
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. |
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 | * |
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 | * |
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. |
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 | * |
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 | * |
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](#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)
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 |
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 | * |
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 |
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 |
Global way how to get an UUID.
Kind: inner method of [JS API: random utilities
](#module_JS API_ random utilities)
Returns a promise that resolves after time milliseconds
Kind: inner method of [JS API: random utilities
](#module_JS API_ random utilities)
Param |
---|
time |
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 | * |
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 |
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 | * |
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)
Disable test.
Kind: inner method of [JS API: random utilities
](#module_JS API_ random utilities)
Param | Type |
---|---|
testName | * |
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 | * |
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 | * |
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) ⇒
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
Non-exported helper for sortStructsByDependency.
Kind: inner method of [REST API: various zcl utilities
](#module_REST API_ various zcl utilities)
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 | * |
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 | * |
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 |
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 | * |
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 | * |
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 | * |
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. |
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 | * |
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 | * |
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 | * |
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 | * |
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. |
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 | * |
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 | * |
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) ⇒
- static
Start session specific validation.
Kind: static method of [Validation API: Validation APIs
](#module_Validation API_ Validation APIs)
Enforce zigbee specific common cluster initialization.
Kind: inner method of [Validation API: Validation APIs
](#module_Validation API_ Validation APIs)
Returns: object
Param | Type |
---|---|
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 |
Get issues in an endpoint.
Kind: inner method of [Validation API: Validation APIs
](#module_Validation API_ Validation APIs)
Returns: object
Param | Type |
---|---|
db | * |
endpointId | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
Get value of bit integer.
Kind: inner method of [Validation API: Validation APIs
](#module_Validation API_ Validation APIs)
Returns: BigInt
Param | Type |
---|---|
value | * |
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 | * |
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 | * |
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 | * |
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 |
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 |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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) ⇒
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 | * |
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 | * |
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) ⇒
- [~evaluateConformanceExpression(expression, elementMap)](#module_Validation API_ Evaluate conformance expressions..evaluateConformanceExpression) ⇒
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)
helper function to evaluate a single boolean expression
Kind: inner method of [evaluateConformanceExpression
](#module_Validation API_ Evaluate conformance expressions..evaluateConformanceExpression)
Param | Type |
---|---|
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 | * |
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 | * |
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 |
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) ⇒
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 | * |
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 | * |
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) ⇒
- static
Start session specific validation.
Kind: static method of [Validation API: Validation APIs
](#module_Validation API_ Validation APIs)
Enforce zigbee specific common cluster initialization.
Kind: inner method of [Validation API: Validation APIs
](#module_Validation API_ Validation APIs)
Returns: object
Param | Type |
---|---|
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 |
Get issues in an endpoint.
Kind: inner method of [Validation API: Validation APIs
](#module_Validation API_ Validation APIs)
Returns: object
Param | Type |
---|---|
db | * |
endpointId | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
Get value of bit integer.
Kind: inner method of [Validation API: Validation APIs
](#module_Validation API_ Validation APIs)
Returns: BigInt
Param | Type |
---|---|
value | * |
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 | * |
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 | * |
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 | * |
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 |
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 |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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) ⇒
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 |
Check if tag contains enum.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: boolean
Param | Type |
---|---|
tag | * |
Check if tag contains struct.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: boolean
Param | Type |
---|---|
tag | * |
Check if tag contains Bitmap.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: boolean
Param | Type |
---|---|
tag | * |
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 | * |
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 | * |
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 |
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 |
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" |
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. |
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 |
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 |
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 |
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 |
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 |
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 |
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 | * |
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... |
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) |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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. |
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 | * |
Prepare features from xml.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: feature information
Param | Type |
---|---|
f | * |
Prepare attributes from xml.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: attribute information
Param | Type |
---|---|
a | * |
Prepare commands from xml.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: command information
Param | Type |
---|---|
c | * |
Prepare events from xml
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: event information
Param | Type |
---|---|
e | * |
Parse xml file.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: xml information from file
Param | Type |
---|---|
f | * |
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 |
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 |
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 | * |
Prepare atomic to db insertion.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Param | Type |
---|---|
a | * |
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 | * |
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 | * |
Extract access information
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: access tag information
Param | Type |
---|---|
ac | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
Prepare tag object from tag
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: tag information
Param | Type |
---|---|
tag | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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. |
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. |
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.
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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. |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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. |
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 | * |
Records the version into the database.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Param | Type |
---|---|
db | * |
ctx | * |
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 | * |
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 |
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 | * |
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. |
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 | * |
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 | * |
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: data type discriminator map
Param | Type |
---|---|
db | * |
packageIds | * |
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) ⇒
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 |
Check if tag contains enum.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: boolean
Param | Type |
---|---|
tag | * |
Check if tag contains struct.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: boolean
Param | Type |
---|---|
tag | * |
Check if tag contains Bitmap.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: boolean
Param | Type |
---|---|
tag | * |
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 | * |
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 | * |
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 |
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 |
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" |
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. |
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 |
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 |
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 |
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 |
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 |
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 |
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 | * |
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... |
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) |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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. |
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 | * |
Prepare features from xml.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: feature information
Param | Type |
---|---|
f | * |
Prepare attributes from xml.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: attribute information
Param | Type |
---|---|
a | * |
Prepare commands from xml.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: command information
Param | Type |
---|---|
c | * |
Prepare events from xml
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: event information
Param | Type |
---|---|
e | * |
Parse xml file.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: xml information from file
Param | Type |
---|---|
f | * |
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 |
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 |
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 | * |
Prepare atomic to db insertion.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Param | Type |
---|---|
a | * |
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 | * |
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 | * |
Extract access information
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: access tag information
Param | Type |
---|---|
ac | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
Prepare tag object from tag
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: tag information
Param | Type |
---|---|
tag | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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. |
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. |
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.
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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. |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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. |
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 | * |
Records the version into the database.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Param | Type |
---|---|
db | * |
ctx | * |
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 | * |
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 |
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 | * |
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. |
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 | * |
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 | * |
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: data type discriminator map
Param | Type |
---|---|
db | * |
packageIds | * |
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) ⇒
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 |
Check if tag contains enum.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: boolean
Param | Type |
---|---|
tag | * |
Check if tag contains struct.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: boolean
Param | Type |
---|---|
tag | * |
Check if tag contains Bitmap.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: boolean
Param | Type |
---|---|
tag | * |
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 | * |
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 | * |
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 |
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 |
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" |
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. |
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 |
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 |
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 |
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 |
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 |
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 |
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 | * |
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... |
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) |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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. |
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 | * |
Prepare features from xml.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: feature information
Param | Type |
---|---|
f | * |
Prepare attributes from xml.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: attribute information
Param | Type |
---|---|
a | * |
Prepare commands from xml.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: command information
Param | Type |
---|---|
c | * |
Prepare events from xml
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: event information
Param | Type |
---|---|
e | * |
Parse xml file.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: xml information from file
Param | Type |
---|---|
f | * |
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 |
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 |
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 | * |
Prepare atomic to db insertion.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Param | Type |
---|---|
a | * |
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 | * |
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 | * |
Extract access information
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: access tag information
Param | Type |
---|---|
ac | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
Prepare tag object from tag
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: tag information
Param | Type |
---|---|
tag | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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. |
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. |
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.
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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. |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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. |
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 | * |
Records the version into the database.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Param | Type |
---|---|
db | * |
ctx | * |
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 | * |
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 |
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 | * |
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. |
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 | * |
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 | * |
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: data type discriminator map
Param | Type |
---|---|
db | * |
packageIds | * |
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) ⇒
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 |
Check if tag contains enum.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: boolean
Param | Type |
---|---|
tag | * |
Check if tag contains struct.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: boolean
Param | Type |
---|---|
tag | * |
Check if tag contains Bitmap.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: boolean
Param | Type |
---|---|
tag | * |
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 | * |
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 | * |
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 |
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 |
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" |
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. |
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 |
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 |
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 |
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 |
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 |
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 |
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 | * |
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... |
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) |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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. |
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 | * |
Prepare features from xml.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: feature information
Param | Type |
---|---|
f | * |
Prepare attributes from xml.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: attribute information
Param | Type |
---|---|
a | * |
Prepare commands from xml.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: command information
Param | Type |
---|---|
c | * |
Prepare events from xml
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: event information
Param | Type |
---|---|
e | * |
Parse xml file.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: xml information from file
Param | Type |
---|---|
f | * |
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 |
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 |
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 | * |
Prepare atomic to db insertion.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Param | Type |
---|---|
a | * |
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 | * |
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 | * |
Extract access information
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: access tag information
Param | Type |
---|---|
ac | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
Prepare tag object from tag
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: tag information
Param | Type |
---|---|
tag | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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. |
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. |
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.
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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. |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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 | * |
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. |
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 | * |
Records the version into the database.
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Param | Type |
---|---|
db | * |
ctx | * |
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 | * |
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 |
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 | * |
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. |
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 | * |
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 | * |
Kind: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
Returns: data type discriminator map
Param | Type |
---|---|
db | * |
packageIds | * |