Skip to content
This repository has been archived by the owner on Jul 5, 2019. It is now read-only.

Commit

Permalink
Make Z-Stack 3 compatible. Koenkk/zigbee2mqtt#211
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Apr 7, 2019
1 parent 15273fa commit 8f4d6ff
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lib/ccznp.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var MT = {
UTIL: zmeta.UTIL,
DBG: zmeta.DBG,
APP: zmeta.APP,
DEBUG: zmeta.DEBUG
APP_CNF: zmeta.APP_CNF
};

/*************************************************************************************************/
Expand Down Expand Up @@ -217,7 +217,7 @@ CcZnp.prototype.sendCmd = function (type, subsys, cmdId, payload) {
/*** Create Request Shorthands ***/
/*********************************/
// example: ccznp.sysRequest(), ccznp.zdoRequest()
var namespaces = [ 'SYS', 'MAC', 'NWK', 'AF', 'ZDO', 'SAPI', 'UTIL', 'DBG', 'APP', 'DEBUG' ];
var namespaces = [ 'SYS', 'MAC', 'NWK', 'AF', 'ZDO', 'SAPI', 'UTIL', 'DBG', 'APP', 'APP_CNF' ];

namespaces.forEach(function (subsys) {
var reqMethod = subsys.toLowerCase() + 'Request';
Expand Down
8 changes: 5 additions & 3 deletions lib/defs/zmt_defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"UTIL": 7,
"DBG": 8,
"APP": 9,
"DEBUG": 15
"APP_CNF": 15
},
"ParamType": {
"uint8": 0,
Expand Down Expand Up @@ -287,7 +287,9 @@
"userTest": 1,
"zllTlInd": 129
},
"DEBUG": {
"bdbStartCommissioning": 5
"APP_CNF": {
"bdbStartCommissioning": 5,
"bdbSetChannel": 8,
"bdbComissioningNotifcation": 128
}
}
35 changes: 34 additions & 1 deletion lib/defs/zpi_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -5073,7 +5073,7 @@
}
}
},
"DEBUG": {
"APP_CNF": {
"bdbStartCommissioning": {
"type": 1,
"cmdId": 5,
Expand All @@ -5089,6 +5089,39 @@
}
]
}
},
"bdbSetChannel": {
"type": 1,
"cmdId": 8,
"params": {
"req": [
{
"isPrimary": 0,
"channel": 2
}
],
"rsp": [
{
"status": 0
}
]
}
},
"bdbComissioningNotifcation": {
"type": 2,
"cmdId": 128,
"params": {
"req": [
{
"status": 0
}
],
"rsp": [
{
"status": 0
}
]
}
}
}
}
4 changes: 2 additions & 2 deletions lib/zmeta.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var zmeta = {
UTIL: new Enum(zmtDefs.UTIL),
DBG: new Enum(zmtDefs.DBG),
APP: new Enum(zmtDefs.APP),
DEBUG: new Enum(zmtDefs.DEBUG)
APP_CNF: new Enum(zmtDefs.APP_CNF)
};

zmtDefs.CmdType = null;
Expand All @@ -33,7 +33,7 @@ zmtDefs.SAPI = null;
zmtDefs.UTIL = null;
zmtDefs.DBG = null;
zmtDefs.APP = null;
zmtDefs.DEBUG = null;
zmtDefs.APP_CNF = null;
zmtDefs = null;

zmeta.get = function (subsys, cmd) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"debug": "^4.1.1",
"enum": "^2.5.0",
"serialport": "^7.1.4",
"unpi": "^1.1.0"
"unpi": "git+https://github.com/Koenkk/unpi.git#326cff30c2abea444b807b69f4bc367567aae966"
},
"devDependencies": {
"chai": "^4.2.0",
Expand Down

0 comments on commit 8f4d6ff

Please sign in to comment.