About four ways to bind ZigBee

Source: Internet
Author: User

Binding is a very important concept in ZigBee, presumably we have read a lot of articles, including "ZigBee four kinds of binding method in the Ti_z-stack protocol stack application" most typical, this article I also read several times, receiving quite abundant. In addition to the Feibit forum also has a post explaining the enddevicebinding of the pain of the transmission mechanism, analysis is also quite thorough. I'm not here. To explain the specific binding methods of the code implementation and mechanism, but simply explain the characteristics of various binding mechanisms, I hope that we can from the application level of conceptual and understanding of the binding, and then for various mechanisms of application scenarios for example.
One, the binding method again explains
Four ways to bind ZigBee:
1, two nodes call zdp_enddevicebindreq function by key mechanism respectively
That is: in a certain period of time two nodes through the key (other ways can also) trigger call this function
Features: This function call will be issued to the coordinator binding request (how to call and parameter settings see protocol stack related code), if the 16S (protocol stack default) time two nodes have executed this function, the Coordinator will help to implement the binding, the code of this process is very complex, I do not want to say. Binding table should be present Outcluster yonder, that is, these two nodes should be an output control command, a receive control command, the binding table exists output control command side, as to how to achieve, interested students can continue to study the code.
Note: This method must need the coordinator, otherwise, but once the binding succeeds, the coordinator is no longer needed, the coordinator is only a third party to help bind; Although called Enddevicebind, but not limited to end Device, the router also uses; repeating the above operation will unbind That means it's a ping-pong way.
2. Match mode
That is, a node can allow or disallow this node to be match by calling the Afsetmatch function (the protocol stack is allowed by default, it can be manually closed), and then another node initiates a ZDP_MATCHDESCREQ request within a certain amount of time, allowing the match node to respond to this req , the originating node automatically handles the binding when it receives the RSP.
Features: No need to help, as long as the nodes in the network can be achieved between each other, but the premise is that they must match, that is, one side of the Outcluster is the other side of the Incluster, this way in many cases used more convenient.
Note: If you have multiple nodes at the same time (same as multiple endpoints on one node) in the Allow match state, then this node of req may receive a lot of RSP that satisfies the match condition, so the node you are initiating req to work on.
3, Zdp_bindreq and Zdp_unbindreq Way
That is, it is interesting that an application implements binding and binding by invoking these two functions. Specifically, in order for A and B to be bound together, a node C is also required. For example: You want A to control B, then this way is issued by C bind or unbind command to a (to who on the processing of bindings, and responsible for storing the binding table), a when receiving the Req directly processing the binding, that is, adding the binding table entry, and this process B is not known. But a knows that the binding table has a record of control B, and this way it can implement a node bound to a group.
Note: This method needs to know the long address of A and B, the specific protocol stack to take the long address what to do with, interested in digging the code well.
4. Manually Manage binding tables
That is, the application calls such as bindaddentry (defined in the BindingTable.h file by the function, the implementation is encapsulated) to implement manual binding table management, this mode of freedom is very large, and do not need to participate in other nodes, but the application to do more work, You are the boss of the entire binding table.
Note: In this way you need to know in advance the information of the nodes that are bound, such as the short address, endpoint number, incluster and outcluster, otherwise you can't fill in the parameters of those functions.

Ii. Examples of application situations
1, the first Way (Enddevicebind)
Example: There is a coordinator in the network, there are two nodes A and B, these two nodes have complementary characteristics (that is, the incluster of a node is a B-node outcluster), A and B nodes have a button can be triggered by the program Enddevicebind call. In this case, you just have to press a button on a and b respectively within the specified time, and the binding will be done automatically with the help of the coordinator. This is suitable for the node is very convenient to operate, not to be installed in the wall or inaccessible place; When the binding is complete, a B node with the outcluster nature can send a message to a node of incluster nature by binding, but cannot expect to send a message to B in turn. Because the a node does not have information about B at all, the binding table exists in B.
2. The second way (Match)
Example: There is not necessarily a coordinator in the network exists, but there are a, B, C, D and other nodes, a property is Outcluster,b, C, D is the nature of incluster, you can use the key strategy to allow a certain time in B, C, d any one of the function of the match, At the same time a match request (broadcast) is initiated, then the node that is allowed to match will return its information to a,a when the request is received, and if you want to bind a to another node, you can do so in turn. This is in fact similar to the first procedure, except that the coordinator does not need to be involved.
3, the Third Way (Bindreq,unbindreq)
Example: Suppose you have a master control (possibly an arm board, it may be a PC ...), and there is a ZigBee node A through the serial port or U port and other means connected to the main control, the master can give a command (what command you want to define yourself, to achieve it); you have a B-node that is a switch, and a C-node is a light. You want to set up a binding table on B to use to control C. Then you can use host command A to the other node B to initiate bindreq requirements, the host to a command will carry some C information (host How to have C information?). In this case, the host should understand the details of the entire network, as to how to understand .... , and later). In this way, a can initiate a bindreq request to B, which contains the necessary C information, and B will set up a binding table on control C after receiving the request, and B can then control C through the switch and no longer need A's participation. This approach is appropriate for a centrally managed network.
4. Fourth Way (manual)
Example: You still have a host, the host has ZigBee node A capable of serial or U port communication. You want to be the host to deeply manage the entire network of bindings, you can send a command through the host, tell a to a node to send commands, let it to build, delete, append .... The binding table. This approach is actually the most flexible, but requires the user (that is, you, write programs) the most work, the user also needs a very clear idea to manage the binding table, if you accidentally manage the wrong, the cup has.

Also to add: why Use bindings? Especially 3, 42 kinds, all know the specific information of the bound node? Is it necessary to bind? In fact, every node in the network, will automatically send a deviceannce report (where the bread contains the node's IEEE address and the new short address), tell everyone to come, when you see this deviceannce, Each node updates its own binding table based on the IEEE address information, so you're not afraid of a short address change. There are times when you may not know the specific information of certain nodes, especially the EP information, in this case, if you do not have a host to unified management, no more binding, two nodes want to communicate is impossible.

About four ways to bind ZigBee

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.