Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to assign to correct models without ieee address #1

Open
amigomcu opened this issue Apr 21, 2017 · 0 comments
Open

how to assign to correct models without ieee address #1

amigomcu opened this issue Apr 21, 2017 · 0 comments

Comments

@amigomcu
Copy link

hi all,
i study this project, zigbee-demo to build self product now.
how to create a model without the models ieee address,
and the server app on zigbee znp.

how to assign to correct models when know the models information(endpoint id, device id ,in/out cluster and att id).

it seem need know device ieee address to read/write action(server.js),*1 and
build models(models.js)*2

*1:
ioServer.regReqHdlr('write', function (args, cb) {
var auxId = _.split(args.auxId, '/'), // [ epId, cid, rid ]
ieeeAddr = args.permAddr,
epId = parseInt(auxId[0]),
cid = auxId[2],
val = args.value,
ep = shepherd.find(ieeeAddr, epId);

    if (ieeeAddr === '0x00124b0001ce1003') {
        // ep.functional = model.functional;
        toggleDev(ep, cid, val);
    } else if (cid === 'genOnOff') {
        var cmd = val ? 'on' : 'off';
        ep.functional('genOnOff', cmd, {}, function (err, rsp) {});

}

*2.
var weatherDevInfo = {
type: 'EndDevice',
ieeeAddr: '0x00124b0001ce1001',
nwkAddr: 1,
manufId: 0,
epList: [ 1, 2 ],
endpoints: {
1: { // temperature
profId: 0x0104, epId: 1, devId: 770, inClusterList: [ 1026 ], outClusterList: [],
clusters: { msTemperatureMeasurement: { dir: 1, attrs: { measuredValue: 0 } } }
},
2: { // humidity
profId: 0x0104, epId: 2, devId: 770, inClusterList: [ 1029 ], outClusterList: [],
clusters: { msRelativeHumidity : { dir: 1, attrs: { measuredValue: 0 } } }
}
}
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant