ZigBee3.0_JENNIC-JN516x-ZigBeeBaseDevice_20170604_1.0

来源:互联网 发布:淘宝马云靠什么赚钱 编辑:程序博客网 时间:2024/06/05 21:02

ZigBee Base Device

所有节点都必须有的基础功能,协调节点之间的行为,与网络创建、加入以及网络安全相关。

1.1 Initialising and starting the ZigBee Base Device

在初始化ZigBee PRO stack以及从persistent storage(固存)中恢复ZigBee Base Device attribute bbdbNodeIsOnANetwork后,调用BDB_vInit()函数初始化。ZBD的相关事件推送到回调函数

APP_vBdbCallback()中。

NOTEZigBee BaseDevice需要提前注册BDB_ZTIMER以保证,ZBD正常运行。

1.1.1 If the node was not in a network:

  1. 对于支持Touchlink commissioningRouter,根据BDBC_TL_PRIMARY_CHANNEL_SET或者RAND_CHANNEL的设置选择一个channel。对于Co-ordinator、其他Router以及End Device则没有动作。
  1.  尝试建网或加入网络。
  2. 生成BDB_EVENT_INT_SUCCESS事件。

1.1.2 if the node was in a network

  1. 对于Co-ordinator Router没有动作,生成BDB_EVENT_INT_SUCCESS事件。
  2. 对于End Device尝试rejoin networkrejoin cycles如下:
    1. 尝试之前的网络参数,不带network discovery
    2. 尝试network discovery,用u32bdbPrimaryChannelSet指定的primary channel
    3. 尝试network discoveryu32bdbSecondaryChannelSet指定的secondary channel

通过BDBC_IMP_MAX_REJOIN_CYCLES指定rejoin cycles的次数。

如果rejoin attempt成功,返回BDB_EVENT_REJOIN_SUCCESS,如果不成功,返回BDB_EVENT_REJOIN_FAILURE

1.2 Network Commissioning

Network commissioning的动作如下:

  1. Creating a newtork;
  2. Allowing devices to join the network;
  3. Joining a network;
  4. Binding a local endpoint to an endpoint on a remote node;
  5. Adding a remote node to a group;

Commissioning activitiesZigBee node 类型决定;

ZigBee Base Device提供了4commissioning modes,如下:

  1. Touchlink
    1. Creating a new network;
    2. Allowing other devices to join an existing network;
    3. Joining local device to an existing network;
  1. Network Steering:
    1. Allowing other devices to join an existing network;
    2. Joining local device to an existing network;
  2. Network Formation:
    1. Creating a new network;
  3. Finding and Binding:
    1. Binding a local endpoint to an endpoint on a remote node;
    2. Adding a remote node to a group;

Commissioning modes可以通过attributeu8bdbCommissioningMode设置,通过attribute ebdbCommissioningStatus来看当前的state

原创粉丝点击