zblevel.m

来自「在matlab实现的zigbee源代码」· M 代码 · 共 17 行

M
17
字号
function [level, child] = zblevel(Cm, Lm, id)
% return the level of id in the ZigBee tree, and it is the 'child'th child of its parent

if id == 0
    level = 0;
    child = 1;
    return
end
i=1;
while(mod(id-1, cskip(Cm, Lm, i)))
    id=mod(id-1, cskip(Cm, Lm, i));
    i=i+1;            
end
level = i;
child = floor((id-1)/cskip(Cm, Lm, i)) + 1;
return

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?