This module provides common external URLs.
This module provides mappings between database columns and JS keys.
This module provides generic DB functions for performing SQL queries.
Returns a promise to begin a transaction. The beginning of the transaction will be delayed for up to 5 seconds, checking every 1/10th of a second of previous transaction is already finished.
After 5 seconds, the code gives up and rejects the promise.
This is to allow simultaneous calls to this function, even though SQLite does not allow for simultaneous transactions.
So use transactions responsibly.
Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: A promise that resolves without an argument and rejects with an error from BEGIN TRANSACTION query.
| Param | Type |
|---|---|
| db | * |
Returns a promise to execute a commit.
Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: A promise that resolves without an argument or rejects with an error from COMMIT query.
| 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS API low level database access)
Returns: A promise that resolves with a number of changed rows, or rejects with an error from the query.
| Param | Type |
|---|---|
| db | * |
| query | * |
| args | * |
Returns a promise to execute an insert query.
Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: A promise that resolves with the rowid from the inserted row, or rejects with an error from the query.
| 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](#moduleJS API low level database access)
Returns: A promise that resolves with the rows that got retrieved from the database, or rejects with an error from the query.
| 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](#moduleJS API low level database access)
Returns: A promise that resolves with a single row that got retrieved from the database, or rejects with an error from the query.
| 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](#moduleJS 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](#moduleJS API low level database access)
Returns: A promise that resolves with the array of rowids for the rows that got inserted, or rejects with an error from the query.
| 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](#moduleJS 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](#moduleJS API low level database access)
| Param | Type |
|---|---|
| database | * |
Create in-memory database.
Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: Promise that resolve with the Db.
Returns a promise to initialize a database.
Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: A promise that resolves with the database object that got created, or rejects with an error if something went wrong.
| 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](#moduleJS API low level database access)
Returns: A promise that resolves with a rowid of created setting row or rejects with error if something goes wrong.
| Param | Type |
|---|---|
| db | * |
| version | * |
Updates SETTING table with values selected
Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: A promise that resolves with the SETTING table being repopulated
| Param | Type |
|---|---|
| db | * |
| rows | * |
Returns a promise resolving the entire SETTING table
Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: A promise resolving the entire SETTING table
| Param | Type |
|---|---|
| db | * |
Returns a promise to load schema into a blank database, and inserts a version to the settings table.j
Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: A promise that resolves with the same db that got passed in, or rejects with an error.
| Param | Type |
|---|---|
| db | * |
| schemaPath | * |
| zapVersion | * |
Init database and load the schema.
Kind: inner method of [JS API: low level database access](#moduleJS API low level database access)
Returns: Promise that resolves into the database object.
| 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](#moduleJS 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](#moduleJS 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](#moduleJS 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.
Clears the entire cache.
Kind: inner method of [DB API: zcl database access](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB API zcl database access)
Enable the Database Query cache
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Disable the database cache
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Locates atomic type based on a type name. Query is not case sensitive.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| typeName | * |
Retrieves atomic type by a given Id.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
| Param | Type |
|---|---|
| db | * |
| packageId | * |
Retrieves all the bitmaps in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of bitmaps.
| Param | Type |
|---|---|
| db | * |
Select a bitmap matched by name and clusterId.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: bitmap information or undefined
| Param | Type |
|---|---|
| db | * |
| name | * |
| clusterId | * |
| packageIds | * |
Retrieves all the enums in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of enums.
| Param | Type |
|---|---|
| db | * |
| packageId | * |
Retrieves all the enums with cluster references in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of enums.
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| clusterId | * |
Returns an enum by ID.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: enum
| Param | Type |
|---|---|
| db | * |
| id | * |
Select all enum items in a package.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: list of enum items
| Param | Type |
|---|---|
| db | * |
| packageId | * |
Select an enum matched by its primary key.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: an enum or underfined if not found
| Param | Type |
|---|---|
| db | * |
| id | * |
Select an enum matched by name.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database 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 access](#moduleDB API zcl database access)
Returns: enum information or undefined
| Param | Type |
|---|---|
| db | * |
| name | * |
| clusterId | * |
| packageIds | * |
Returns the cluster available to this session by the code.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: all the cluster objects for a given session.
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Returns all the clusters visible for a given session.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: all the cluster objects for a given session.
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Returns the attribute available to this session by the code.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the session attribute
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Returns the command available to this session by the code.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the session attribute
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Select a struct matched by name and clusterId
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: struct information or undefined
| Param | Type |
|---|---|
| db | * |
| name | * |
| clusterId | * |
| packageIds | * |
Get all structs which have a cluster associated with them. If a struct is present in more than one cluster then it can be grouped by struct name to avoid additional rows.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: structs which have an association with clusters
| Param | Type |
|---|---|
| db | * |
| packageIds | * |
| groupByStructName | * |
Retrieves all the bitmaps that are associated with a cluster.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cluster-related bitmaps
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| clusterId | * |
Retrieves all the domains in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of domains.
| Param | Type |
|---|---|
| db | * |
Retrieves all the structs in the database, including the count of items.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs.
| Param | Type |
|---|---|
| db | * |
| packageIds | * |
Returns an array of clusters that struct belongs to.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters
| Param | Type |
|---|---|
| db | * |
| structId | * |
Returns an array of clusters that enum belongs to.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters
| Param | Type |
|---|---|
| db | * |
| enumId | * |
Returns an array of clusters that enum belongs to.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters
| Param | Type |
|---|---|
| db | * |
| enumId | * |
Retrieves all the cluster-related structs in the database with the items.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.
| Param | Type |
|---|---|
| db | * |
Retrieves all the structs in the database with the items.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.
| Param | Type |
|---|---|
| db | * |
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the details of the struct items given the name of the struct
| Param |
|---|
| db |
| name |
Retrieves all the clusters in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of clusters.
| Param | Type |
|---|---|
| db | * |
Finds cluster by code.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cluster by code in a single package id.
| 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](#moduleDB 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](#moduleDB API zcl database access)
Returns: promise of a list of attributes, including global attributes
| Param | Type |
|---|---|
| db | * |
| clusterId | * |
| packageIds | * |
Queries for attributes inside a cluster.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into attributes.
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| clusterCode | * |
| manufacturerCode | * |
This async function should be used when you want to get attributes, while also resolving against any global data that may be overridden by a particular cluster.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
| Param | Type |
|---|---|
| db | * |
| attributeId | * |
| clusterRef | * |
Query for attributes by side.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into attributes.
| Param | Type |
|---|---|
| db | * |
| side | * |
| packageId | * |
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.
Clears the entire cache.
Kind: inner method of [DB API: zcl database access](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB API zcl database access)
Enable the Database Query cache
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Disable the database cache
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Locates atomic type based on a type name. Query is not case sensitive.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| typeName | * |
Retrieves atomic type by a given Id.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
| Param | Type |
|---|---|
| db | * |
| packageId | * |
Retrieves all the bitmaps in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of bitmaps.
| Param | Type |
|---|---|
| db | * |
Select a bitmap matched by name and clusterId.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: bitmap information or undefined
| Param | Type |
|---|---|
| db | * |
| name | * |
| clusterId | * |
| packageIds | * |
Retrieves all the enums in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of enums.
| Param | Type |
|---|---|
| db | * |
| packageId | * |
Retrieves all the enums with cluster references in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of enums.
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| clusterId | * |
Returns an enum by ID.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: enum
| Param | Type |
|---|---|
| db | * |
| id | * |
Select all enum items in a package.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: list of enum items
| Param | Type |
|---|---|
| db | * |
| packageId | * |
Select an enum matched by its primary key.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: an enum or underfined if not found
| Param | Type |
|---|---|
| db | * |
| id | * |
Select an enum matched by name.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database 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 access](#moduleDB API zcl database access)
Returns: enum information or undefined
| Param | Type |
|---|---|
| db | * |
| name | * |
| clusterId | * |
| packageIds | * |
Returns the cluster available to this session by the code.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: all the cluster objects for a given session.
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Returns all the clusters visible for a given session.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: all the cluster objects for a given session.
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Returns the attribute available to this session by the code.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the session attribute
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Returns the command available to this session by the code.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the session attribute
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Select a struct matched by name and clusterId
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: struct information or undefined
| Param | Type |
|---|---|
| db | * |
| name | * |
| clusterId | * |
| packageIds | * |
Get all structs which have a cluster associated with them. If a struct is present in more than one cluster then it can be grouped by struct name to avoid additional rows.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: structs which have an association with clusters
| Param | Type |
|---|---|
| db | * |
| packageIds | * |
| groupByStructName | * |
Retrieves all the bitmaps that are associated with a cluster.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cluster-related bitmaps
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| clusterId | * |
Retrieves all the domains in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of domains.
| Param | Type |
|---|---|
| db | * |
Retrieves all the structs in the database, including the count of items.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs.
| Param | Type |
|---|---|
| db | * |
| packageIds | * |
Returns an array of clusters that struct belongs to.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters
| Param | Type |
|---|---|
| db | * |
| structId | * |
Returns an array of clusters that enum belongs to.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters
| Param | Type |
|---|---|
| db | * |
| enumId | * |
Returns an array of clusters that enum belongs to.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters
| Param | Type |
|---|---|
| db | * |
| enumId | * |
Retrieves all the cluster-related structs in the database with the items.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.
| Param | Type |
|---|---|
| db | * |
Retrieves all the structs in the database with the items.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.
| Param | Type |
|---|---|
| db | * |
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the details of the struct items given the name of the struct
| Param |
|---|
| db |
| name |
Retrieves all the clusters in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of clusters.
| Param | Type |
|---|---|
| db | * |
Finds cluster by code.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cluster by code in a single package id.
| 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](#moduleDB 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](#moduleDB API zcl database access)
Returns: promise of a list of attributes, including global attributes
| Param | Type |
|---|---|
| db | * |
| clusterId | * |
| packageIds | * |
Queries for attributes inside a cluster.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into attributes.
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| clusterCode | * |
| manufacturerCode | * |
This async function should be used when you want to get attributes, while also resolving against any global data that may be overridden by a particular cluster.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
| Param | Type |
|---|---|
| db | * |
| attributeId | * |
| clusterRef | * |
Query for attributes by side.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into attributes.
| Param | Type |
|---|---|
| db | * |
| side | * |
| packageId | * |
This module provides queries related to attributes.
This module provides queries for enums.
Clears the entire cache.
Kind: inner method of [DB API: zcl database access](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB API zcl database access)
Enable the Database Query cache
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Disable the database cache
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Locates atomic type based on a type name. Query is not case sensitive.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| typeName | * |
Retrieves atomic type by a given Id.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
| Param | Type |
|---|---|
| db | * |
| packageId | * |
Retrieves all the bitmaps in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of bitmaps.
| Param | Type |
|---|---|
| db | * |
Select a bitmap matched by name and clusterId.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: bitmap information or undefined
| Param | Type |
|---|---|
| db | * |
| name | * |
| clusterId | * |
| packageIds | * |
Retrieves all the enums in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of enums.
| Param | Type |
|---|---|
| db | * |
| packageId | * |
Retrieves all the enums with cluster references in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of enums.
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| clusterId | * |
Returns an enum by ID.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: enum
| Param | Type |
|---|---|
| db | * |
| id | * |
Select all enum items in a package.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: list of enum items
| Param | Type |
|---|---|
| db | * |
| packageId | * |
Select an enum matched by its primary key.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: an enum or underfined if not found
| Param | Type |
|---|---|
| db | * |
| id | * |
Select an enum matched by name.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database 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 access](#moduleDB API zcl database access)
Returns: enum information or undefined
| Param | Type |
|---|---|
| db | * |
| name | * |
| clusterId | * |
| packageIds | * |
Returns the cluster available to this session by the code.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: all the cluster objects for a given session.
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Returns all the clusters visible for a given session.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: all the cluster objects for a given session.
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Returns the attribute available to this session by the code.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the session attribute
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Returns the command available to this session by the code.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the session attribute
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Select a struct matched by name and clusterId
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: struct information or undefined
| Param | Type |
|---|---|
| db | * |
| name | * |
| clusterId | * |
| packageIds | * |
Get all structs which have a cluster associated with them. If a struct is present in more than one cluster then it can be grouped by struct name to avoid additional rows.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: structs which have an association with clusters
| Param | Type |
|---|---|
| db | * |
| packageIds | * |
| groupByStructName | * |
Retrieves all the bitmaps that are associated with a cluster.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cluster-related bitmaps
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| clusterId | * |
Retrieves all the domains in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of domains.
| Param | Type |
|---|---|
| db | * |
Retrieves all the structs in the database, including the count of items.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs.
| Param | Type |
|---|---|
| db | * |
| packageIds | * |
Returns an array of clusters that struct belongs to.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters
| Param | Type |
|---|---|
| db | * |
| structId | * |
Returns an array of clusters that enum belongs to.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters
| Param | Type |
|---|---|
| db | * |
| enumId | * |
Returns an array of clusters that enum belongs to.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters
| Param | Type |
|---|---|
| db | * |
| enumId | * |
Retrieves all the cluster-related structs in the database with the items.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.
| Param | Type |
|---|---|
| db | * |
Retrieves all the structs in the database with the items.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.
| Param | Type |
|---|---|
| db | * |
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the details of the struct items given the name of the struct
| Param |
|---|
| db |
| name |
Retrieves all the clusters in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of clusters.
| Param | Type |
|---|---|
| db | * |
Finds cluster by code.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cluster by code in a single package id.
| 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](#moduleDB 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](#moduleDB API zcl database access)
Returns: promise of a list of attributes, including global attributes
| Param | Type |
|---|---|
| db | * |
| clusterId | * |
| packageIds | * |
Queries for attributes inside a cluster.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into attributes.
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| clusterCode | * |
| manufacturerCode | * |
This async function should be used when you want to get attributes, while also resolving against any global data that may be overridden by a particular cluster.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
| Param | Type |
|---|---|
| db | * |
| attributeId | * |
| clusterRef | * |
Query for attributes by side.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into attributes.
| Param | Type |
|---|---|
| db | * |
| side | * |
| packageId | * |
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 device types.
Retrieves all the device types in the database.
Kind: inner method of [DB API: device type database access](#moduleDB API device type database access)
Returns: Promise that resolves with the rows of device types.
| Param | Type |
|---|---|
| db | * |
Retrieves the device type by its id.
Kind: inner method of [DB API: device type database access](#moduleDB API device type database access)
Returns: Device type
| Param | Type |
|---|---|
| db | * |
| id | * |
Retrieves the device type by the package, code and name.
Kind: inner method of [DB API: device type database access](#moduleDB API device type database access)
Returns: Device type
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| code | * |
| name | * |
After loading up device type cluster table with the names, this method links the refererence to actual cluster reference.
Kind: inner method of [DB API: device type database access](#moduleDB API device type database access)
Returns: promise of completion
| Param | Type |
|---|---|
| db | * |
After loading up device type attribute table with the names, this method links the refererence to actual attribute reference.
Kind: inner method of [DB API: device type database access](#moduleDB API device type database access)
Returns: promise of completion
| Param | Type |
|---|---|
| db | * |
After loading up device type command table with the names, this method links the refererence to actual command reference.
Kind: inner method of [DB API: device type database access](#moduleDB API device type database access)
Returns: promise of completion
| Param | Type |
|---|---|
| db | * |
This method returns the promise of linking the device type clusters commands and attributes to the correct IDs in the cluster, attribute and command tables.
Initial load only populates the names, so once everything is loaded, we have to link the foreign keys.
Kind: inner method of [DB API: device type database access](#moduleDB API device type database access)
Returns: promise of completed linking
| Param | Type |
|---|---|
| db | * |
This module provides queries for endpoint type.
This module provides queries for endpoint configuration.
This module provides queries for enums.
Clears the entire cache.
Kind: inner method of [DB API: zcl database access](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB API zcl database access)
Enable the Database Query cache
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Disable the database cache
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Locates atomic type based on a type name. Query is not case sensitive.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| typeName | * |
Retrieves atomic type by a given Id.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
| Param | Type |
|---|---|
| db | * |
| packageId | * |
Retrieves all the bitmaps in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of bitmaps.
| Param | Type |
|---|---|
| db | * |
Select a bitmap matched by name and clusterId.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: bitmap information or undefined
| Param | Type |
|---|---|
| db | * |
| name | * |
| clusterId | * |
| packageIds | * |
Retrieves all the enums in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of enums.
| Param | Type |
|---|---|
| db | * |
| packageId | * |
Retrieves all the enums with cluster references in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of enums.
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| clusterId | * |
Returns an enum by ID.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: enum
| Param | Type |
|---|---|
| db | * |
| id | * |
Select all enum items in a package.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: list of enum items
| Param | Type |
|---|---|
| db | * |
| packageId | * |
Select an enum matched by its primary key.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: an enum or underfined if not found
| Param | Type |
|---|---|
| db | * |
| id | * |
Select an enum matched by name.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database 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 access](#moduleDB API zcl database access)
Returns: enum information or undefined
| Param | Type |
|---|---|
| db | * |
| name | * |
| clusterId | * |
| packageIds | * |
Returns the cluster available to this session by the code.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: all the cluster objects for a given session.
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Returns all the clusters visible for a given session.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: all the cluster objects for a given session.
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Returns the attribute available to this session by the code.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the session attribute
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Returns the command available to this session by the code.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the session attribute
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Select a struct matched by name and clusterId
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: struct information or undefined
| Param | Type |
|---|---|
| db | * |
| name | * |
| clusterId | * |
| packageIds | * |
Get all structs which have a cluster associated with them. If a struct is present in more than one cluster then it can be grouped by struct name to avoid additional rows.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: structs which have an association with clusters
| Param | Type |
|---|---|
| db | * |
| packageIds | * |
| groupByStructName | * |
Retrieves all the bitmaps that are associated with a cluster.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cluster-related bitmaps
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| clusterId | * |
Retrieves all the domains in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of domains.
| Param | Type |
|---|---|
| db | * |
Retrieves all the structs in the database, including the count of items.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs.
| Param | Type |
|---|---|
| db | * |
| packageIds | * |
Returns an array of clusters that struct belongs to.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters
| Param | Type |
|---|---|
| db | * |
| structId | * |
Returns an array of clusters that enum belongs to.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters
| Param | Type |
|---|---|
| db | * |
| enumId | * |
Returns an array of clusters that enum belongs to.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters
| Param | Type |
|---|---|
| db | * |
| enumId | * |
Retrieves all the cluster-related structs in the database with the items.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.
| Param | Type |
|---|---|
| db | * |
Retrieves all the structs in the database with the items.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.
| Param | Type |
|---|---|
| db | * |
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the details of the struct items given the name of the struct
| Param |
|---|
| db |
| name |
Retrieves all the clusters in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of clusters.
| Param | Type |
|---|---|
| db | * |
Finds cluster by code.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cluster by code in a single package id.
| 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](#moduleDB 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](#moduleDB API zcl database access)
Returns: promise of a list of attributes, including global attributes
| Param | Type |
|---|---|
| db | * |
| clusterId | * |
| packageIds | * |
Queries for attributes inside a cluster.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into attributes.
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| clusterCode | * |
| manufacturerCode | * |
This async function should be used when you want to get attributes, while also resolving against any global data that may be overridden by a particular cluster.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
| Param | Type |
|---|---|
| db | * |
| attributeId | * |
| clusterRef | * |
Query for attributes by side.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into attributes.
| Param | Type |
|---|---|
| db | * |
| side | * |
| packageId | * |
This module provides queries related to events.
This module provides queries related to imports and exports of files.
This module provides queries for ZCL loading
Inserts globals into the database.
Kind: inner method of [DB API: zcl loading queries](#moduleDB 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](#moduleDB 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](#moduleDB 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 tags into the database. data is an array of objects, containing ‘name’ and ‘description’
Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)
Returns: A promise that resolves with array of rowids.
| 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](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB API zcl loading queries)
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| data | * |
Inserts device types into the database.
Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)
Returns: Promise of an insertion of device types.
| Param | Type | Description |
|---|---|---|
| db | * | |
| packageId | * | |
| data | * | an array of objects that must contain: domain, code, profileId, name, description |
This handles the loading of device type attribute requirements into the database. There is a need to post-process to attach the actual attribute ref after the fact
Kind: inner method of [DB API: zcl loading queries](#moduleDB API zcl loading queries)
| 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](#moduleDB API zcl loading queries)
| Param | Type |
|---|---|
| db | * |
| dtClusterRefDataPairs | * |
Kind: inner method of [DB API: zcl loading queries](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB API zcl loading queries)
| Param | Type |
|---|---|
| db | * |
| packageIds | * |
| data | * |
This module provides notification related queries.
This module provides queries related to packages.
This module provides queries for ZCL static entities inside a single session. Things like: all visible clusters, etc.
Clears the entire cache.
Kind: inner method of [DB API: zcl database access](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB API zcl database access)
Enable the Database Query cache
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Disable the database cache
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Locates atomic type based on a type name. Query is not case sensitive.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| typeName | * |
Retrieves atomic type by a given Id.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
| Param | Type |
|---|---|
| db | * |
| packageId | * |
Retrieves all the bitmaps in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of bitmaps.
| Param | Type |
|---|---|
| db | * |
Select a bitmap matched by name and clusterId.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: bitmap information or undefined
| Param | Type |
|---|---|
| db | * |
| name | * |
| clusterId | * |
| packageIds | * |
Retrieves all the enums in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of enums.
| Param | Type |
|---|---|
| db | * |
| packageId | * |
Retrieves all the enums with cluster references in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of enums.
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| clusterId | * |
Returns an enum by ID.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: enum
| Param | Type |
|---|---|
| db | * |
| id | * |
Select all enum items in a package.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: list of enum items
| Param | Type |
|---|---|
| db | * |
| packageId | * |
Select an enum matched by its primary key.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: an enum or underfined if not found
| Param | Type |
|---|---|
| db | * |
| id | * |
Select an enum matched by name.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database 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 access](#moduleDB API zcl database access)
Returns: enum information or undefined
| Param | Type |
|---|---|
| db | * |
| name | * |
| clusterId | * |
| packageIds | * |
Returns the cluster available to this session by the code.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: all the cluster objects for a given session.
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Returns all the clusters visible for a given session.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: all the cluster objects for a given session.
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Returns the attribute available to this session by the code.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the session attribute
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Returns the command available to this session by the code.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the session attribute
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Select a struct matched by name and clusterId
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: struct information or undefined
| Param | Type |
|---|---|
| db | * |
| name | * |
| clusterId | * |
| packageIds | * |
Get all structs which have a cluster associated with them. If a struct is present in more than one cluster then it can be grouped by struct name to avoid additional rows.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: structs which have an association with clusters
| Param | Type |
|---|---|
| db | * |
| packageIds | * |
| groupByStructName | * |
Retrieves all the bitmaps that are associated with a cluster.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cluster-related bitmaps
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| clusterId | * |
Retrieves all the domains in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of domains.
| Param | Type |
|---|---|
| db | * |
Retrieves all the structs in the database, including the count of items.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs.
| Param | Type |
|---|---|
| db | * |
| packageIds | * |
Returns an array of clusters that struct belongs to.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters
| Param | Type |
|---|---|
| db | * |
| structId | * |
Returns an array of clusters that enum belongs to.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters
| Param | Type |
|---|---|
| db | * |
| enumId | * |
Returns an array of clusters that enum belongs to.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters
| Param | Type |
|---|---|
| db | * |
| enumId | * |
Retrieves all the cluster-related structs in the database with the items.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.
| Param | Type |
|---|---|
| db | * |
Retrieves all the structs in the database with the items.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.
| Param | Type |
|---|---|
| db | * |
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the details of the struct items given the name of the struct
| Param |
|---|
| db |
| name |
Retrieves all the clusters in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of clusters.
| Param | Type |
|---|---|
| db | * |
Finds cluster by code.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cluster by code in a single package id.
| 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](#moduleDB 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](#moduleDB API zcl database access)
Returns: promise of a list of attributes, including global attributes
| Param | Type |
|---|---|
| db | * |
| clusterId | * |
| packageIds | * |
Queries for attributes inside a cluster.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into attributes.
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| clusterCode | * |
| manufacturerCode | * |
This async function should be used when you want to get attributes, while also resolving against any global data that may be overridden by a particular cluster.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
| Param | Type |
|---|---|
| db | * |
| attributeId | * |
| clusterRef | * |
Query for attributes by side.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into attributes.
| Param | Type |
|---|---|
| db | * |
| side | * |
| packageId | * |
This module provides session related queries.
This module provides queries for enums.
Clears the entire cache.
Kind: inner method of [DB API: zcl database access](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB API zcl database access)
Enable the Database Query cache
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Disable the database cache
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Locates atomic type based on a type name. Query is not case sensitive.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| typeName | * |
Retrieves atomic type by a given Id.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
| Param | Type |
|---|---|
| db | * |
| packageId | * |
Retrieves all the bitmaps in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of bitmaps.
| Param | Type |
|---|---|
| db | * |
Select a bitmap matched by name and clusterId.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: bitmap information or undefined
| Param | Type |
|---|---|
| db | * |
| name | * |
| clusterId | * |
| packageIds | * |
Retrieves all the enums in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of enums.
| Param | Type |
|---|---|
| db | * |
| packageId | * |
Retrieves all the enums with cluster references in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of enums.
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| clusterId | * |
Returns an enum by ID.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: enum
| Param | Type |
|---|---|
| db | * |
| id | * |
Select all enum items in a package.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: list of enum items
| Param | Type |
|---|---|
| db | * |
| packageId | * |
Select an enum matched by its primary key.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: an enum or underfined if not found
| Param | Type |
|---|---|
| db | * |
| id | * |
Select an enum matched by name.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database 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 access](#moduleDB API zcl database access)
Returns: enum information or undefined
| Param | Type |
|---|---|
| db | * |
| name | * |
| clusterId | * |
| packageIds | * |
Returns the cluster available to this session by the code.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: all the cluster objects for a given session.
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Returns all the clusters visible for a given session.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: all the cluster objects for a given session.
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Returns the attribute available to this session by the code.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the session attribute
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Returns the command available to this session by the code.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the session attribute
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Select a struct matched by name and clusterId
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: struct information or undefined
| Param | Type |
|---|---|
| db | * |
| name | * |
| clusterId | * |
| packageIds | * |
Get all structs which have a cluster associated with them. If a struct is present in more than one cluster then it can be grouped by struct name to avoid additional rows.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: structs which have an association with clusters
| Param | Type |
|---|---|
| db | * |
| packageIds | * |
| groupByStructName | * |
Retrieves all the bitmaps that are associated with a cluster.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cluster-related bitmaps
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| clusterId | * |
Retrieves all the domains in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of domains.
| Param | Type |
|---|---|
| db | * |
Retrieves all the structs in the database, including the count of items.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs.
| Param | Type |
|---|---|
| db | * |
| packageIds | * |
Returns an array of clusters that struct belongs to.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters
| Param | Type |
|---|---|
| db | * |
| structId | * |
Returns an array of clusters that enum belongs to.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters
| Param | Type |
|---|---|
| db | * |
| enumId | * |
Returns an array of clusters that enum belongs to.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters
| Param | Type |
|---|---|
| db | * |
| enumId | * |
Retrieves all the cluster-related structs in the database with the items.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.
| Param | Type |
|---|---|
| db | * |
Retrieves all the structs in the database with the items.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.
| Param | Type |
|---|---|
| db | * |
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the details of the struct items given the name of the struct
| Param |
|---|
| db |
| name |
Retrieves all the clusters in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of clusters.
| Param | Type |
|---|---|
| db | * |
Finds cluster by code.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cluster by code in a single package id.
| 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](#moduleDB 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](#moduleDB API zcl database access)
Returns: promise of a list of attributes, including global attributes
| Param | Type |
|---|---|
| db | * |
| clusterId | * |
| packageIds | * |
Queries for attributes inside a cluster.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into attributes.
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| clusterCode | * |
| manufacturerCode | * |
This async function should be used when you want to get attributes, while also resolving against any global data that may be overridden by a particular cluster.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
| Param | Type |
|---|---|
| db | * |
| attributeId | * |
| clusterRef | * |
Query for attributes by side.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into attributes.
| Param | Type |
|---|---|
| db | * |
| side | * |
| packageId | * |
This module provides queries for ZCL static queries.
Clears the entire cache.
Kind: inner method of [DB API: zcl database access](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB 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](#moduleDB API zcl database access)
Enable the Database Query cache
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Disable the database cache
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Locates atomic type based on a type name. Query is not case sensitive.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| typeName | * |
Retrieves atomic type by a given Id.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
| Param | Type |
|---|---|
| db | * |
| packageId | * |
Retrieves all the bitmaps in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of bitmaps.
| Param | Type |
|---|---|
| db | * |
Select a bitmap matched by name and clusterId.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: bitmap information or undefined
| Param | Type |
|---|---|
| db | * |
| name | * |
| clusterId | * |
| packageIds | * |
Retrieves all the enums in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of enums.
| Param | Type |
|---|---|
| db | * |
| packageId | * |
Retrieves all the enums with cluster references in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of enums.
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| clusterId | * |
Returns an enum by ID.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: enum
| Param | Type |
|---|---|
| db | * |
| id | * |
Select all enum items in a package.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: list of enum items
| Param | Type |
|---|---|
| db | * |
| packageId | * |
Select an enum matched by its primary key.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: an enum or underfined if not found
| Param | Type |
|---|---|
| db | * |
| id | * |
Select an enum matched by name.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database 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 access](#moduleDB API zcl database access)
Returns: enum information or undefined
| Param | Type |
|---|---|
| db | * |
| name | * |
| clusterId | * |
| packageIds | * |
Returns the cluster available to this session by the code.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: all the cluster objects for a given session.
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Returns all the clusters visible for a given session.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: all the cluster objects for a given session.
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Returns the attribute available to this session by the code.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the session attribute
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Returns the command available to this session by the code.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the session attribute
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Select a struct matched by name and clusterId
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: struct information or undefined
| Param | Type |
|---|---|
| db | * |
| name | * |
| clusterId | * |
| packageIds | * |
Get all structs which have a cluster associated with them. If a struct is present in more than one cluster then it can be grouped by struct name to avoid additional rows.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: structs which have an association with clusters
| Param | Type |
|---|---|
| db | * |
| packageIds | * |
| groupByStructName | * |
Retrieves all the bitmaps that are associated with a cluster.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cluster-related bitmaps
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| clusterId | * |
Retrieves all the domains in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of domains.
| Param | Type |
|---|---|
| db | * |
Retrieves all the structs in the database, including the count of items.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs.
| Param | Type |
|---|---|
| db | * |
| packageIds | * |
Returns an array of clusters that struct belongs to.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters
| Param | Type |
|---|---|
| db | * |
| structId | * |
Returns an array of clusters that enum belongs to.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters
| Param | Type |
|---|---|
| db | * |
| enumId | * |
Returns an array of clusters that enum belongs to.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: clusters
| Param | Type |
|---|---|
| db | * |
| enumId | * |
Retrieves all the cluster-related structs in the database with the items.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.
| Param | Type |
|---|---|
| db | * |
Retrieves all the structs in the database with the items.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of structs, each one containing items field with rows of items.
| Param | Type |
|---|---|
| db | * |
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: the details of the struct items given the name of the struct
| Param |
|---|
| db |
| name |
Retrieves all the clusters in the database.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: Promise that resolves with the rows of clusters.
| Param | Type |
|---|---|
| db | * |
Finds cluster by code.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: cluster by code in a single package id.
| 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](#moduleDB 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](#moduleDB API zcl database access)
Returns: promise of a list of attributes, including global attributes
| Param | Type |
|---|---|
| db | * |
| clusterId | * |
| packageIds | * |
Queries for attributes inside a cluster.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into attributes.
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| clusterCode | * |
| manufacturerCode | * |
This async function should be used when you want to get attributes, while also resolving against any global data that may be overridden by a particular cluster.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
| Param | Type |
|---|---|
| db | * |
| attributeId | * |
| clusterRef | * |
Query for attributes by side.
Kind: inner method of [DB API: zcl database access](#moduleDB API zcl database access)
Returns: promise that resolves into attributes.
| Param | Type |
|---|---|
| db | * |
| side | * |
| packageId | * |
Given a path, it will read generation template object into memory.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Object that contains: data, crc, templateData
| Param | Type |
|---|---|
| path | * |
Given a loading context, it records the package into the packages table and adds the packageId field into the resolved context.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with the same context passed in, except packageId added to it
| Param | Type |
|---|---|
| context | * |
This method takes extension data in JSON, and converts it into an object that contains: entityCode, entityQualifier, parentCode, manufacturerCode and value
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: object that can be used for database injection
| Param | Type |
|---|---|
| entityType | * |
| entity | * |
Returns a promise that will load the zcl extensions.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Promise of loading the zcl extensions.
| 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](#moduleJS 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](#moduleJS 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 |
Generates all the templates inside a toplevel package.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Promise that resolves with genResult, that contains all the generated templates, keyed by their ‘output’
| 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](#moduleJS API generator logic)
Returns: promise that resolves with the genResult, with newly generated content added.
| Param | Type | Description |
|---|---|---|
| genResult | * | |
| singleTemplatePkg | * | Single template package. |
Main API async function to generate stuff.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Promise that resolves into a generation result.
| Param | Type | Description |
|---|---|---|
| db | * | Database |
| packageId | * | packageId Template package id. It can be either single template or gen template json. |
Promise to write out a file, optionally creating a backup.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise of a written file.
| 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](#moduleJS API generator logic)
| Param | Type |
|---|---|
| genResult | * |
Generate files and write them into the given directory.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: a promise which will resolve when all the files are written.
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
| packageId | * |
| outputDirectory | * |
Executes post processing actions as defined by the gen-templates.json
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise of a dealt-with post processing actions
| 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](#moduleJS 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](#moduleJS 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](#moduleJS API generator logic)
Returns: templates
| Param | Type |
|---|---|
| singleTemplatePkg | * |
Given db connection, session and a single template package, produce the output.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Promise that resolves with the ‘utf8’ string that contains the generated content.
| 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](#moduleJS 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](#moduleJS API generator logic)
| Param | Type |
|---|---|
| genTemplatePackageId | * |
Function that loads the partials.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
| Param | Type |
|---|---|
| path | * |
Function that loads the helpers.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
| Param | Type | Description |
|---|---|---|
| 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. |
Returns an object that contains all the helper functions, keyed by their name
NOTE: This method is ONLY used for API testing. You should not use this method for any real work inside the engine or something.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Object containing all the helper functions.
Given an alias, this method finds a builtin helper package by its alias.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Helper package or undefined if none was found.
| Param | Type |
|---|---|
| alias | * |
Global helper initialization
Kind: inner method of [JS API: generator logic](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS API generator logic)
Returns: promise that resolves with a list of package id.
| Param | Type |
|---|---|
| context | * |
Returns the promise that resolves with the ZCL properties package id.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with the package id.
| Param | Type |
|---|---|
| context | * |
Populate the endpoint type ids into the global context.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: endpoint type ids
| 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS 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}
This helper creates a context for the aggregates of access.
Kind: inner method of [Templating API: Access helpers](#moduleTemplating 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](#moduleTemplating API Access helpers)
| Param | Type |
|---|---|
| options | * |
This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}
Given a hex number, it prints the offset, which is the index of the first non-zero bit.
Kind: inner method of [Templating API: C formatting helpers](#moduleTemplating API C formatting helpers)
| 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating API C formatting helpers)
Returns: Label formatted as C symbol.
| Param | Type |
|---|---|
| label | * |
Given a default value of attribute, this method converts it into bytes
Kind: inner method of [Templating API: C formatting helpers](#moduleTemplating API C formatting helpers)
| Param | Type |
|---|---|
| value | * |
Given a string convert it into a camelCased string
Kind: inner method of [Templating API: C formatting helpers](#moduleTemplating API C formatting helpers)
Returns: a spaced out string in lowercase
| Param | Type |
|---|---|
| str | * |
returns a string after converting ‘:’ and ‘-’ into ‘_’
Kind: inner method of [Templating API: C formatting helpers](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating API C formatting helpers)
Returns: the type representation required for CLI.
| Param |
|---|
| size |
| isSigned |
Kind: inner method of [Templating API: C formatting helpers](#moduleTemplating 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](#moduleTemplating API C formatting helpers)
| Param | Type |
|---|---|
| db | * |
| bitmap_name | * |
| packageIds | * |
Returns the type of enum
Kind: inner method of [Templating API: C formatting helpers](#moduleTemplating 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](#moduleTemplating API C formatting helpers)
| Param | Type |
|---|---|
| number | * |
Return true if number1 is greater than number2
Kind: inner method of [Templating API: C formatting helpers](#moduleTemplating API C formatting helpers)
Returns: true if num1 is greater than num2 else returns false
| Param |
|---|
| num1 |
| num2 |
When inside a context that contains ‘code’, this helper will output the value of the cluster extension specified by property=“propName” attribute.
Kind: inner method of [Templating API: C formatting helpers](#moduleTemplating API C formatting helpers)
Returns: Value of the cluster extension property.
| 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](#moduleTemplating 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](#moduleTemplating API C formatting helpers)
Returns: Value of the attribute type extension property.
| 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating API C formatting helpers)
Returns: Value of the command extension property.
| Param | Type |
|---|---|
| options | * |
This module contains the API for accessing SDK extensions.
Given a hex number, it prints the offset, which is the index of the first non-zero bit.
Kind: inner method of [Templating API: C formatting helpers](#moduleTemplating API C formatting helpers)
| 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating API C formatting helpers)
Returns: Label formatted as C symbol.
| Param | Type |
|---|---|
| label | * |
Given a default value of attribute, this method converts it into bytes
Kind: inner method of [Templating API: C formatting helpers](#moduleTemplating API C formatting helpers)
| Param | Type |
|---|---|
| value | * |
Given a string convert it into a camelCased string
Kind: inner method of [Templating API: C formatting helpers](#moduleTemplating API C formatting helpers)
Returns: a spaced out string in lowercase
| Param | Type |
|---|---|
| str | * |
returns a string after converting ‘:’ and ‘-’ into ‘_’
Kind: inner method of [Templating API: C formatting helpers](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating API C formatting helpers)
Returns: the type representation required for CLI.
| Param |
|---|
| size |
| isSigned |
Kind: inner method of [Templating API: C formatting helpers](#moduleTemplating 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](#moduleTemplating API C formatting helpers)
| Param | Type |
|---|---|
| db | * |
| bitmap_name | * |
| packageIds | * |
Returns the type of enum
Kind: inner method of [Templating API: C formatting helpers](#moduleTemplating 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](#moduleTemplating API C formatting helpers)
| Param | Type |
|---|---|
| number | * |
Return true if number1 is greater than number2
Kind: inner method of [Templating API: C formatting helpers](#moduleTemplating API C formatting helpers)
Returns: true if num1 is greater than num2 else returns false
| Param |
|---|
| num1 |
| num2 |
When inside a context that contains ‘code’, this helper will output the value of the cluster extension specified by property=“propName” attribute.
Kind: inner method of [Templating API: C formatting helpers](#moduleTemplating API C formatting helpers)
Returns: Value of the cluster extension property.
| 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](#moduleTemplating 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](#moduleTemplating API C formatting helpers)
Returns: Value of the attribute type extension property.
| 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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}
Creates block iterator over the endpoints.
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating API user-data specific helpers)
Returns: Promise of the resolved blocks iterating over cluster events.
| Param | Type |
|---|---|
| options | * |
Retrieve the number of endpoints which possess the specified cluster type
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: Promise of the number of endpoint
| Param | Type |
|---|---|
| clusterTypeId | * |
Iterates over all attributes required by the user configuration.
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: Promise of the resolved blocks iterating over cluster commands.
| 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](#moduleTemplating API user-data specific helpers)
Returns: Promise of the resolved blocks iterating over cluster commands.
| Param | Type |
|---|---|
| options | * |
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating 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. |
Creates endpoint type cluster command iterator. This fetches all manufacturing specific commands which have been enabled on added endpoints
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: Promise of the resolved blocks iterating over manufacturing specific cluster commands.
| Param |
|---|
| options |
Creates endpoint type cluster command iterator. This fetches all non-manufacturing specific commands which have been enabled on added endpoints
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: Promise of the resolved blocks iterating over non-manufacturing specific cluster commands.
| Param |
|---|
| options |
Creates endpoint type cluster command iterator. This fetches all manufacturing specific commands which have been enabled on added endpoints
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: Promise of the resolved blocks iterating over manufacturing specific cluster commands.
| Param |
|---|
| options |
Creates endpoint type cluster command iterator. This fetches all non-manufacturing specific commands which have been enabled on added endpoints
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: Promise of the resolved blocks iterating over non-manufacturing specific cluster commands.
| Param |
|---|
| options |
Creates endpoint type cluster command iterator. This fetches all commands which have been enabled on added endpoints
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: Promise of the resolved blocks iterating over cluster commands.
| 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating API user-data specific helpers)
Returns: True if cluster has enabled commands otherwise false
| Param | Type | Description |
|---|---|---|
| name | * | : Cluster name |
| side | * | : Cluster side |
Creates endpoint type cluster command iterator. This fetches all manufacturing and non-manufaturing specific commands which have been enabled on added endpoints
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: Promise of the resolved blocks iterating over manufacturing specific and non-manufacturing specific cluster commands.
| Param |
|---|
| options |
Creates endpoint type cluster attribute iterator. This fetches all manufacturing-specific and standard attributes which have been enabled on added endpoints based on the name and side of the cluster. When side is not mentioned then client and server attributes are returned. Available Options:
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: Promise of the resolved blocks iterating over manufacturing specific and standard cluster attributes.
| Param |
|---|
| name |
| side |
| options |
Helper that resolves into a user session key value.
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: Promise of value of the session key or undefined.
| 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](#moduleTemplating API user-data specific helpers)
An if helper to check if default response for a command is enabled or not.
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: true if the the default response policy is either always or when the policy is not never and the command has the disable default response policy set to false(not true)
| 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](#moduleTemplating API user-data specific helpers)
Returns: true if the the default response policy is either never or when the policy is not always and the command has the disable default response policy set to true(for eg disableDefaultResponse=“true” in xml).
| Param | Type |
|---|---|
| command | * |
| options | * |
Default values for the attributes longer than a pointer. All attribute values with size greater than 2 bytes. Excluding 0 values and externally saved values
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: Attribute values greater than 2 bytes and not 0 nor externally saved.
| Param |
|---|
| name |
| side |
| options |
Entails the list of all attributes which have been enabled. Given the cluster is enabled as well. The helper retrieves the attributes across all endpoints.
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: enabled attributes
| Param |
|---|
| options |
Entails the list of reportable attributes which have been enabled. Given the cluster is enabled as well. The helper retrieves the reportable attributes per endpoint per cluster.
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: Reportable attributes
| Param |
|---|
| options |
All available cluster commands across all endpoints and clusters.
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: All available cluster commands across all endpoints and clusters
| Param |
|---|
| options |
Util function for all clusters with side that have available incoming or outgiong commands across all endpoints.
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: All clusters with side that have available incoming or outgiong commands across all endpoints.
| 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](#moduleTemplating 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](#moduleTemplating API user-data specific helpers)
Returns: All clusters with side that have available outgoing commands across all endpoints.
| Param |
|---|
| options |
Provide all manufacturing specific clusters that have incoming commands with the given cluster code.
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: Details of manufacturing specific clusters that have incoming commands with the given cluster code
| Param |
|---|
| clusterCode |
| options |
All clusters that have available incoming commands. If there is a client and server enabled on the endpoint, this combines them into a single entry.
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: All clusters that have available incoming commands across all endpoints.
| Param |
|---|
| options |
All commands that need to be parsed for a given cluster. This takes in booleans for if the client and or server are included.
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: all commands that need to be parsed for a given cluster
| Param |
|---|
| clusterName |
| clientSide |
| serverSide |
| options |
A util function for all incoming or outgoing commands that need to be parsed for a given cluster
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: All incoming or outgoing commands that need to be parsed for a given cluster
| Param |
|---|
| clusterName |
| clusterSide |
| isIncoming |
| options |
All incoming commands that need to be parsed for a given cluster
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: all incoming commands that need to be parsed for a given cluster
| Param |
|---|
| clusterName |
| options |
All outgoing commands that need to be parsed for a given cluster
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: all outgoing commands that need to be parsed for a given cluster
| Param |
|---|
| clusterName |
| options |
Entails the Cluster details per endpoint
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: Cluster Details per endpoint with attribute summaries within the clusters
| Param | Type |
|---|---|
| options | * |
Entails Endpoint type details along with their cluster summaries
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: Endpoint type details along with their cluster summaries
| Param |
|---|
| options |
Returns attributes inside an endpoint type that either have a default or a bounded attribute.
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: endpoints with bounds or defaults
| Param |
|---|
| name |
| side |
| options |
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: arrayIndex
| Param |
|---|
| clusterName |
| attributeName |
| attributeSide |
| attributeValue |
| attributeValueType |
| endpointAttributes |
Extracts the index of generated defaults array which come from all_user_cluster_attributes_for_generated_defaults
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: index of the generated default array
| Param |
|---|
| clusterName |
| attributeName |
| attributeValueType |
| attributeValue |
| prefixReturn |
| postFixReturn |
Extracts the index of generated defaults array which come from all_user_cluster_attributes_for_generated_defaults
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: deafult value's index in the generated default array
| Param |
|---|
| clusterName |
| attributeName |
| attributeSide |
| attributeValueType |
| attributeValue |
| prefixReturn |
| postFixReturn |
Extracts the index of generated min max defaults array which come from all_user_cluster_attributes_min_max_defaults
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: index of the generated min max default array
| Param |
|---|
| name |
| side |
| options |
Extracts the index of generated min max defaults array which come from all_user_cluster_attributes_min_max_defaults
Kind: inner method of [Templating API: user-data specific helpers](#moduleTemplating API user-data specific helpers)
Returns: index of the generated min max default in the array
| Param |
|---|
| clusterName |
| attributeName |
| attributeSide |
| options |
This module contains the API for templating. For more detailed instructions, read {@tutorial template-tutorial}
Produces the top-of-the-file header for a C file.
Kind: inner method of [Templating API: toplevel utility helpers](#moduleTemplating API toplevel utility helpers)
Returns: The header content
Simple helper that produces an approved size of identation.
Kind: inner method of [Templating API: toplevel utility helpers](#moduleTemplating API toplevel utility helpers)
Returns: whitespace that is the identation.
Block helper that iterates over the package options of a given category.
Kind: inner method of [Templating API: toplevel utility helpers](#moduleTemplating API toplevel utility helpers)
| 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating API toplevel utility helpers)
| Param | Type |
|---|---|
| options | * |
| key | * |
Forced fail halper.
Kind: inner method of [Templating API: toplevel utility helpers](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating API toplevel utility helpers)
| Param | Type |
|---|---|
| string_a | * |
| string_b | * |
Remove leading and trailing spaces from a string
Kind: inner method of [Templating API: toplevel utility helpers](#moduleTemplating API toplevel utility helpers)
Returns: A string with no leading and trailing spaces
| Param | Type |
|---|---|
| str | * |
Split the string based on spaces and return the last word
Kind: inner method of [Templating API: toplevel utility helpers](#moduleTemplating API toplevel utility helpers)
| Param | Type |
|---|---|
| str | * |
Iteration block.
Kind: inner method of [Templating API: toplevel utility helpers](#moduleTemplating API toplevel utility helpers)
Given: A list of strings Returns a concatenated string with spaces between each string
Kind: inner method of [Templating API: toplevel utility helpers](#moduleTemplating API toplevel utility helpers)
Kind: inner method of [Templating API: toplevel utility helpers](#moduleTemplating API toplevel utility helpers)
Returns: true if both numbers are equal else returns false
| Param |
|---|
| numA |
| numB |
Kind: inner method of [Templating API: toplevel utility helpers](#moduleTemplating API toplevel utility helpers)
Returns: true or false based on whether the value is undefined or not
| Param |
|---|
| value |
Kind: inner method of [Templating API: toplevel utility helpers](#moduleTemplating API toplevel utility helpers)
Returns: A string replaced with another string in the mainString
| Param |
|---|
| mainString |
| replaceString |
| replaceWithString |
Kind: inner method of [Templating API: toplevel utility helpers](#moduleTemplating API toplevel utility helpers)
Returns: A resultant string with all string values prefixed with prefixStr
| Param |
|---|
| str |
| prefixStr |
Kind: inner method of [Templating API: toplevel utility helpers](#moduleTemplating API toplevel utility helpers)
Returns: A number which is result of multiplying all the arguments given
Kind: inner method of [Templating API: toplevel utility helpers](#moduleTemplating 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](#moduleTemplating 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}
Block helper iterating over all bitmaps.
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating API static zcl helpers)
Returns: Promise of content.
| Param |
|---|
| name |
| options |
Block helper iterating over all deviceTypes.
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
Returns: Promise of content.
| Param | Type |
|---|---|
| options | * |
Block helper for use inside zcl_device_types
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
Returns: blocks for clusters
| Param | Type |
|---|---|
| options | * |
Block helper for use inside zcl_device_type_clusters
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
Returns: blocks for commands
| Param | Type |
|---|---|
| options | * |
Block helper for use inside zcl_device_type_clusters
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
Returns: blocks for attributes
| Param | Type |
|---|---|
| options | * |
Block helper iterating over all clusters.
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
Returns: Promise of content.
| 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](#moduleTemplating API static zcl helpers)
Returns: Promise of content.
| 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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:
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating 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](#moduleTemplating API static zcl helpers)
Returns: Promise of content.
| Param | Type |
|---|---|
| options | * |
Given: N/A
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
Returns: the length of largest cluster name in a list of clusters
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
Returns: the length of largest object name in an array. Helper for zcl_cluster_largest_label_length
| 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](#moduleTemplating API static zcl helpers)
Returns: Number of command arguments as an integer
| Param | Type |
|---|---|
| commandId | * |
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
| Param | Description |
|---|---|
| commandId | |
| fixedLengthReturn | |
| notFixedLengthReturn | |
| currentContext | Returns fixedLengthReturn or notFixedLengthReturn based on whether the command is fixed length or not |
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating 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. |
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
Returns: the underlying zcl type of a command argument if the argument is not fixed length but is always present. If the condition is not met then returns an empty string.
| Param |
|---|
| type |
| command |
| commandArg |
| appendString |
| options |
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating API static zcl helpers)
Returns: Promise of content.
| Param | Type |
|---|---|
| type | * |
If helper that checks if a type is an enum
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
Returns: Promise of content.
| Param | Type |
|---|---|
| type | * |
If helper that checks if a type is an struct
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating API static zcl helpers)
Returns: boolean
| Param | Type |
|---|---|
| side | * |
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
Returns: A string as an underlying zcl type if the command is not fixed length and the command argument is always present in all zcl specifications.
| 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 |
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
Returns: argumentPresentReturn if the command is not fixed length and command argument is always present without conditions(introducedInRef, removedInRef, presentIf) else returns argumentNotPresentReturn
| Param |
|---|
| commandId |
| introducedInRef |
| removedInRef |
| presentIf |
| argumentPresentReturn |
| argumentNotPresentReturn |
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
Returns: A string as an underlying zcl type if the command is not fixed length, the command argument is not always present in all zcl specifications and there is no present if conditionality on the command argument.
| 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 |
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
Returns: A string as an underlying zcl type if the command is not fixed length, the command argument is not always present in all zcl specifications and there is no present if conditionality on the command argument.
| 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 |
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
Returns: argumentNotInAllVersionsReturn if the command is not fixed length and command argument is present with conditions introducedInRef or removedInRef but no presentIf conditions else returns argumentNotPresentReturn
| Param |
|---|
| commandId |
| introducedInRef |
| removedInRef |
| presentIf |
| argumentNotInAllVersionsReturn |
| argumentInAllVersionsReturn |
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
Returns: A string as an underlying zcl type if the command is not fixed length, the command argument is not always present in all zcl specifications and there is a present if conditionality on the command argument.
| 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 |
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
Returns: A string as an underlying zcl type if the command is not fixed length, the command argument is not always present in all zcl specifications but there is a present if conditionality on the command argument.
| 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 |
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
Returns: argumentNotInAllVersionsReturn if the command is not fixed length, command argument is present with conditions introducedInRef or removedInRef and presentIf conditions exist as well else returns argumentNotPresentReturn
| Param |
|---|
| commandId |
| introducedInRef |
| removedInRef |
| presentIf |
| argumentNotInAllVersionsPresentIfReturn |
| argumentInAllVersionsReturn |
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
Returns: A string as an underlying zcl type if the command is not fixed length, the command argument is always present in all zcl specifications and there is a present if conditionality on the command argument.
| 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 |
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
Returns: A string as an underlying zcl type if the command is not fixed length, the command argument is always present in all zcl specifications but there is a present if conditionality on the command argument.
| 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 |
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
Returns: argumentInAllVersionsPresentIfReturn if the command is not fixed length, command argument is always present and presentIf conditions exist else returns argumentNotPresentReturn
| Param |
|---|
| commandId |
| introducedInRef |
| removedInRef |
| presentIf |
| argumentNotInAllVersionsPresentIfReturn |
| argumentInAllVersionsReturn |
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
Returns: manufacturer_specific_return if the cluster is manufacturer specific or returns null_manufacturer_specific_return if cluster is not manufacturer specific.
| 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](#moduleTemplating API static zcl helpers)
Returns: Returns content in the handlebar template based on whether the command is manufacturing specific or not.
| Param |
|---|
| clusterId |
| options |
Given the value and size of an attribute along with endian as an option. This helper returns the attribute value as big/little endian. Example: {{as_generated_default_macro 0x00003840 4 endian=“big”}} will return: 0x00, 0x00, 0x38, 0x40,
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
Returns: Formatted attribute value based on given arguments Available options:
| Param |
|---|
| value |
| attributeSize |
| options |
Given the attributes of a zcl attribute. Creates an attribute mask based on the given options Available options: isClusterCodeMfgSpecific: 0/1, This is to determine if cluster code needs to be used to determine if a cluster is mfg specific or not.
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
Returns: attribute mask based on given values
| Param |
|---|
| writable |
| storageOption |
| minMax |
| mfgSpecific |
| clusterCode |
| client |
| isSingleton |
| prefixString |
| postfixString |
Given the attributes of a zcl command. Creates a command mask based on the given options
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
Returns: command mask based on given values
| Param |
|---|
| commmandSource |
| clusterSide |
| isIncomingEnabled |
| isOutgoingEnabled |
| manufacturingCode |
| prefixForMask |
A Sub helper api for command_mask to reduce code redundancy
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
Returns: command mask addition based on the arguments
| Param |
|---|
| commandMask |
| str |
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:
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
Returns: Formatted string for generated defaults starting with the lenth of a string then each character and then filler for the size allocated for the string. Long strings prefixed by 2 byte length field.
| Param |
|---|
| stringVal |
| sizeOfString |
Given a zcl data type return the min allowed value for that zcl data type based on the language specified in the options
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
Returns: max allowed value for the given zcl data type Available Options:
| 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](#moduleTemplating API static zcl helpers)
Returns: max allowed value for the given zcl data type Available Options:
| Param | Type |
|---|---|
| type | * |
| options | * |
Returns all structs which have clusters associated with them
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating 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](#moduleTemplating 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](#moduleTemplating API static zcl helpers)
Returns: Object - Promise of content example: checking if (4 < 5) (if_compare 4 5 operator=‘<’) Content when comparison returns true
Content when comparison returns false (/if_compare)
| Param | Type |
|---|---|
| leftValue | * |
| rightValue | * |
| options | * |
Check if the given type is signed or not based on the type name and cluster id.
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating API static zcl helpers)
Returns: Promise of content
| 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 Available Options:
Kind: inner method of [Templating API: static zcl helpers](#moduleTemplating 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}
Given a path, it will read generation template object into memory.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Object that contains: data, crc, templateData
| Param | Type |
|---|---|
| path | * |
Given a loading context, it records the package into the packages table and adds the packageId field into the resolved context.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with the same context passed in, except packageId added to it
| Param | Type |
|---|---|
| context | * |
This method takes extension data in JSON, and converts it into an object that contains: entityCode, entityQualifier, parentCode, manufacturerCode and value
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: object that can be used for database injection
| Param | Type |
|---|---|
| entityType | * |
| entity | * |
Returns a promise that will load the zcl extensions.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Promise of loading the zcl extensions.
| 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](#moduleJS 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](#moduleJS 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 |
Generates all the templates inside a toplevel package.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Promise that resolves with genResult, that contains all the generated templates, keyed by their ‘output’
| 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](#moduleJS API generator logic)
Returns: promise that resolves with the genResult, with newly generated content added.
| Param | Type | Description |
|---|---|---|
| genResult | * | |
| singleTemplatePkg | * | Single template package. |
Main API async function to generate stuff.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Promise that resolves into a generation result.
| Param | Type | Description |
|---|---|---|
| db | * | Database |
| packageId | * | packageId Template package id. It can be either single template or gen template json. |
Promise to write out a file, optionally creating a backup.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise of a written file.
| 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](#moduleJS API generator logic)
| Param | Type |
|---|---|
| genResult | * |
Generate files and write them into the given directory.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: a promise which will resolve when all the files are written.
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
| packageId | * |
| outputDirectory | * |
Executes post processing actions as defined by the gen-templates.json
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise of a dealt-with post processing actions
| 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](#moduleJS 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](#moduleJS 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](#moduleJS API generator logic)
Returns: templates
| Param | Type |
|---|---|
| singleTemplatePkg | * |
Given db connection, session and a single template package, produce the output.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Promise that resolves with the ‘utf8’ string that contains the generated content.
| 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](#moduleJS 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](#moduleJS API generator logic)
| Param | Type |
|---|---|
| genTemplatePackageId | * |
Function that loads the partials.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
| Param | Type |
|---|---|
| path | * |
Function that loads the helpers.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
| Param | Type | Description |
|---|---|---|
| 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. |
Returns an object that contains all the helper functions, keyed by their name
NOTE: This method is ONLY used for API testing. You should not use this method for any real work inside the engine or something.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Object containing all the helper functions.
Given an alias, this method finds a builtin helper package by its alias.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Helper package or undefined if none was found.
| Param | Type |
|---|---|
| alias | * |
Global helper initialization
Kind: inner method of [JS API: generator logic](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS API generator logic)
Returns: promise that resolves with a list of package id.
| Param | Type |
|---|---|
| context | * |
Returns the promise that resolves with the ZCL properties package id.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with the package id.
| Param | Type |
|---|---|
| context | * |
Populate the endpoint type ids into the global context.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: endpoint type ids
| 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS 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. |
Given a path, it will read generation template object into memory.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Object that contains: data, crc, templateData
| Param | Type |
|---|---|
| path | * |
Given a loading context, it records the package into the packages table and adds the packageId field into the resolved context.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with the same context passed in, except packageId added to it
| Param | Type |
|---|---|
| context | * |
This method takes extension data in JSON, and converts it into an object that contains: entityCode, entityQualifier, parentCode, manufacturerCode and value
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: object that can be used for database injection
| Param | Type |
|---|---|
| entityType | * |
| entity | * |
Returns a promise that will load the zcl extensions.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Promise of loading the zcl extensions.
| 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](#moduleJS 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](#moduleJS 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 |
Generates all the templates inside a toplevel package.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Promise that resolves with genResult, that contains all the generated templates, keyed by their ‘output’
| 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](#moduleJS API generator logic)
Returns: promise that resolves with the genResult, with newly generated content added.
| Param | Type | Description |
|---|---|---|
| genResult | * | |
| singleTemplatePkg | * | Single template package. |
Main API async function to generate stuff.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Promise that resolves into a generation result.
| Param | Type | Description |
|---|---|---|
| db | * | Database |
| packageId | * | packageId Template package id. It can be either single template or gen template json. |
Promise to write out a file, optionally creating a backup.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise of a written file.
| 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](#moduleJS API generator logic)
| Param | Type |
|---|---|
| genResult | * |
Generate files and write them into the given directory.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: a promise which will resolve when all the files are written.
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
| packageId | * |
| outputDirectory | * |
Executes post processing actions as defined by the gen-templates.json
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise of a dealt-with post processing actions
| 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](#moduleJS 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](#moduleJS 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](#moduleJS API generator logic)
Returns: templates
| Param | Type |
|---|---|
| singleTemplatePkg | * |
Given db connection, session and a single template package, produce the output.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Promise that resolves with the ‘utf8’ string that contains the generated content.
| 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](#moduleJS 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](#moduleJS API generator logic)
| Param | Type |
|---|---|
| genTemplatePackageId | * |
Function that loads the partials.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
| Param | Type |
|---|---|
| path | * |
Function that loads the helpers.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
| Param | Type | Description |
|---|---|---|
| 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. |
Returns an object that contains all the helper functions, keyed by their name
NOTE: This method is ONLY used for API testing. You should not use this method for any real work inside the engine or something.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Object containing all the helper functions.
Given an alias, this method finds a builtin helper package by its alias.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: Helper package or undefined if none was found.
| Param | Type |
|---|---|
| alias | * |
Global helper initialization
Kind: inner method of [JS API: generator logic](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS API generator logic)
Returns: promise that resolves with a list of package id.
| Param | Type |
|---|---|
| context | * |
Returns the promise that resolves with the ZCL properties package id.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: promise that resolves with the package id.
| Param | Type |
|---|---|
| context | * |
Populate the endpoint type ids into the global context.
Kind: inner method of [JS API: generator logic](#moduleJS API generator logic)
Returns: endpoint type ids
| 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS 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 API to access zcl specific information.
Promise that return a list of component Ids required by a specific cluster
Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: * - - {componentIds, clusterId, clusterLabel, side}
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
| clusterId | * |
| side | * |
HTTP GET: session key values
Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: callback for the express uri registration
| Param | Type |
|---|---|
| db | * |
HTTP GET: session get notifications
Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: callback for the express uri registration
| Param | Type |
|---|---|
| db | * |
HTTP POST: save session key value
Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: callback for the express uri registration
| Param | Type |
|---|---|
| db | * |
HTTP POST: cluster
Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: callback for the express uri registration
| Param | Type |
|---|---|
| db | * |
HTTP POST attribute update
Kind: inner method of [REST API: user data](#moduleREST 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](#moduleREST 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](#moduleREST 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](#moduleREST API user data)
Returns: callback for the express uri registration
| Param | Type |
|---|---|
| db | * |
HTTP GET: option
Kind: inner method of [REST API: user data](#moduleREST 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](#moduleREST API user data)
Returns: UI options from all packages.
| Param | Type |
|---|---|
| db | * |
HTTP GET: Project packages
Kind: inner method of [REST API: user data](#moduleREST API user data)
HTTP GET: All Packages
Kind: inner method of [REST API: user data](#moduleREST API user data)
HTTP POST: Add new project package
Kind: inner method of [REST API: user data](#moduleREST API user data)
HTTP POST: Unify all Attributes / Command states if a certain cluster is enabled on more than one endpoint.
Kind: inner method of [REST API: user data](#moduleREST API user data)
Creating a duplicate for endpoint
Kind: inner method of [REST API: user data](#moduleREST 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](#moduleREST API user data)
Returns: newly created endpoint-type id
| 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](#moduleREST API user data)
| Param | Type |
|---|---|
| db | * |
| oldEndpointTypeId | * |
| newEndpointTypeId | * |
This module provides the REST API to the admin functions.
API: /sql Request JSON:
Response JSON:
Kind: inner method of [REST API: admin functions](#moduleREST API admin functions)
Returns: callback for the express uri registration
| Param | Type |
|---|---|
| db | * |
| app | * |
API: /version Response JSON:
Kind: inner method of [REST API: admin functions](#moduleREST API admin functions)
Returns: callback for the express uri registration.
| Param | Type |
|---|---|
| db | * |
API: /cache Response JSON:
Kind: inner method of [REST API: admin functions](#moduleREST API admin functions)
| Param | Type |
|---|---|
| db | * |
This module provides the REST API to the user specific data.
HTTP DELETE: endpoint
Kind: inner method of [REST API: endpoint](#moduleREST API endpoint)
Returns: callback for the express uri registration
| Param | Type |
|---|---|
| db | * |
HTTP DELETE: endpoint type
Kind: inner method of [REST API: endpoint](#moduleREST API endpoint)
Returns: callback for the express uri registration
| Param | Type |
|---|---|
| db | * |
HTTP POST: endpoint
Kind: inner method of [REST API: endpoint](#moduleREST API endpoint)
Returns: callback for the express uri registration
| Param | Type |
|---|---|
| db | * |
HTTP POST: endpoint
Kind: inner method of [REST API: endpoint](#moduleREST 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](#moduleREST API endpoint)
Returns: callback for the express uri registration
| Param | Type |
|---|---|
| db | * |
HTTP POST: endpoint type update
Kind: inner method of [REST API: endpoint](#moduleREST 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.
HTTP GET: preview single file with index.
Kind: inner method of [REST API: generation functions](#moduleREST API generation functions)
Returns: callback for the express uri registration
| Param | Type |
|---|---|
| db | * |
HTTP GET: Preview a single file.
Kind: inner method of [REST API: generation functions](#moduleREST API generation functions)
Returns: callback for the express uri registration
| Param | Type |
|---|---|
| db | * |
HTTP GET: total preview object.
Kind: inner method of [REST API: generation functions](#moduleREST API generation functions)
Returns: callback for the express uri registration
| Param | Type |
|---|---|
| db | * |
HTTP PUT: performs local generation into a specified directory.
Kind: inner method of [REST API: generation functions](#moduleREST API generation functions)
Returns: callback for the express uri registration
| Param | Type |
|---|---|
| db | * |
Enable components by ‘componentId’ or corresponding components specified, via ‘defaults’, by ‘clusterId’ / ‘roles’
Kind: inner method of [REST API: generation functions](#moduleREST API generation functions)
| Param | Type |
|---|---|
| db | * |
This module provides the REST API to the IDE component handling.
HTTP GET: preview single file with index.
Kind: inner method of [REST API: generation functions](#moduleREST API generation functions)
Returns: callback for the express uri registration
| Param | Type |
|---|---|
| db | * |
HTTP GET: Preview a single file.
Kind: inner method of [REST API: generation functions](#moduleREST API generation functions)
Returns: callback for the express uri registration
| Param | Type |
|---|---|
| db | * |
HTTP GET: total preview object.
Kind: inner method of [REST API: generation functions](#moduleREST API generation functions)
Returns: callback for the express uri registration
| Param | Type |
|---|---|
| db | * |
HTTP PUT: performs local generation into a specified directory.
Kind: inner method of [REST API: generation functions](#moduleREST API generation functions)
Returns: callback for the express uri registration
| Param | Type |
|---|---|
| db | * |
Enable components by ‘componentId’ or corresponding components specified, via ‘defaults’, by ‘clusterId’ / ‘roles’
Kind: inner method of [REST API: generation functions](#moduleREST API generation functions)
| Param | Type |
|---|---|
| db | * |
This module provides the REST API to the session initialization
This function returns Properties, Templates and Dirty-Sessions
Kind: inner method of [REST API: initialization functions](#moduleREST API initialization functions)
Returns: Properties, Templates and Dirty-Sessions.
| Param | Type |
|---|---|
| db | * |
This function creates a new session with its packages according to selected Properties and Templates
Kind: inner method of [REST API: initialization functions](#moduleREST API initialization functions)
Returns: A success message.
| 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](#moduleREST API initialization functions)
Returns: A success message.
| Param | Type |
|---|---|
| db | * |
Init function from the App.vue
Kind: inner method of [REST API: initialization functions](#moduleREST API initialization functions)
Returns: A success message.
| Param | Type |
|---|---|
| db | * |
This module provides the REST API to the static zcl queries.
API: /zcl/:entity/:id
Kind: inner method of [REST API: static zcl functions](#moduleREST API static zcl functions)
| Param | Type | Description |
|---|---|---|
| app | * | Express instance. |
API: /zclExtension/:entity/:extension
Kind: inner method of [REST API: static zcl functions](#moduleREST API static zcl functions)
Returns: zcl extension handler
| Param | Type |
|---|---|
| db | * |
This module provides the REST API to the user specific data.
Promise that return a list of component Ids required by a specific cluster
Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: * - - {componentIds, clusterId, clusterLabel, side}
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
| clusterId | * |
| side | * |
HTTP GET: session key values
Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: callback for the express uri registration
| Param | Type |
|---|---|
| db | * |
HTTP GET: session get notifications
Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: callback for the express uri registration
| Param | Type |
|---|---|
| db | * |
HTTP POST: save session key value
Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: callback for the express uri registration
| Param | Type |
|---|---|
| db | * |
HTTP POST: cluster
Kind: inner method of [REST API: user data](#moduleREST API user data)
Returns: callback for the express uri registration
| Param | Type |
|---|---|
| db | * |
HTTP POST attribute update
Kind: inner method of [REST API: user data](#moduleREST 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](#moduleREST 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](#moduleREST 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](#moduleREST API user data)
Returns: callback for the express uri registration
| Param | Type |
|---|---|
| db | * |
HTTP GET: option
Kind: inner method of [REST API: user data](#moduleREST 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](#moduleREST API user data)
Returns: UI options from all packages.
| Param | Type |
|---|---|
| db | * |
HTTP GET: Project packages
Kind: inner method of [REST API: user data](#moduleREST API user data)
HTTP GET: All Packages
Kind: inner method of [REST API: user data](#moduleREST API user data)
HTTP POST: Add new project package
Kind: inner method of [REST API: user data](#moduleREST API user data)
HTTP POST: Unify all Attributes / Command states if a certain cluster is enabled on more than one endpoint.
Kind: inner method of [REST API: user data](#moduleREST API user data)
Creating a duplicate for endpoint
Kind: inner method of [REST API: user data](#moduleREST 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](#moduleREST API user data)
Returns: newly created endpoint-type id
| 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](#moduleREST API user data)
| Param | Type |
|---|---|
| db | * |
| oldEndpointTypeId | * |
| newEndpointTypeId | * |
This module provides the HTTP server functionality.
This function is used to register a rest module, which exports get/post/etc. arrays.
Kind: inner method of [JS API: http server](#moduleJS API http server)
| Param | Type |
|---|---|
| filename | * |
| db | * |
| app | * |
Promises to initialize the http server on a given port using a given database.
Kind: inner method of [JS API: http server](#moduleJS API http server)
Returns: A promise that resolves with an express app.
| Param | Type | Description |
|---|---|---|
| db | * | Database object to use. |
| port | * | Port for the HTTP server. |
Promises to shut down the http server.
Kind: inner method of [JS API: http server](#moduleJS API http server)
Returns: Promise that resolves when server is shut down.
Promises to shut down the http server.
Kind: inner method of [JS API: http server](#moduleJS API http server)
Returns: Promise that resolves when server is shut down.
Port http server is listening on.
Kind: inner method of [JS API: http server](#moduleJS API http server)
Returns: port
Returns the URL of the server.
Kind: inner method of [JS API: http server](#moduleJS 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](#moduleJS API http server)
This module provides the HTTP server functionality.
Initialize a websocket, and register listeners to the websocket connection and the message receipt.
Kind: inner method of [JS API: websocket server](#moduleJS API websocket server)
| Param | Type |
|---|---|
| httpServer | * |
Method that returns the websocket for a given session key.
Kind: inner method of [JS API: websocket server](#moduleJS API websocket server)
| Param | Type |
|---|---|
| sessionUuid | * |
Bottom-most function that sends an object over a socket.
Kind: inner method of [JS API: websocket server](#moduleJS API websocket server)
| Param | Type |
|---|---|
| socket | * |
| object | * |
Send websocket payload with a given category.
Kind: inner method of [JS API: websocket server](#moduleJS 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](#moduleJS 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](#moduleJS API websocket server)
| Param | Type | Description |
|---|---|---|
| category | * | category of message. |
| listener | * | function that receives socket, data. |
This method returns the global session UUID from the browser window that is set by the front-end.
Kind: inner method of [JS API: renderer API related utilities](#moduleJS API renderer API related utilities)
Returns: session UUID
| Param | Type |
|---|---|
| browserWindow | * |
Returns descriptive text about renderer api.
Kind: inner method of [JS API: renderer API related utilities](#moduleJS API renderer API related utilities)
Returns: description of renderer api
| Param | Type |
|---|---|
| browserWindow | * |
Execute RendererApi commands
Kind: inner method of [JS API: renderer API related utilities](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS API renderer API related utilities)
| Param | Type |
|---|---|
| browserWindow | * |
| result | * |
Returns cookie for user identification.
Kind: inner method of [JS API: renderer API related utilities](#moduleJS API renderer API related utilities)
Returns: cookie value used for user identification
| Param | Type |
|---|---|
| cookieValue | * |
Returns the session key
Kind: inner method of [JS API: renderer API related utilities](#moduleJS 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](#moduleJS API renderer API related utilities)
| Param | Type |
|---|---|
| browserWindow | * |
This module provides the mechanism for dealing with the async reporting from backend to the UI.
This mechanism takes care of:
Sends a dirty flag status for a single session.
Kind: inner method of [JS API: async reporting](#moduleJS 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](#moduleJS 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](#moduleJS API async reporting)
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](#moduleJS API SDK utilities)
| Param | Type |
|---|---|
| sdkPath | * |
| logger | * |
This function resolves with the size of a given type. -1 means that this size is variable.
Kind: inner method of [JS API: type related utilities](#moduleJS API type related utilities)
| 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](#moduleJS 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](#moduleJS API type related utilities)
Returns: The big endian value for a given float value padded with the given size. The value is returned in hex format and prefixed with ‘0x’.
| Param | Type |
|---|---|
| value | * |
| size | * |
Kind: inner method of [JS API: type related utilities](#moduleJS API type related utilities)
Returns: The big endian value for a given integer value padded with the given size. The value is returned in hex format and prefixed with ‘0x’.
| 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS API type related utilities)
Returns: true if type is float, false otherwise
| Param | Type |
|---|---|
| type | * |
Returns true if a given ZCL type is a signed integer.
Kind: inner method of [JS API: type related utilities](#moduleJS API type related utilities)
Returns: true if type is signed integer, false otherwise
| Param | Type |
|---|---|
| type | * |
Checks if type is a one-byte lengh string.
Kind: inner method of [JS API: type related utilities](#moduleJS API type related utilities)
Returns: true if the said type is a string prefixed by one byte length
| Param | Type |
|---|---|
| type | * |
Checks if type is a two-byte lengh string.
Kind: inner method of [JS API: type related utilities](#moduleJS API type related utilities)
Returns: true if the said type is a string prefixed by two byte length
| Param | Type |
|---|---|
| type | * |
Given a zcl device type returns its sign, size and zcl data type info stored in the database table. Note: Enums and Bitmaps are considered to be unsigned.
Kind: inner method of [JS API: type related utilities](#moduleJS API type related utilities)
Returns: returns sign, size and info of zcl device type Available Options:
| Param | Type |
|---|---|
| type | * |
| context | * |
| options | * |
Returns the CRC of the data that is passed.
Kind: inner method of [JS API: random utilities](#moduleJS API random utilities)
Returns: Calculated CRC of a data.
| Param | Type |
|---|---|
| data | * |
This function assigns a proper package ID to the session if there are no packages present. It will also populate session options.
Kind: inner method of [JS API: random utilities](#moduleJS API random utilities)
Returns: Promise that resolves with the packages array.
| Param | Type | Description |
|---|---|---|
| db | * | |
| sessionId | * | |
| options: | * | object containing ‘zcl’ and ‘template’ |
| selectedZclPropertyPackage | * | |
| selectedGenTemplatePackages | * |
Move database file out of the way into the backup location.
Kind: inner method of [JS API: random utilities](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS 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](#moduleJS API random utilities)
Returns a promise that resolves after time milliseconds
Kind: inner method of [JS API: random utilities](#moduleJS API random utilities)
| Param |
|---|
| time |
Returns a promise that resolve into a parsed XML object.
Kind: inner method of [JS API: random utilities](#moduleJS API random utilities)
Returns: promise that resolves into parsed object.
| Param | Type |
|---|---|
| fileContent | * |
Reads the properties file and returns object containing ‘data’, ‘filePath’ and ‘crc’
Kind: inner method of [JS API: random utilities](#moduleJS API random utilities)
Returns: Promise to populate data, filePath and crc into the context.
| 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](#moduleJS 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](#moduleJS API random utilities)
Utility method that collects data from a JSON file.
JSON file is formatted as a bunch of keyed strings: “someKey”: [ “a”, “b”, “c”] Then it supports following special keys: “include”: “path/to/json/file” - includes the said JSON file “disable”: [ “x”, “y” ...] - disables the specified data points “collection”: [“key”, “key2”, ...] - collects final list of data points
Kind: inner method of [JS API: random utilities](#moduleJS API random utilities)
| Param | Type |
|---|---|
| jsonFile | * |
This module provides the API to access various zcl utilities.
Comparator for sorting clusters.
Kind: inner method of [REST API: various zcl utilities](#moduleREST 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](#moduleREST 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](#moduleREST 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](#moduleREST API various zcl utilities)
Returns: -1, 0 or 1
| Param | Type |
|---|---|
| a | * |
| b | * |
This method retrieves a bunch of structs sorted alphabetically. It's expected to resort the structs into a list where they are sorted in a way where dependency is observed.
It uses the DFS-based topological sort algorithm.
Kind: inner method of [REST API: various zcl utilities](#moduleREST API various zcl utilities)
Returns: sorted structs according to topological search.
| 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](#moduleREST API various zcl utilities)
| Param | Type |
|---|---|
| res | * |
| options | * |
| db | * |
| packageIds | * |
| isStructType | * |
Kind: inner method of [REST API: various zcl utilities](#moduleREST API various zcl utilities)
| Param | Description |
|---|---|
| options | |
| optionsKey | |
| defaultValue | Given the values determine to give the user defined value or the calculated value |
Kind: inner method of [REST API: various zcl utilities](#moduleREST 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](#moduleREST 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](#moduleREST 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](#moduleREST 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](#moduleREST API various zcl utilities)
Returns: Promise of content.
| Param | Type |
|---|---|
| db | * |
| bitmap_name | * |
| packageIds | * |
Kind: inner method of [REST API: various zcl utilities](#moduleREST 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. |
Kind: inner method of [REST API: various zcl utilities](#moduleREST API various zcl utilities)
Returns: the data type associated with the resolvedType
| Param | Type |
|---|---|
| type | * |
| options | * |
| packageIds | * |
| db | * |
| resolvedType | * |
| overridable | * |
Kind: inner method of [REST API: various zcl utilities](#moduleREST 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](#moduleREST API various zcl utilities)
| Param | Type |
|---|---|
| db | * |
| type | * |
| packageIds | * |
Kind: inner method of [REST API: various zcl utilities](#moduleREST API various zcl utilities)
Returns: The size and sign of a zcl data type
| Param | Type |
|---|---|
| type | * |
| dataType | * |
| clusterId | * |
| packageIds | * |
| context | * |
Copyright (c) 2020 Silicon Labs
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Global symbol that carries the API info metadata
Global function that can execute the APIs.
Global function that can be overloaded by jxbrowser for notifications
Copyright (c) 2020 Silicon Labs
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
This module provides queries for discriminators
This module provides queries for data types
This module provides queries for numbers
This module provides queries for strings
Copyright (c) 2020 Silicon Labs
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 Silicon Labs
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 Silicon Labs
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2021 Silicon Labs
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 Silicon Labs
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2021 Silicon Labs
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 Silicon Labs
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 Silicon Labs
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 Silicon Labs
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 Silicon Labs
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 Silicon Labs
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 Silicon Labs
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 Silicon Labs
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 Silicon Labs
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 Silicon Labs
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 Silicon Labs
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 Silicon Labs
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
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.
This module provides API to access various iterator utilities that can then be used to build iterator helpers.
Copyright (c) 2022 Silicon Labs
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 Silicon Labs
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
This module provides the APIs for validating inputs to the database, and returning flags indicating if things were successful or not.
Copyright (c) 2020 Silicon Labs
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 Silicon Labs
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 Silicon Labs
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Kind: global function
Returns: all the data type discriminator information
| Param | Type |
|---|---|
| db | * |
| packageIds | * |
Gathers the data type information of an entry based on data type id along with its actual type from disciminator table.
Kind: global function
Returns: Data type information
| Param |
|---|
| db |
| id |
Gathers the data type information of an entry based on data type name along with its actual type from disciminator table.
Kind: global function
Returns: Data type information
| Param |
|---|
| db |
| name |
| packageIds |
Gathers the data type information based on data type name and clusterId along with its actual type from disciminator table.
Kind: global function
Returns: Data type information
| Param |
|---|
| db |
| name |
| clusterId |
| packageIds |
Gathers All the data types
Kind: global function
Returns: All data types
| Param |
|---|
| db |
| packageId |
Return the size of the given value whether it be a reference to it in the data type table in the form of a number or be it the name of the type in the form if string.
Kind: global function
Returns: The size of the given value
| Param | Type |
|---|---|
| db | * |
| packageIds | * |
| value | * |
Select an number matched by name.
Kind: global function
Returns: number or undefined
| Param |
|---|
| db |
| name |
| packageIds |
Select a number matched by name and clusterId
Kind: global function
Returns: number information or undefined
| Param |
|---|
| db |
| name |
| packageIds |
Select an number matched by id.
Kind: global function
Returns: number or undefined
| Param |
|---|
| db |
| name |
Select all numbers.
Kind: global function
Returns: All numbers
| Param |
|---|
| db |
| packageId |
Select all Strings.
Kind: global function
Returns: All Strings
| Param |
|---|
| db |
| packageId |
Select String by ID.
Kind: global function
Returns: String
| Param |
|---|
| db |
| packageId |
Select String by name.
Kind: global function
Returns: String
| Param |
|---|
| db |
| name |
| packageIds |
Valid within a cluster context, requires code.
Kind: global function
Returns: Produces attribute defaults.
Kind: global function
| 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: global function
Returns: Returns content in the handlebar template based on whether the command arguments are present or not.
| Param |
|---|
| commandId |
| options |
Kind: global function
Returns: trueReturn if command argument is always present and there is a presentIf condition else returns false
| Param |
|---|
| commandArg |
| trueReturn |
| falseReturn |
If helper that checks if a command argument is always present with a presentIf condition. example: {{#if_command_arg_always_present_with_presentif commandArg}} command argument has a presentIf condition {{else}} command argument does not have a presentIf condition {{/if_command_arg_always_present_with_presentif}}
Kind: global function
Returns: Returns content in the handlebar template based on the command argument having a presentIf condition or not
| Param |
|---|
| commandArg |
| options |
Kind: global function
Returns: trueReturn if command is not fixed length but command argument is always present else returns falseReturn
| Param |
|---|
| command |
| commandArg |
| trueReturn |
| falseReturn |
If helper that checks if command is not fixed lenth and that the command is always present. example: {{#if_command_not_fixed_length_command_argument_always_present commandId}} command is not fixed length and command argument is always present {{else}} either command is fixed length or command argument is not always present {{/if_command_not_fixed_length_command_argument_always_present}}
Kind: global function
Returns: Returns content in the handlebar template based on the command being fixed length or not and whether the command argument is always present
| Param |
|---|
| command |
| commandArg |
| options |
Kind: global function
Returns: trueReturn if command argument is not always present and there is no presentIf condition else returns false
| Param |
|---|
| commandArg |
| trueReturn |
| falseReturn |
If helper that checks if a command argument is not always present because it has a introduced in or removed in clause. The helper also checks that there is no presentIf condition. example: {{#if_command_arg_not_always_present_no_presentif commandArg}} command argument is not always present and there is no presentIf condition {{else}} Either command argument is always present or there is a presentIf condition {{/if_command_arg_not_always_present_no_presentif}}
Kind: global function
Returns: Returns content in the handlebar template based on the command argument being present and if there is a presentIf condition.
| Param |
|---|
| commandArg |
| options |
Kind: global function
Returns: trueReturn if command argument is not always present and there is a presentIf condition else returns false
| Param |
|---|
| commandArg |
| trueReturn |
| falseReturn |
If helper that checks if a command argument is not always present because it has a introduced in or removed in clause. The helper also checks that there is a presentIf condition. example: {{#if_command_arg_not_always_present_with_presentif commandArg}} command argument is not always present and there is a presentIf condition {{else}} Either command argument is always present or there is no presentIf condition {{/if_command_arg_not_always_present_with_presentif}}
Kind: global function
Returns: Returns content in the handlebar template based on the command argument being present and if there is a presentIf condition.
| Param |
|---|
| commandArg |
| options |
Kind: global function
| 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: global function
| 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. |
Returns number of endpoint types.
Kind: global function
Returns: number of endpoint types
| Param | Type |
|---|---|
| options | * |
Returns number of endpoints.
Kind: global function
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: global function
Returns: Macros that need to be created
Creates array of endpointId fields on endpoints
Kind: global function
Returns: C array including the brackets
| Param | Type |
|---|---|
| options | * |
Creates array of profileId fields on endpoints
Kind: global function
Returns: C array including the brackets
| Param | Type |
|---|---|
| options | * |
Creates array of networkId fields on endpoints
Kind: global function
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: global function
Returns: C array of indexes, one for each endpoint.
| Param | Type |
|---|---|
| options | * |
Generates array of { index , mfgCode } pairs, matching the indexes in attribute table.
Kind: global function
Returns: manufacturer code array
| 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: global function
| Param | Type |
|---|---|
| options | * |
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.
This function goes over all the attributes and populates sizes.
Kind: global function
Returns: promise that resolves with the passed endpointTypes, after populating the attribute type sizes.
| Param | Type |
|---|---|
| db | * |
| zclPackageIds | * |
| endpointTypes | * |
This function goes over all attributes and populates atomic types.
Kind: global function
Returns: promise that resolves with the passed endpointTypes, after populating the attribute atomic types.
| Param | Type |
|---|---|
| db | * |
| zclPackageIds | * |
| endpointTypes | * |
Starts the endpoint configuration block., longDefaults: longDefaults
Kind: global function
Returns: a promise of a rendered block
| Param | Type |
|---|---|
| options | * |
Block helper resolving the block if the value of the specified future matches.
Kind: global function
| Param | Type |
|---|---|
| options | * |
This method sets the value of the future. Use it as: {{set_future name=“NAME” value=“VALUE”}}
Kind: global function
| Param | Type |
|---|---|
| options | * |
This method defines the future with a given name. Use it as: {{future name=“NAME”}}
Kind: global function
| Param | Type |
|---|---|
| options | * |
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.
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.
Util function that extracts all the token attribute information.
Kind: global function
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: global function
Returns: singleton and non-singleton token attributes along with their endpoint information. Singleton attributes are only returned once whereas non-singleton attributes are returned per endpoint. However if used within an endpoint block helper it returns token_attributes for a given endpoint type.
| 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: global function
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:
Kind: global function
Returns: all endpoints with token attributes
| Param | Type |
|---|---|
| options | * |
Kind: global function
Returns: The size in bits for a cli type based on allowZclTypes
| Param | Type |
|---|---|
| size | * |
| type | * |
| allowZclTypes | * |
Kind: global function
Returns: the zcl cli data type string with the cli prefix given Additional Options:
| Param | Type |
|---|---|
| type | * |
| cliPrefix | * |
| context | * |
| options | * |
Helper that deals with the type of the argument.
Kind: global function
| Param | Type |
|---|---|
| typeName | * |
| options | * |
Helper that deals with the type of the argument.
Kind: global function
| Param | Type |
|---|---|
| typeName | * |
| options | * |
Resolves to an array of endpoint types.
Kind: global function
Returns: Promise to retrieve all endpoint types.
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Resolves with data for packages.
Kind: global function
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Toplevel file that takes a given session ID and exports the data into the file
Kind: global function
Returns: A promise that resolves with the path of the file written.
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
| filePath | * |
Given a database and a session id, this method returns a promise that resolves with a state object that needs to be saved into a file.
Kind: global function
Returns: state object that needs to be saved into a file.
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
Locates or adds an attribute, and returns it. at contains clusterId, attributeId, isClient, mfgCode and possibly value
Kind: global function
| Param | Type |
|---|---|
| state | * |
Parses attribute string in a form: cl:0xABCD, at:0xABCD, di: [client|server], mf:0xABCD
Kind: global function
| Param | Type | Default |
|---|---|---|
| attributeString | * | |
| [value] | * |
Logic that parses data out of an ISC file into a java object
Kind: global function
| Param | Type |
|---|---|
| state | * |
| line | * |
Function that deals with the zcl customizer data inside the ISC file
Kind: global function
| Param | Type |
|---|---|
| state | * |
| line | * |
Toplevel parser that ignore anything except the two setups that are ZCL relevant.
Kind: global function
Returns: promise of read ISC data
| Param | Type |
|---|---|
| filePath | * |
| data | * |
Load individual endpoint types.
Kind: global function
| Param | Type | Description |
|---|---|---|
| db | * | |
| sessionId | * | |
| zclPackages | * | Array of package IDs for zcl queries. |
| endpointType | * |
Loads all implemented commands for a single endpoint.
Kind: global function
| Param | Type |
|---|---|
| db | * |
| zclPackageId | * |
| state | * |
| commandExtensions | * |
| endpointTypeId | * |
This method goes over the endpoint type and the state, and enables commands that belong to enabled clusters and are listed in the commandExtensions as “implemented”.
Kind: global function
| Param | Type |
|---|---|
| db | * |
| zclPackageId | * |
| state | * |
| commandExtensions | * |
| endpointTypeIdArray | * |
This method resolves promises that contain all the queries that are needed to load the attribute state
Kind: global function
| Param | Type |
|---|---|
| db | * |
| state | * |
| sessionId | * |
This method resolves promises that contain all the queries that are needed to load the attribute state
Kind: global function
| Param | Type |
|---|---|
| db | * |
| state | * |
| sessionId | * |
Loads the session key values from the keyValues object
Kind: global function
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
| keyValues | * |
Function that actually loads the data out of a state object. Session at this point is blank, and has no packages.
Kind: global function
| Param | Type |
|---|---|
| db | * |
| state | * |
| sessionId | * |
Resolves with a promise that imports session key values.
Kind: global function
| Param | Type |
|---|---|
| db | * |
| sessionId | * |
| keyValuePairs | * |
Auto-load package. If succesful it returns an object. Otherwise it throws an exception.
Kind: global function
Returns: object containing packageId and packageType.
| Param | Type |
|---|---|
| db | * |
| pkg | * |
| absPath | * |
Convert the array of results into a more palatable value. Resolves an array of { packageId:, packageType:} objects into { zclPackageId: id, templateIds: [] }
Kind: global function
Returns: an object that contains session ids.
| Param | Type |
|---|---|
| data | * |
Given a state object, this method returns a promise that resolves with the succesfull writing into the database.
Kind: global function
Returns: a promise that resolves into a sessionId that was created.
| Param | Type | Description |
|---|---|---|
| db | * | |
| state | * | |
| sessionId | * | If null, then new session will get created, otherwise it loads the data into an existing session. Previous session data is not deleted. |
| packageMatch | * | One of the package match strategies. See dbEnum.packageMatch |
Parses JSON file and creates a state object out of it, which is passed further down the chain.
Kind: global function
Returns: Promise of parsed JSON object
| Param | Type |
|---|---|
| filePath | * |
| data | * |
Reads the data from the file and resolves with the state object if all is good.
Kind: global function
Returns: Promise of file reading.
| Param | Type |
|---|---|
| filePath | * |
Writes the data from the file into a new session. NOTE: This function does NOT initialize session packages.
Kind: global function
Returns: a promise that resolves with the import result object that contains: sessionId, errors, warnings.
| Param | Type |
|---|---|
| db | * |
| filePath | * |
Start session specific validation.
Deinitalize all validation timers associated with a specific session.
Kind: global function
| Param |
|---|
| db |
| session |
Start up application in a normal mode.
Kind: global function
| Param | Type | Description |
|---|---|---|
| uiEnabled | * | |
| showUrl | * | |
| uiMode | * | |
| zapFiles | * | An array of .zap files to open, can be empty. |
Returns the output file out of input file and a pattern
Kind: global function
Returns: the path to the output file.
| Param | Type |
|---|---|
| inputFile | * |
| outputPattern | * |
This method gathers all the files to process.
Kind: global function
| Param | Type | Description |
|---|---|---|
| filesArg | * | array of files arguments |
| options | * |
Perform file conversion.
Kind: global function
| Param | Type |
|---|---|
| files | * |
| output | * |
Performs a full SDK regeneration.
Kind: global function
| Param | Type |
|---|---|
| argv | * |
| options | * |
Perform file analysis.
Kind: global function
| Param | Type | Default | Description |
|---|---|---|---|
| paths | * | List of paths to analyze | |
| [options] | boolean | { log: true, quit: true } |
Starts zap in a server mode.
Kind: global function
Returns: promise of a startup
| Param | Type |
|---|---|
| options | * |
Start up applicationa in self-check mode.
Performs headless regeneration for given parameters.
Kind: global function
Returns: Nothing, triggers quit function
Move database file out of the way into the backup location.
Kind: global function
| Param | Type |
|---|---|
| path | * |
Shuts down any servers that might be running.
Startup method for the secondary instance.
Kind: global function
| Param | Type |
|---|---|
| argv | * |
Default startup method.
Kind: global function
| Param | Type |
|---|---|
| quitFunction | * |
| argv | * |
Perform a file->open operation.
Kind: global function
| Param | Type |
|---|---|
| menuItem | * |
| browserWindow | * |
| event | * |
Perform a save, defering to save as if file is not yet selected.
Kind: global function
| Param | Type |
|---|---|
| browserWindow | * |
Perform save as.
Kind: global function
| Param | Type |
|---|---|
| menuItem | * |
| browserWindow | * |
| event | * |
perform the save.
Kind: global function
Returns: Promise of saving.
| Param | Type |
|---|---|
| db | * |
| browserWindow | * |
| filePath | * |
Perform the do open action, possibly reading in multiple files.
Kind: global function
| Param | Type |
|---|---|
| db | * |
| filePaths | * |
Toggling of menu
Kind: global function
| Param | Type |
|---|---|
| port | * |
Initial menu show.
Kind: global function
| Param | Type |
|---|---|
| httpPort | * |
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.
Start session specific validation.
Promises to read the properties file, extract all the actual xml files, and resolve with the array of files.
Kind: global function
Returns: Promise of resolved files.
| Param | Type | Description |
|---|---|---|
| ctx | * | Context which contains information about the metadataFiles and 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: global function
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: global function
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: global function
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: global function
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: global function
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: global function
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: global function
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 bitmap object for insertion into the DB
Kind: global function
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: global function
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: global function
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 xml types into the types object for insertion into the DB
Kind: global function
| 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: global function
| 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: global function
Returns: an object containing the prepared device types.
| Param | Type |
|---|---|
| deviceType | * |
Prepare Data Type Discriminator for database table insertion.
Kind: global function
Returns: An Object
| Param | Type |
|---|---|
| a | * |
Processes Data Type Discriminator.
Kind: global function
Returns: Promise of inserted Data Type Discriminators.
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| zclDataTypes | * |
Prepare Data Types for database table insertion.
Kind: global function
Returns: An Object
| Param | Type |
|---|---|
| a | * |
| dataType | * |
| typeMap | * |
Processes Data Type.
Kind: global function
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: global function
Returns: An Object
| Param | Type |
|---|---|
| a | * |
| dataType | * |
Processes Numbers.
Kind: global function
Returns: Promise of inserted numbers into the number table.
| Param | Type |
|---|---|
| db | * |
| filePath | * |
| packageId | * |
| data | * |
Prepare strings for database table insertion.
Kind: global function
Returns: An Object
| Param | Type |
|---|---|
| a | * |
| dataType | * |
Processes Strings.
Kind: global function
Returns: Promise of inserted strings into the String table.
| Param | Type |
|---|---|
| db | * |
| filePath | * |
| packageId | * |
| data | * |
Prepare enums or bitmaps for database table insertion.
Kind: global function
Returns: An Object
| Param | Type |
|---|---|
| a | * |
| dataType | * |
Processes the enums.
Kind: global function
Returns: A promise of inserted enums.
| Param | Type |
|---|---|
| db | * |
| filePath | * |
| packageId | * |
| data | * |
Processes the enum Items.
Kind: global function
Returns: A promise of inserted enum items.
| Param | Type |
|---|---|
| db | * |
| filePath | * |
| packageId | * |
| data | * |
Processes the bitmaps.
Kind: global function
Returns: A promise of inserted bitmaps.
| Param | Type |
|---|---|
| db | * |
| filePath | * |
| packageId | * |
| data | * |
Processes the bitmap fields.
Kind: global function
Returns: A promise of inserted bitmap fields.
| Param | Type |
|---|---|
| db | * |
| filePath | * |
| packageId | * |
| data | * |
Prepare structs for database table insertion.
Kind: global function
Returns: An Object
| Param | Type |
|---|---|
| a | * |
| dataType | * |
Processes the structs.
Kind: global function
Returns: A promise of inserted structs.
| Param | Type |
|---|---|
| db | * |
| filePath | * |
| packageId | * |
| data | * |
Processes the struct Items.
Kind: global function
Returns: A promise of inserted struct items.
| Param | Type |
|---|---|
| db | * |
| filePath | * |
| packageId | * |
| data | * |
Prepare enums or bitmaps for database table insertion.
Kind: global function
Returns: An Object
| Param | Type |
|---|---|
| a | * |
| dataType | * |
Processes the enums.
Kind: global function
Returns: A promise of inserted enums.
| Param | Type |
|---|---|
| db | * |
| filePath | * |
| packageId | * |
| data | * |
Processes the bitmaps.
Kind: global function
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: global function
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: global function
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: global function
Returns: a Promise that resolves with the db.
| Param | Type | Description |
|---|---|---|
| db | * | |
| ctx | * | Context of loading. |
Promises to read the JSON file and resolve all the data.
Kind: global function
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: global function
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: global function
Returns: bool or corresponding enum
| Param | Type |
|---|---|
| mask | * |
Prepare atomic to db insertion.
Kind: global function
| Param | Type |
|---|---|
| a | * |
Processes atomic types for DB insertion.
Kind: global function
Returns: Promise of inserted bitmaps
| Param | Type |
|---|---|
| db | * |
| filePath | * |
| packageId | * |
| data | * |
Prepares global attribute data.
Kind: global function
Returns: Object containing the data from XML.
| Param | Type |
|---|---|
| cluster | * |
Prepare XML cluster for insertion into the database. This method can also prepare clusterExtensions.
Kind: global function
Returns: Object containing all data from XML.
| Param | Type |
|---|---|
| cluster | * |
Process clusters for insertion into the database.
Kind: global function
Returns: Promise of cluster insertion.
| Param | Type |
|---|---|
| db | * |
| filePath | * |
| packageId | * |
| data | * |
Processes global attributes for insertion into the database.
Kind: global function
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: global function
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: global function
Returns: promise to resolve the globals
| Param | Type |
|---|---|
| db | * |
| filePath | * |
| packageId | * |
| data | * |
Process defaultAccess tag in the XML.
Kind: global function
| Param | Type |
|---|---|
| db | * |
| filePath | * |
| packageId | * |
| defaultAccessList | * |
Process accessControl tag in the XML.
Kind: global function
| Param | Type |
|---|---|
| db | * |
| filePath | * |
| packageId | * |
| accessControlList | * |
Processes the tags in the XML.
Kind: global function
| Param | Type |
|---|---|
| db | * |
| filePath | * |
| packageId | * |
| tags | * |
Convert domain from XMl to domain for DB.
Kind: global function
Returns: Domain object for DB.
| Param | Type |
|---|---|
| domain | * |
Process domains for insertion.
Kind: global function
Returns: Promise of database insertion of domains.
| Param | Type |
|---|---|
| db | * |
| filePath | * |
| packageId | * |
| data | * |
Prepare Data Type Discriminator for database table insertion.
Kind: global function
Returns: An Object
| Param | Type |
|---|---|
| a | * |
Processes Data Type Discriminator.
Kind: global function
Returns: Promise of inserted Data Type Discriminators.
| Param | Type |
|---|---|
| db | * |
| filePath | * |
| zclDataTypes | * |
Prepare Data Types for database table insertion.
Kind: global function
Returns: An Object
| Param | Type |
|---|---|
| a | * |
| dataType | * |
| typeMap | * |
Processes Data Type.
Kind: global function
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: global function
Returns: An Object
| Param | Type |
|---|---|
| a | * |
| dataType | * |
Processes Numbers.
Kind: global function
Returns: Promise of inserted numbers into the number table.
| Param | Type |
|---|---|
| db | * |
| filePath | * |
| packageId | * |
| knownPackages | * |
| data | * |
Prepare strings for database table insertion.
Kind: global function
Returns: An Object
| Param | Type |
|---|---|
| a | * |
| dataType | * |
Processes Strings.
Kind: global function
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: global function
Returns: An Object
| Param | Type |
|---|---|
| a | * |
| dataType | * |
Processes the enums.
Kind: global function
Returns: A promise of inserted enums.
| Param | Type |
|---|---|
| db | * |
| filePath | * |
| packageId | * |
| knownPackages | * |
| data | * |
Prepare enums or bitmaps for database table insertion.
Kind: global function
Returns: An Object
| Param | Type |
|---|---|
| a | * |
| dataType | * |
Processes the enums.
Kind: global function
Returns: A promise of inserted enums.
| Param | Type |
|---|---|
| db | * |
| filePath | * |
| packageId | * |
| knownPackages | * |
| data | * |
Processes the enum Items.
Kind: global function
Returns: A promise of inserted enum items.
| Param | Type |
|---|---|
| db | * |
| filePath | * |
| packageId | * |
| knownPackages | * |
| data | * |
Processes the bitmaps.
Kind: global function
Returns: A promise of inserted bitmaps.
| Param | Type |
|---|---|
| db | * |
| filePath | * |
| packageId | * |
| knownPackages | * |
| data | * |
Processes the bitmaps.
Kind: global function
Returns: A promise of inserted bitmaps.
| Param | Type |
|---|---|
| db | * |
| filePath | * |
| packageId | * |
| knownPackages | * |
| data | * |
Processes the bitmap fields.
Kind: global function
Returns: A promise of inserted bitmap fields.
| Param | Type |
|---|---|
| db | * |
| filePath | * |
| packageId | * |
| knownPackages | * |
| data | * |
Prepare structs for database table insertion.
Kind: global function
Returns: An Object
| Param | Type |
|---|---|
| a | * |
| dataType | * |
Processes the structs.
Kind: global function
Returns: A promise of inserted structs.
| Param | Type |
|---|---|
| db | * |
| filePath | * |
| packageId | * |
| knownPackages | * |
| data | * |
Processes the struct Items.
Kind: global function
Returns: A promise of inserted struct items.
| Param | Type |
|---|---|
| db | * |
| filePath | * |
| packageIds | * |
| data | * |
Preparation step for the device types.
Kind: global function
Returns: an object containing the prepared device types.
| Param | Type |
|---|---|
| deviceType | * |
Process all device types.
Kind: global function
Returns: Promise of a resolved device types.
| Param | Type |
|---|---|
| db | * |
| filePath | * |
| packageId | * |
| data | * |
After XML parser is done with the barebones parsing, this function branches the individual toplevel tags.
Kind: global function
Returns: promise that resolves when all the subtags are parsed.
| Param | Type |
|---|---|
| db | * |
| argument | * |
This function is used for parsing each individual ZCL file at a grouped zcl file package level. This should not be used for custom XML addition due to custom xmls potentially relying on existing packges.
Kind: global function
Returns: A promise for when the last stage of the loading pipeline finishes.
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| 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: global function
Returns: Promise that resolves when all the individual promises of each file pass.
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| zclFiles | * |
| context | * |
Parses the manufacturers xml.
Kind: global function
Returns: Promise of a parsed manufacturers file.
| Param | Type |
|---|---|
| db | * |
| ctx | * |
Parses the profiles xml.
Kind: global function
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: global function
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: global function
Returns: Promise that loads the uiOptions object into the database.
| Param | Type |
|---|---|
| db | * |
| packageId | * |
| featureFlags | * |
Parses and loads the text and boolean options.
Kind: global function
Returns: promise of parsed options
| Param | Type |
|---|---|
| db | * |
Parses the text options.
Kind: global function
Returns: Promise of a parsed text options.
| Param | Type |
|---|---|
| db | * |
| pkgRef | * |
| textOptions | * |
Parses the boolean options.
Kind: global function
Returns: Promise of a parsed boolean options.
| Param | Type |
|---|---|
| db | * |
| pkgRef | * |
| booleanCategories | * |
Parses the default values inside the options.
Kind: global function
Returns: Promised of parsed text and bool defaults.
| Param | Type |
|---|---|
| db | * |
| ctx | * |
Parses a single file. This function is used specifically for adding a package through an existing session because of its reliance on relating the new XML content to the packages associated with that session. e.g. for ClusterExtensions.
Kind: global function
Returns: Promise of a loaded file.
| Param | Type |
|---|---|
| db | * |
| filePath | * |
If custom device is supported, then this method creates it.
Kind: global function
Returns: context
| Param | Type |
|---|---|
| db | * |
| ctx | * |
Toplevel function that loads the toplevel metafile and orchestrates the promise chain.
Kind: global function
Returns: a Promise that resolves with the db.
| Param | Type | Description |
|---|---|---|
| db | * | |
| ctx | * | The context of loading. |
Records the toplevel package information and resolves into packageId
Kind: global function
Returns: packageId
| Param | Type |
|---|---|
| db | * |
| metadataFile | * |
| crc | * |
Records the version into the database.
Kind: global function
| Param | Type |
|---|---|
| db | * |
| ctx | * |
Toplevel function that loads the zcl file and passes it off to the correct zcl loader.
Kind: global function
Returns: Array of loaded packageIds.
| Param | Type | Description |
|---|---|---|
| db | * | |
| metadataFile | * | array of paths |
Loads individual zcl.json metafile.
Kind: global function
Returns: Context object that contains .db and .packageId
| Param | Type |
|---|---|
| db | * |
| metadataFile | * |
Load individual custom XML files.
Kind: global function
| 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: global function
Returns: Promise that resolves int he object of data.
| Param | Type |
|---|---|
| db | * |
| info | * |
| parentPackageId | * |
Promises to perform a post loading step.
Kind: global function
Returns: Promise to deal with the post-loading cleanup.
| Param | Type |
|---|---|
| db | * |
Kind: global function
Returns: data type discriminator map
| Param | Type |
|---|---|
| db | * |
| packageIds | * |