├── .gitattributes
├── README.md
├── Base Device Behavior Specification
├── pic
│ ├── f1.jpg
│ ├── f10.jpg
│ ├── f11.jpg
│ ├── f12.jpg
│ ├── f13.jpg
│ ├── f14.jpg
│ ├── f15.jpg
│ ├── f16.jpg
│ ├── f2.jpg
│ ├── f3.jpg
│ ├── f4.jpg
│ ├── f5.jpg
│ ├── f6.jpg
│ ├── f7.jpg
│ ├── f8.jpg
│ ├── f9.jpg
│ ├── t1.jpg
│ ├── t2.jpg
│ ├── t3.jpg
│ ├── t4.jpg
│ ├── t5.jpg
│ ├── t6.jpg
│ ├── t7.jpg
│ ├── t8.jpg
│ ├── tmp1.jpg
│ └── tmp2.jpg
└── Base Device Behavior Specification.md
└── LICENSE
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ZigBee 联盟的 BDB 规范中文译本
2 |
3 | [BDB 规范](./Base%20Device%20Behavior%20Specification/Base%20Device%20Behavior%20Specification.md)
4 |
5 |
--------------------------------------------------------------------------------
/Base Device Behavior Specification/pic/f1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dsyx/zigbee-alliance-bdb-specification/HEAD/Base Device Behavior Specification/pic/f1.jpg
--------------------------------------------------------------------------------
/Base Device Behavior Specification/pic/f10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dsyx/zigbee-alliance-bdb-specification/HEAD/Base Device Behavior Specification/pic/f10.jpg
--------------------------------------------------------------------------------
/Base Device Behavior Specification/pic/f11.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dsyx/zigbee-alliance-bdb-specification/HEAD/Base Device Behavior Specification/pic/f11.jpg
--------------------------------------------------------------------------------
/Base Device Behavior Specification/pic/f12.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dsyx/zigbee-alliance-bdb-specification/HEAD/Base Device Behavior Specification/pic/f12.jpg
--------------------------------------------------------------------------------
/Base Device Behavior Specification/pic/f13.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dsyx/zigbee-alliance-bdb-specification/HEAD/Base Device Behavior Specification/pic/f13.jpg
--------------------------------------------------------------------------------
/Base Device Behavior Specification/pic/f14.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dsyx/zigbee-alliance-bdb-specification/HEAD/Base Device Behavior Specification/pic/f14.jpg
--------------------------------------------------------------------------------
/Base Device Behavior Specification/pic/f15.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dsyx/zigbee-alliance-bdb-specification/HEAD/Base Device Behavior Specification/pic/f15.jpg
--------------------------------------------------------------------------------
/Base Device Behavior Specification/pic/f16.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dsyx/zigbee-alliance-bdb-specification/HEAD/Base Device Behavior Specification/pic/f16.jpg
--------------------------------------------------------------------------------
/Base Device Behavior Specification/pic/f2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dsyx/zigbee-alliance-bdb-specification/HEAD/Base Device Behavior Specification/pic/f2.jpg
--------------------------------------------------------------------------------
/Base Device Behavior Specification/pic/f3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dsyx/zigbee-alliance-bdb-specification/HEAD/Base Device Behavior Specification/pic/f3.jpg
--------------------------------------------------------------------------------
/Base Device Behavior Specification/pic/f4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dsyx/zigbee-alliance-bdb-specification/HEAD/Base Device Behavior Specification/pic/f4.jpg
--------------------------------------------------------------------------------
/Base Device Behavior Specification/pic/f5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dsyx/zigbee-alliance-bdb-specification/HEAD/Base Device Behavior Specification/pic/f5.jpg
--------------------------------------------------------------------------------
/Base Device Behavior Specification/pic/f6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dsyx/zigbee-alliance-bdb-specification/HEAD/Base Device Behavior Specification/pic/f6.jpg
--------------------------------------------------------------------------------
/Base Device Behavior Specification/pic/f7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dsyx/zigbee-alliance-bdb-specification/HEAD/Base Device Behavior Specification/pic/f7.jpg
--------------------------------------------------------------------------------
/Base Device Behavior Specification/pic/f8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dsyx/zigbee-alliance-bdb-specification/HEAD/Base Device Behavior Specification/pic/f8.jpg
--------------------------------------------------------------------------------
/Base Device Behavior Specification/pic/f9.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dsyx/zigbee-alliance-bdb-specification/HEAD/Base Device Behavior Specification/pic/f9.jpg
--------------------------------------------------------------------------------
/Base Device Behavior Specification/pic/t1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dsyx/zigbee-alliance-bdb-specification/HEAD/Base Device Behavior Specification/pic/t1.jpg
--------------------------------------------------------------------------------
/Base Device Behavior Specification/pic/t2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dsyx/zigbee-alliance-bdb-specification/HEAD/Base Device Behavior Specification/pic/t2.jpg
--------------------------------------------------------------------------------
/Base Device Behavior Specification/pic/t3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dsyx/zigbee-alliance-bdb-specification/HEAD/Base Device Behavior Specification/pic/t3.jpg
--------------------------------------------------------------------------------
/Base Device Behavior Specification/pic/t4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dsyx/zigbee-alliance-bdb-specification/HEAD/Base Device Behavior Specification/pic/t4.jpg
--------------------------------------------------------------------------------
/Base Device Behavior Specification/pic/t5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dsyx/zigbee-alliance-bdb-specification/HEAD/Base Device Behavior Specification/pic/t5.jpg
--------------------------------------------------------------------------------
/Base Device Behavior Specification/pic/t6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dsyx/zigbee-alliance-bdb-specification/HEAD/Base Device Behavior Specification/pic/t6.jpg
--------------------------------------------------------------------------------
/Base Device Behavior Specification/pic/t7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dsyx/zigbee-alliance-bdb-specification/HEAD/Base Device Behavior Specification/pic/t7.jpg
--------------------------------------------------------------------------------
/Base Device Behavior Specification/pic/t8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dsyx/zigbee-alliance-bdb-specification/HEAD/Base Device Behavior Specification/pic/t8.jpg
--------------------------------------------------------------------------------
/Base Device Behavior Specification/pic/tmp1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dsyx/zigbee-alliance-bdb-specification/HEAD/Base Device Behavior Specification/pic/tmp1.jpg
--------------------------------------------------------------------------------
/Base Device Behavior Specification/pic/tmp2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dsyx/zigbee-alliance-bdb-specification/HEAD/Base Device Behavior Specification/pic/tmp2.jpg
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/Base Device Behavior Specification/Base Device Behavior Specification.md:
--------------------------------------------------------------------------------
1 | # **Base Device Behavior Specification Version 1.0**
2 |
3 | 
4 |
5 | # **Notice of use and disclosure**
6 |
7 | Copyright © ZigBee Alliance, Inc. (1996-2016). All rights Reserved. This information within this document is the property of the ZigBee Alliance and its use and disclosure are restricted. Elements of ZigBee Alliance specifications may be subject to third party intellectual property rights, including without limitation, patent, copyright or trademark rights (such a third party may or may not be a member of ZigBee). ZigBee is not responsible and shall not be held responsible in any manner for identifying or failing to identify any or all such third party intellectual property rights. No right to use any ZigBee name, logo or trademark is conferred herein. Use of any ZigBee name, logo or trademark requires membership in the ZigBee Alliance and compliance with the ZigBee Logo and Trademark Policy and related ZigBee policies. This document and the information contained herein are provided on an “AS IS” basis and ZigBee DISCLAIMS ALL WARRANTIES EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO (A) ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OF THIRD PARTIES (INCLUDING WITHOUT LIMITATION ANY INTELLECTUAL PROPERTY RIGHTS INCLUDING PATENT, COPYRIGHT OR TRADEMARK RIGHTS) OR (B) ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR NONINFRINGEMENT. IN NO EVENT WILL ZIGBEE BE LIABLE FOR ANY LOSS OF PROFITS, LOSS OF BUSINESS, LOSS OF USE OF DATA, INTERRUPTION OF BUSINESS, OR FOR ANY OTHER DIRECT, INDIRECT, SPECIAL OR EXEMPLARY, INCIDENTIAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND, IN CONTRACT OR IN TORT, IN CONNECTION WITH THIS DOCUMENT OR THE INFORMATION CONTAINED HEREIN, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE. All Company, brand and product names may be trademarks that are the sole property of their respective owners. The above notice and this paragraph must be included on all copies of this document that are made.
8 |
9 | # **修订历史**
10 |
11 | 
12 |
13 | # **目录**
14 |
15 | - [1. 引言](#1-引言)
16 | - [1.1 范围](#11-范围)
17 | - [1.2 目的](#12-目的)
18 | - [1.3 一致性级别](#13-一致性级别)
19 | - [1.4 约定](#14-约定)
20 | - [1.4.1 数字格式](#141-数字格式)
21 | - [1.5 一致性测试](#15-一致性测试)
22 | - [1.6 勘误表](#16-勘误表)
23 | - [2. 参考文献](#2-参考文献)
24 | - [2.1 ZigBee Alliance 文档](#21-zigbee-alliance-文档)
25 | - [2.2 IEEE 文档](#22-ieee-文档)
26 | - [2.3 IETF 文档](#23-ietf-文档)
27 | - [3. 定义](#3-定义)
28 | - [4. 缩写](#4-缩写)
29 | - [5. 环境变量](#5-环境变量)
30 | - [5.1 所有节点使用的常量](#51-所有节点使用的常量)
31 | - [5.1.1 bdbcMaxSameNetworkRetryAttempts 常量](#511-bdbcmaxsamenetworkretryattempts-常量)
32 | - [5.1.2 bdbcMinCommissioningTime 常量](#512-bdbcmincommissioningtime-常量)
33 | - [5.1.3 bdbcRecSameNetworkRetryAttempts 常量](#513-bdbcrecsamenetworkretryattempts-常量)
34 | - [5.1.4 bdbcTCLinkKeyExchangeTimeout 常量](#514-bdbctclinkkeyexchangetimeout-常量)
35 | - [5.2 支持 touchlink 的节点使用的常量](#52-支持-touchlink-的节点使用的常量)
36 | - [5.2.1 bdbcTLInterPANTransIdLifetime 常量](#521-bdbctlinterpantransidlifetime-常量)
37 | - [5.2.2 bdbcTLMinStartupDelayTime 常量](#522-bdbctlminstartupdelaytime-常量)
38 | - [5.2.3 bdbcTLPrimaryChannelSet 常量](#523-bdbctlprimarychannelset-常量)
39 | - [5.2.4 bdbcTLRxWindowDuration 常量](#524-bdbctlrxwindowduration-常量)
40 | - [5.2.5 bdbcTLScanTimeBaseDuration 常量](#525-bdbctlscantimebaseduration-常量)
41 | - [5.2.6 bdbcTLSecondaryChannelSet 常量](#526-bdbctlsecondarychannelset-常量)
42 | - [5.3 属性](#53-属性)
43 | - [5.3.1 bdbCommissioningGroupID 属性](#531-bdbcommissioninggroupid-属性)
44 | - [5.3.2 bdbCommissioningMode 属性](#532-bdbcommissioningmode-属性)
45 | - [5.3.3 bdbCommissioningStatus 属性](#533-bdbcommissioningstatus-属性)
46 | - [5.3.4 bdbJoiningNodeEui64 属性](#534-bdbjoiningnodeeui64-属性)
47 | - [5.3.5 bdbJoiningNodeNewTCLinkKey 属性](#535-bdbjoiningnodenewtclinkkey-属性)
48 | - [5.3.6 bdbJoinUsesInstallCodeKey 属性](#536-bdbjoinusesinstallcodekey-属性)
49 | - [5.3.7 bdbNodeCommissioningCapability 属性](#537-bdbnodecommissioningcapability-属性)
50 | - [5.3.8 bdbNodeIsOnANetwork 属性](#538-bdbnodeisonanetwork-属性)
51 | - [5.3.9 bdbNodeJoinLinkKeyType 属性](#539-bdbnodejoinlinkkeytype-属性)
52 | - [5.3.10 bdbPrimaryChannelSet 属性](#5310-bdbprimarychannelset-属性)
53 | - [5.3.11 bdbScanDuration 属性](#5311-bdbscanduration-属性)
54 | - [5.3.12 bdbSecondaryChannelSet 属性](#5312-bdbsecondarychannelset-属性)
55 | - [5.3.13 bdbTCLinkKeyExchangeAttempts 属性](#5313-bdbtclinkkeyexchangeattempts-属性)
56 | - [5.3.14 bdbTCLinkKeyExchangeAttemptsMax 属性](#5314-bdbtclinkkeyexchangeattemptsmax-属性)
57 | - [5.3.15 bdbTCLinkKeyExchangeMethod 属性](#5315-bdbtclinkkeyexchangemethod-属性)
58 | - [5.3.16 bdbTrustCenterNodeJoinTimeout 属性](#5316-bdbtrustcenternodejointimeout-属性)
59 | - [5.3.17 bdbTrustCenterRequireKeyExchange 属性](#5317-bdbtrustcenterrequirekeyexchange-属性)
60 | - [6. 一般要求](#6-一般要求)
61 | - [6.1 ZigBee 逻辑设备类型](#61-zigbee-逻辑设备类型)
62 | - [6.2 网络安全模型](#62-网络安全模型)
63 | - [6.3 链路密钥](#63-链路密钥)
64 | - [6.3.1 默认全局信任中心链路密钥](#631-默认全局信任中心链路密钥)
65 | - [6.3.2 分布式安全全局链路密钥](#632-分布式安全全局链路密钥)
66 | - [6.3.3 安装码派生的预配置链路密钥](#633-安装码派生的预配置链路密钥)
67 | - [6.3.4 Touchlink 预配置链路密钥](#634-touchlink-预配置链路密钥)
68 | - [6.4 安装码的使用](#64-安装码的使用)
69 | - [6.5 Commissioning](#65-commissioning)
70 | - [6.6 所有设备的最低要求](#66-所有设备的最低要求)
71 | - [6.7 默认报告配置](#67-默认报告配置)
72 | - [6.8 MAC 数据轮询](#68-mac-数据轮询)
73 | - [6.9 ZigBee 持久数据](#69-zigbee-持久数据)
74 | - [7. 初始化](#7-初始化)
75 | - [7.1 初始化过程](#71-初始化过程)
76 | - [8. Commissioning](#8-commissioning)
77 | - [8.1 顶级 commissioning 过程](#81-顶级-commissioning-过程)
78 | - [8.2 已在网节点的网络转向过程](#82-已在网节点的网络转向过程)
79 | - [8.3 非在网节点的网络转向过程](#83-非在网节点的网络转向过程)
80 | - [8.4 网络形成过程](#84-网络形成过程)
81 | - [8.5 目标端点的查找和绑定过程](#85-目标端点的查找和绑定过程)
82 | - [8.6 发起者端点的查找和绑定过程](#86-发起者端点的查找和绑定过程)
83 | - [8.7 发起者的 Touchlink 过程](#87-发起者的-touchlink-过程)
84 | - [8.7.1 网络 启动/加入 命令的常规字段设置](#871-网络-启动加入-命令的常规字段设置)
85 | - [8.7.1.1 Inter-PAN transaction identifier 字段](#8711-inter-pan-transaction-identifier-字段)
86 | - [8.7.1.2 Key index 和 encrypted network key 字段](#8712-key-index-和-encrypted-network-key-字段)
87 | - [8.7.1.3 Network address 字段](#8713-network-address-字段)
88 | - [8.7.1.4 Group identifiers begin/end 字段](#8714-group-identifiers-beginend-字段)
89 | - [8.7.1.5 Free network/group address range begin/end 字段](#8715-free-networkgroup-address-range-beginend-字段)
90 | - [8.8 目标的 Touchlink 过程](#88-目标的-touchlink-过程)
91 | - [9. 重置](#9-重置)
92 | - [9.1 通过 basic 簇重置](#91-通过-basic-簇重置)
93 | - [9.2 通过 touchlink commissioning 簇重置](#92-通过-touchlink-commissioning-簇重置)
94 | - [9.3 通过网络的 leave 命令重置](#93-通过网络的-leave-命令重置)
95 | - [9.4 通过 Mgmt\_Leave\_req ZDO 命令重置](#94-通过-mgmt_leave_req-zdo-命令重置)
96 | - [9.5 通过本地动作重置](#95-通过本地动作重置)
97 | - [10. 安全](#10-安全)
98 | - [10.1 安装码](#101-安装码)
99 | - [10.1.1 安装码格式](#1011-安装码格式)
100 | - [10.1.1.1 CRC 算法信息](#10111-crc-算法信息)
101 | - [10.1.2 散列函数](#1012-散列函数)
102 | - [10.1.2.1 MMO 散列代码示例](#10121-mmo-散列代码示例)
103 | - [10.2 节点操作](#102-节点操作)
104 | - [10.2.1 加入节点的策略值](#1021-加入节点的策略值)
105 | - [10.2.1.1 acceptNewUnsolicitedTrustCenterLinkKey 策略](#10211-acceptnewunsolicitedtrustcenterlinkkey-策略)
106 | - [10.2.1.2 acceptNewUnsolicitedApplicationLinkKey 策略](#10212-acceptnewunsolicitedapplicationlinkkey-策略)
107 | - [10.2.2 信任中心地址](#1022-信任中心地址)
108 | - [10.2.3 信任中心链路密钥](#1023-信任中心链路密钥)
109 | - [10.2.4 请求链路密钥](#1024-请求链路密钥)
110 | - [10.2.5 信任中心链路密钥交换过程](#1025-信任中心链路密钥交换过程)
111 | - [10.2.6 接收新链路密钥](#1026-接收新链路密钥)
112 | - [10.3 信任中心行为](#103-信任中心行为)
113 | - [10.3.1 添加安装码](#1031-添加安装码)
114 | - [10.3.2 往网络中添加新节点](#1032-往网络中添加新节点)
115 | - [10.3.3 已知节点加入时的行为](#1033-已知节点加入时的行为)
116 | - [10.4 分布式安全网络行为](#104-分布式安全网络行为)
117 | - [10.4.1 往网络中添加新节点](#1041-往网络中添加新节点)
118 | - [11. 附录 A:建议措施](#11-附录-a建议措施)
119 | - [11.1 集中式 commissioning 的建议](#111-集中式-commissioning-的建议)
120 | - [11.1.1 集中式 commissioning 概述](#1111-集中式-commissioning-概述)
121 | - [11.1.2 设备发现的建议](#1112-设备发现的建议)
122 | - [11.1.2.1 新节点加入](#11121-新节点加入)
123 | - [11.1.2.2 现有网络中的节点](#11122-现有网络中的节点)
124 | - [11.1.2.3 与终端设备建立通信](#11123-与终端设备建立通信)
125 |
126 | # 1. 引言
127 |
128 | ## 1.1 范围
129 |
130 | 基础设备行为规范的范围是定义:
131 |
132 | * 基础设备所需的环境
133 | * 基础设备的初始化(initialization)过程
134 | * 基础设备的 commissioning 过程
135 | * 基础设备的重置(reset)过程
136 | * 基础设备的安全(security)过程
137 |
138 | 注意:本文档旨在涵盖与基础设备行为相关的阶段 1 的配置文件互操作性技术要求。另见 \[R4\]。
139 |
140 | ## 1.2 目的
141 |
142 | 基础设备行为规范的目的是指定在 ZigBee-PRO 协议栈上运行的基础设备的环境、初始化、commissioning 和操作过程,以确保配置文件的互操作性。
143 |
144 | ## 1.3 一致性级别
145 |
146 | 本文件中的关键词 “SHALL”、“SHALL NOT”、“SHOULD”、“SHOULD NOT”,“RECOMMENDED” 和 “MAY” 应按照 \[R9\] 中的描述进行解释。
147 |
148 | ## 1.4 约定
149 |
150 | ### 1.4.1 数字格式
151 |
152 | 在本规范中,十六进制数字的前缀为 “0x”,二进制数字的前缀为 “0b”。除非在相关文本中另有说明,否则所有其他数字均假定为十进制。
153 |
154 | > PS: 下面两段英文为原文对数字格式的解释,不进行翻译。
155 |
156 | Binary numbers are specified as successive groups of 4 bits, separated by a space (“ “) character from the most significant bit (next to the 0b prefix and left most on the page) to the least significant bit (rightmost on the page), e.g. the binary number 0b0000 1111 represents the decimal number 15. Where individual bits are indicated (e.g. bit 3) the bit numbers are relative to the least significant bit (i.e. bit 0).
157 |
158 | When a bit is specified as having a value of either 0 or 1 it is specified with an “x”, e.g. “0b0000 0xxx” indicates that the lower 3 bits can take any value but the upper 5 bits must each be set to 0.
159 |
160 | ## 1.5 一致性测试
161 |
162 | 为了证明符合本规范,需要实现遵循在 **Base Device Behavior Test Specification** \[R6\] 中定义的适当的测试用例。
163 |
164 | ## 1.6 勘误表
165 |
166 | 任何针对此规范的勘误都可以在 \[R7\] 中找到。
167 |
168 | # 2. 参考文献
169 |
170 | ## 2.1 ZigBee Alliance 文档
171 |
172 | \[R1\] ZigBee Specification, ZigBee Alliance document 05-3474.
173 |
174 | \[R2\] ZigBee Cluster Library Specification, ZigBee Alliance document 07-5123.
175 |
176 | \[R3\] ZigBee Application Architecture, ZigBee Alliance document 13-0589.
177 |
178 | \[R4\] ZigBee Profile Interoperability Technical Requirements Document, ZigBee document 13-0142-09.
179 |
180 | \[R5\] Installation Code Key Derivation Sample Code, ZigBee document 09-5343-04.
181 |
182 | \[R6\] Base Device Behavior Test Specification, ZigBee document 14-0439.
183 |
184 | \[R7\] Z3 Errata for Base Device Behavior 13-0402, ZigBee document 15-02020.
185 |
186 | ## 2.2 IEEE 文档
187 |
188 | \[R8\] Institute of Electrical and Electronics Engineers, Inc., IEEE Std. 802.15.4-2003, IEEE Standard for Information Technology —Telecommunications and Information Exchange between Systems —Local and Metropolitan Area Networks —Specific Requirements —Part 15.4: Wireless Medium Access Control (MAC) and Physical Layer (PHY) Specifications for Low Rate Wireless Personal Area Networks (WPANs). New York: IEEE Press. 2003.
189 |
190 | ## 2.3 IETF 文档
191 |
192 | \[R9\] S. Bradner, Key words for use in RFCs to Indicate Requirement Levels, IETF RFC 2119, March 1997.
193 |
194 |
195 | # 3. 定义
196 |
197 | **应用簇(Application cluster):**
198 |
199 | 应用簇是生成持久功能事务的簇,例如,向客户端报告的 **temperature measurement** 服务端簇或从客户端接收命令的 **on/off** 服务端簇(另请参阅 \[R3\])。
200 |
201 | **应用事务(Application transaction):**
202 |
203 | 应用(或功能)事务是一个簇命令和执行设备的持久功能而生成的可能响应,例如属性报告(如报告传感器的测量值)或动作命令(如开、关、切换等)。应用事务不是一个 ZDO 事务,一次性事务或 commissioning 事务。
204 |
205 | 生成应用事务的簇是发起者。接收事务的初始消息的相应簇是目标。多个 端点/节点 上的相同簇可以是同一个应用事务的目标,因为可以进行多个源绑定或与 分组/广播 目的地进行绑定。
206 |
207 | **绑定(Bind or binding (verb)):**
208 |
209 | 创建一个绑定或创建一个绑定的动作。
210 |
211 | **绑定(Binding (noun)):**
212 |
213 | 绑定是节点上的 ZigBee 源绑定表条目,其指示从端点上的簇发送数据的位置(另请参阅 \[R3\])。
214 |
215 | **集中式安全网络(Centralized security network):**
216 |
217 | 集中式安全网络是由具有信任中心功能的 ZigBee 协调器形成的 ZigBee 网络。加入此类网络的每个节点都可以通过信任中心进行身份验证,然后才能在网络上操作。
218 |
219 | **Commissioning 主管(Commissioning director):**
220 |
221 | 网络中的一个节点,能够直接编辑网络中任何节点上的绑定和报告配置。
222 |
223 | **设备(Device)**
224 |
225 | 对应于 ZigBee 定义的设备类型的应用程序实现,其具有唯一的设备标识符并且是节点的一部分。一个设备驻留在单个端点上,称为设备端点。单个节点可以有一个或多个设备(另请参阅 \[R3\])。
226 |
227 | > PS:这里应译为 “装置” 更合适,但考虑大部分 ZigBee 书籍将其译为 “设备”,故本文译为 “设备”。
228 |
229 | **分布式安全网络(Distributed security network):**
230 |
231 | 分布式安全网络是由 ZigBee 路由器形成的 ZigBee 网络,其没有信任中心。加入此类网络的每个节点先由其父节点进行身份验证,然后才可以在网络上操作。
232 |
233 | **动态设备(Dynamic device):**
234 |
235 | 动态设备是端点的应用程序实现,其没有特定的应用簇集(另请参阅 \[R3\])。
236 |
237 | **EZ-Mode:**
238 |
239 | EZ-Mode 是一种 commissioning 方法,用于定义节点上的网络转向和设备重置,以及查找和绑定具有目标或发起者簇的端点。该方法要求产品支持交互机制以调用该方法。产品的安装者可以访问这些机制。这些机制是依赖于实现的,并且可以是重载的 和/或 自动的。
240 |
241 | 在设备端点上调用 EZ-Mode 会使节点和设备置于 EZ-Mode 下保持 3 分钟的窗口。每次在设备上调用 EZ-Mode 时,它会将窗口再延长 3 分钟。在窗口期间,节点执行 EZ-Mode 网络转向,并且在 EZ-Mode 中设备执行 EZ-Mode 查找和绑定到其他设备。目标设备使用 **identify** 簇在窗口期间进行标识。发起者设备在窗口期间主动发现目标,然后绑定到相应的目标簇。
242 |
243 | **EZ-Mode 查找和绑定(EZ-Mode finding & binding):**
244 |
245 | EZ-Mode 查找和绑定是通过在两个或多个设备上匹配的应用簇之间使用 **identify** 簇自动建立应用程序连接的过程(另请参阅 \[R3\])。注意,此后 “EZ-Mode 查找和绑定” 参考为 “查找和绑定”。
246 |
247 | **EZ-Mode 网络转向(EZ-Mode network steering):**
248 |
249 | 对于尚未加入网络的节点,EZ-Mode 网络转向是搜索和加入开放网络的操作。对于已加入网络的节点,EZ-Mode 网络转向是开放网络以允许新节点加入的动作。注意,此后 “EZ-Mode 网络转向” 参考为 “网络转向”。
250 |
251 | **查找和绑定(Finding & binding):**
252 |
253 | 参见 **EZ-Mode 查找和绑定**。
254 |
255 | **发起者簇(Initiator cluster):**
256 |
257 | 发起者簇是一个发起簇事务的应用簇(另请参见 \[R3\])。
258 |
259 | **已加入(Joined):**
260 |
261 | 如果一个节点已成功执行网络加入过程或已形成一个网络,则称该节点已加入到一个网络。请注意,如果节点形成网络,其可能还没有任何与之通信的对等节点。同样,如果某个节点已加入网络,其可能它还没有任何绑定端点。
262 |
263 | **网络转向(Network steering):**
264 |
265 | 参见 **EZ-Mode 网络转向**。
266 |
267 | **节点(Node):**
268 |
269 | 节点定义为在单个网络上的具有单个 IEEE 地址的 ZigBee-PRO 协议栈的单个实例。节点由一个或多个逻辑设备实例组成,每个逻辑设备实例在端点上表示,并且节点可以具有节点端点,其是整个节点的示例,例如端点 0 上的 ZDO(另请参见 \[R3\])。
270 |
271 | **简单设备(Simple device):**
272 |
273 | 简单设备是一个具有强制应用簇的应用程序特定端点的应用程序实现(另请参见 \[R3\])。
274 |
275 | **目标簇(Target cluster):**
276 |
277 | 目标簇是一个应用簇,其接收来自发起者簇的已发起消息,并且可能会响应发起者(另请参阅 \[R3\])。
278 |
279 | **Touchlink commissioning:**
280 |
281 | Touchlink commissioning 是一种可选的 commissioning 机制,其在物理邻近上使用 inter-PAN 通信发送命令以在网络上 commissioning 节点。
282 |
283 | **实用簇(Utility cluster):**
284 |
285 | 实用簇是一个簇,其功能不是产品的持久功能操作的一部分。功能示例:commissioning,配置,发现等。
286 |
287 | **ZigBee 协调器(ZigBee coordinator):**
288 |
289 | ZigBee 协调器是一个 ZigBee 逻辑设备类型,其包括信任中心的功能,负责启动集中式安全网络并管理网络的节点加入和密钥分发。ZigBee 协调器节点描述符的 **logical type** 字段被设置为 **0b000**。
290 |
291 | **ZigBee 终端设备(ZigBee end device):**
292 |
293 | ZigBee 终端设备是一个 ZigBee 逻辑设备类型,其只能加入现有网络。ZigBee 终端设备节点描述符的 **logical type** 字段被设置为 **0b010**。
294 |
295 | **ZigBee 路由器(ZigBee router):**
296 |
297 | ZigBee 路由器是一个 ZigBee 逻辑设备类型,其负责管理节点加入。ZigBee 路由器无法启动集中式安全网络,但可以启动分布式安全网络。ZigBee 路由器节点描述符的 **logical type** 字段被设置为 **0b001**。
298 |
299 | # 4. 缩写
300 |
301 | | 缩写 | 描述 |
302 | | :-- | :-- |
303 | | AES | 高级加密标准 |
304 | | AIB | 应用程序支持子层信息库 |
305 | | APS | 应用程序支持子层 |
306 | | APSME | 应用程序支持子层管理实体 |
307 | | CBKE | 基于证书的密钥交换 |
308 | | CCITT | 国际电信委员会 |
309 | | CD | commissioning 主管 |
310 | | CRC | 循环冗余校验 |
311 | | EP | 端点 |
312 | | EUI | 扩展唯一标识符 |
313 | | ID | 标识符 |
314 | | IEEE | 电气和电子工程师协会 |
315 | | LQI | 链路质量指示 |
316 | | MAC | 媒体访问控制 |
317 | | MMO | Matyas-Meyer-Oseas |
318 | | NLME | 网络层管理实体 |
319 | | NVRAM | 非易失性随机存取存储器 |
320 | | NWK | 网络 |
321 | | OTA | 在空中 |
322 | | PAN | 个域网 |
323 | | PHY | 物理 |
324 | | TC | 信任中心 |
325 | | WPAN | 无线个域网 |
326 | | ZC | ZigBee 协调器 |
327 | | ZCL | ZigBee 簇库 |
328 | | ZDO | ZigBee 设备对象 |
329 | | ZED | ZigBee 终端设备 |
330 | | ZR | ZigBee 路由器 |
331 |
332 | # 5. 环境变量
333 |
334 | 此子条款指定实现符合基础设备行为规范的节点所需的常量和属性。
335 |
336 | 本规范中指定的所有常量都使用前缀 “bdbc”(基础设备行为常量),并且所有属性都使用前缀 “bdb”(基础设备行为)。
337 |
338 | ## 5.1 所有节点使用的常量
339 |
340 | Table 1 列出了被所有设备使用的基础设备行为规范定义的常量集。
341 |
342 | 
343 |
344 | ### 5.1.1 bdbcMaxSameNetworkRetryAttempts 常量
345 |
346 | **bdbcMaxSameNetworkRetryAttempts** 常量指定了对同一网络进行的加入或密钥交换的最大尝试次数。
347 |
348 | 该常量被每个节点使用。
349 |
350 | 另请参见 **bdbcRecSameNetworkRetryAttempts**。
351 |
352 | ### 5.1.2 bdbcMinCommissioningTime 常量
353 |
354 | **bdbcMinCommissioningTime** 常量指定了开放网络以允许新节点加入或设备标识自身的最小持续时间(秒)。
355 |
356 | 该常量被每个节点使用。
357 |
358 | ### 5.1.3 bdbcRecSameNetworkRetryAttempts 常量
359 |
360 | **bdbcRecSameNetworkRetryAttempts** 常量指定了对同一网络进行的加入或密钥交换的(RECOMMENDED)最大尝试次数。
361 |
362 | 该常量被每个节点使用。
363 |
364 | 另请参见 **bdbcMaxSameNetworkRetryAttempts**。
365 |
366 | ### 5.1.4 bdbcTCLinkKeyExchangeTimeout 常量
367 |
368 | **bdbcTCLinkKeyExchangeTimeout** 常量指定了加入节点在向信任中心发送 APS 请求密钥时等待响应的最长时间(秒)。
369 |
370 | 该常量被每个节点使用。
371 |
372 | ## 5.2 支持 touchlink 的节点使用的常量
373 |
374 | Table 2 列出了被支持 touchlink commissioning 的设备使用的基础设备行为规范定义的常量集。
375 |
376 | 
377 |
378 | ### 5.2.1 bdbcTLInterPANTransIdLifetime 常量
379 |
380 | **bdbcTLInterPANTransIdLifetime** 常量指定了 inter-PAN 事务 ID 保持有效的最大时间长度。
381 |
382 | 如果支持 touchlink,则节点将使用此常量。
383 |
384 | ### 5.2.2 bdbcTLMinStartupDelayTime 常量
385 |
386 | **bdbcTLMinStartupDelayTime** 常量指定了发起者等待以确保目标已完成其网络启动过程的时间长度。
387 |
388 | 如果支持 touchlink,则节点将使用此常量。
389 |
390 | ### 5.2.3 bdbcTLPrimaryChannelSet 常量
391 |
392 | **bdbcTLPrimaryChannelSet** 常量指定了由信道 11、15、20 和 25 组成的信道集的位掩码,其将用于非扩展的 touchlink 扫描。
393 |
394 | 如果支持 touchlink,则节点将使用此常量。
395 |
396 | ### 5.2.4 bdbcTLRxWindowDuration 常量
397 |
398 | **bdbcTLRxWindowDuration** 常量指定了节点在 touchlink 期间为后续响应启用接收器的最大持续时间。
399 |
400 | 如果支持 touchlink,则节点将使用此常量。
401 |
402 | ### 5.2.5 bdbcTLScanTimeBaseDuration 常量
403 |
404 | **bdbcTLScanTimeBaseDuration** 常量指定了 touchlink 扫描操作的基本持续时间,在此期间接收器在发送扫描请求后被启用以扫描响应。
405 |
406 | 如果支持 touchlink,则节点将使用此常量。
407 |
408 | ### 5.2.6 bdbcTLSecondaryChannelSet 常量
409 |
410 | **bdbcTLSecondaryChannelSet** 常量指定了信道集的位掩码,该信道集由在 2.4GHz 中可用的剩余 IEEE 802.15.4-2003 信道组成,这些信道将在扫描 **bdbcTLPrimaryChannelSet** 信道后用于扩展的 touchlink 扫描。
411 |
412 | 如果支持 touchlink,则节点将使用此常量。
413 |
414 | ## 5.3 属性
415 |
416 | 基础设备行为规范定义了 Table 3 中列出的属性集。“Used by” 列指示属性被用于哪个 ZigBee 逻辑设备类型以及是否要为每个端点定义该属性。注意:本规范中定义的所有属性都是节点内部的,在空中不可用。
417 |
418 | 
419 |
420 | ### 5.3.1 bdbCommissioningGroupID 属性
421 |
422 | **bdbCommissioningGroupID** 属性指定了发起者应用在查找和绑定上的分组标识符。如果 **bdbCommissioningGroupID** 等于 **0xffff**,则任何绑定都将创建为单播。
423 |
424 | 如果 **bdbCommissioningMode** 属性(参见子条款 5.3.2)的第 3 位等于 **1**(将尝试查找和绑定),则此属性仅在 commissioning 期间被使用。
425 |
426 | 此属性被发起者节点使用,其要为每个端点定义。
427 |
428 | 注意:睡着的 ZigBee 终端设备目标将无法从组播传输中获益(有关详细信息,请参阅 \[R2\] 中的 **groups** 簇)。
429 |
430 | ### 5.3.2 bdbCommissioningMode 属性
431 |
432 | **bdbCommissioningMode** 属性用作顶级 commissioning 过程的参数,并在 commissioning 被调用时指定所采用的 commissioning 方法和选项,由从最低有效位到最高有效位的每个位表示。
433 |
434 | 请注意,此属性与 **bdbNodeCommissioningCapability** 属性不同,后者指定节点支持哪些 commissioning 机制。该属性是一个位元或 Table 4 中列出的位。
435 |
436 | 此属性被所有节点使用,其要为每个端点定义。
437 |
438 | 
439 |
440 | ### 5.3.3 bdbCommissioningStatus 属性
441 |
442 | **bdbCommissioningStatus** 属性指定了其 commissioning 尝试的状态,可以被设置为 Table 5 中列出的值之一。
443 |
444 | 此属性被所有节点使用,其要为每个端点定义。
445 |
446 | 
447 |
448 | ### 5.3.4 bdbJoiningNodeEui64 属性
449 |
450 | **bdbJoiningNodeEui64** 属性包含加入集中式安全网络的节点的 EUI-64。
451 |
452 | 此属性被 ZigBee 协调器节点使用。
453 |
454 | ### 5.3.5 bdbJoiningNodeNewTCLinkKey 属性
455 |
456 | **bdbJoiningNodeNewTCLinkKey** 属性包含与加入节点建立但尚未确认的新链路密钥。
457 |
458 | 此属性被 ZigBee 协调器节点使用。
459 |
460 | ### 5.3.6 bdbJoinUsesInstallCodeKey 属性
461 |
462 | **bdbJoinUsesInstallCodeKey** 属性指定了信任中心的策略,该策略指示其在相应节点加入其网络之前是否需要预安装一个安装码派生的预配置链路密钥。
463 |
464 | 如果 **bdbJoinUsesInstallCodeKey** 等于 **FALSE**,则信任中心允许节点加入其网络,而无需在节点加入之前预安装与节点关联的相应安装码派生的预配置链路密钥。如果 **bdbJoinUsesInstallCodeKey** 等于 **TRUE**,则必须在节点加入之前已预安装与该节点关联的相应安装码派生的预配置链路密钥,信任中心才允许节点加入其网络。
465 |
466 | 此属性被 ZigBee 协调器节点使用。
467 |
468 | ### 5.3.7 bdbNodeCommissioningCapability 属性
469 |
470 | **bdbNodeCommissioningCapability** 属性指定了节点的 commissioning 能力。该属性是一个位元或 Table 6 中列出的位。
471 |
472 | 此属性被所有节点使用。
473 |
474 | 
475 |
476 | ### 5.3.8 bdbNodeIsOnANetwork 属性
477 |
478 | **bdbNodeIsOnANetwork** 属性指示了节点是否已加入网络。如果 **bdbNodeIsOnANetwork** 等于 **FALSE**,则该节点尚未形成或加入网络。如果 **bdbNodeIsOnANetwork** 等于 **TRUE**,则节点形成了集中式安全网络(如果节点是 ZigBee 协调器)或形成了分布式安全网络(如果节点是 ZigBee 路由器)或已加入网络(如果节点是 ZigBee 路由器或 ZigBee 终端设备)。注意,当 **bdbNodeIsOnANetwork** 等于 **TRUE** 时,节点可能还没有任何绑定端点。
479 |
480 | 此属性被所有节点使用。
481 |
482 | ### 5.3.9 bdbNodeJoinLinkKeyType 属性
483 |
484 | **bdbNodeJoinLinkKeyType** 属性指示了链路密钥的类型(请参阅子条款 6.3),当节点加入新网络时,该节点能够使用其解密网络密钥。此属性可以采用 Table 7 中列出的值之一。
485 |
486 | 
487 |
488 | 此属性被 ZigBee 路由器和 ZigBee 终端设备使用。
489 |
490 | ### 5.3.10 bdbPrimaryChannelSet 属性
491 |
492 | **bdbPrimaryChannelSet** 属性指定了由应用程序定义的将优先使用的信道集,例如,在信道扫描期间。请注意,如果不需要主要扫描,则此属性被设置为 **0x00000000**。但是,在这种情况下,**bdbSecondaryChannelSet** 不应被设置为 **0x00000000**。
493 |
494 | 此属性被所有节点使用。
495 |
496 | ### 5.3.11 bdbScanDuration 属性
497 |
498 | **bdbScanDuration** 属性指定了每个信道的 IEEE 802.15.4 扫描操作的持续时间。扫描每个信道所花费的时间通过 \[aBaseSuperframeDuration *(2n + 1)\] 给出,其中 **n** 是 **bdbScanDuration** 的值,**aBaseSuperframeDuration** 在 \[R8\] 的子条款 7.4.1(Table 70)中定义。
499 |
500 | The scan is performed indirectly via the ZigBee primitives and can be energy, passive or active.
501 |
502 | 此属性被所有节点使用。
503 |
504 | ### 5.3.12 bdbSecondaryChannelSet 属性
505 |
506 | **bdbSecondaryChannelSet** 属性指定了由应用程序定义的信道集,该信道集将在主要信道之后使用,例如,在信道扫描期间。请注意,如果不需要次要扫描,则此属性被设置为 **0x00000000**。但是,在这种情况下,**bdbPrimaryChannelSet** 不应被设置为 **0x00000000**。
507 |
508 | 此属性被所有节点使用。
509 |
510 | ### 5.3.13 bdbTCLinkKeyExchangeAttempts 属性
511 |
512 | **bdbTCLinkKeyExchangeAttempts** 属性包含了在加入后建立新链路密钥的密钥建立尝试次数。
513 |
514 | 此属性被 ZigBee 路由器和 ZigBee 终端设备使用。
515 |
516 | ### 5.3.14 bdbTCLinkKeyExchangeAttemptsMax 属性
517 |
518 | **bdbTCLinkKeyExchangeAttemptsMax** 属性指定了在放弃密钥建立之前将进行的最大密钥建立尝试次数。
519 |
520 | 此属性被 ZigBee 路由器和 ZigBee 终端设备使用。
521 |
522 | ### 5.3.15 bdbTCLinkKeyExchangeMethod 属性
523 |
524 | **bdbTCLinkKeyExchangeMethod** 属性指定了在加入网络后用于建立新链路密钥的方法,并且可以设置为 Table 8 中列出的非保留值之一。
525 |
526 | 此属性被 ZigBee 路由器和 ZigBee 终端设备使用。
527 |
528 | 
529 |
530 | ### 5.3.16 bdbTrustCenterNodeJoinTimeout 属性
531 |
532 | **bdbTrustCenterNodeJoinTimeout** 属性为信任中心指定了一个超时(秒),以移除未成功建立新链路密钥的新加入节点的信任中心链路密钥。
533 |
534 | 此属性被 ZigBee 协调器节点使用。
535 |
536 | ### 5.3.17 bdbTrustCenterRequireKeyExchange 属性
537 |
538 | **bdbTrustCenterRequireKeyExchange** 属性指定了信任中心是否要求加入设备将其初始链路密钥与信任中心生成的新链路密钥进行交换。如果 **bdbTrustCenterRequireKeyExchange** 等于 **TRUE**,则加入节点必须经历链路密钥交换过程;无法交换链路密钥将导致节点从网络中移除。如果 **bdbTrustCenterRequireKeyExchange** 等于 **FALSE**,则信任中心将允许加入节点保留在网络上而不交换其初始链路密钥。
539 |
540 | 此属性被 ZigBee 协调器节点使用。
541 |
542 | # 6. 一般要求
543 |
544 | 本条款规定了实现基础设备行为规范的所有节点的一般要求。
545 |
546 | ## 6.1 ZigBee 逻辑设备类型
547 |
548 | 逻辑设备类型被指定为 ZigBee 协调器的节点应(SHALL)包含信任中心的角色。ZigBee 协调器应(SHALL)形成集中式安全网络,因此,不应(SHALL NOT)尝试加入另一个网络。
549 |
550 | 逻辑设备类型被指定为 ZigBee 路由器的节点应(SHALL)能够加入现有的集中式或分布式安全网络。然而,ZigBee 路由器不应(SHALL NOT)形成集中式安全网络,但如果现有的集中式或分布式安全网络无法加入,则可以(MAY)形成分布式安全网络。
551 |
552 | 逻辑设备类型被指定为 ZigBee 终端设备的节点应(SHALL)能够加入现有的集中式或分布式安全网络。
553 |
554 | 一个节点可以(MAY)支持成为 ZigBee 协调器和 ZigBee 路由器的能力,其可在应用程序控制下切换。然而,在任何时候,该节点都应(SHALL)只被指定为其中的一种类型。这就允许节点作为 ZigBee 路由器以尝试加入网络的场景,并且如果没有网络可加入,则该节点可以切换成 ZigBee 协调器,并因此形成集中式安全网络。一旦节点形成或加入网络,它不应(SHALL NOT)改变其类型,除非它先破坏或离开该网络。
555 |
556 | ## 6.2 网络安全模型
557 |
558 | ZigBee 网络可以(MAY)支持集中式安全模型(集中式安全网络)或分布式安全模型(分布式安全网络)。所有非 ZigBee 协调器节点都应(SHALL)能够加入任一模型支持的网络,并适应其加入网络的安全条件(参见 \[R1\] 的子条款 4.6.3)。这种适应性对用户应该(SHOULD)尽可能地无缝。
559 |
560 | ## 6.3 链路密钥
561 |
562 | 每个节点都应(SHALL)包含以下链路密钥:
563 |
564 | 1. 默认全局信任中心链路密钥(default global Trust Center link key)
565 | 2. 分布式安全全局链路密钥(distributed security global link key)
566 | 3. 安装码派生的预配置链路密钥(install code derived preconfigured link key)
567 |
568 | 此外,如果节点支持 touchlink commissioning,它还应包含以下链路密钥:
569 |
570 | 4. Touchlink 预配置链路密钥(touchlink preconfigured link key)
571 |
572 | **bdbNodeJoinLinkKeyType** 属性指示了在加入期间用于解密网络密钥的链路密钥类型。
573 |
574 | ### 6.3.1 默认全局信任中心链路密钥
575 |
576 | 默认全局信任中心链路密钥是所有设备都支持的链路密钥,如果未指定其他链路密钥,则其可用于加入集中式安全网络。此链路密钥的值应(SHALL)为:
577 |
578 | ```
579 | Default global Trust Center link key (0:15) = 0x5a 0x69 0x67 0x42
580 | 0x65 0x65 0x41 0x6c
581 | 0x6c 0x69 0x61 0x6e
582 | 0x63 0x65 0x30 0x39
583 | ```
584 |
585 | ### 6.3.2 分布式安全全局链路密钥
586 |
587 | 分布式安全全局链路密钥用于加入分布式安全网络。该链路密钥被提供给公司,以作为一个产品成功认证的结果。对于测试,此密钥的值应(SHALL)为:
588 |
589 | ```
590 | Distributed security global link key (0:15) = 0xd0 0xd1 0xd2 0xd3
591 | 0xd4 0xd5 0xd6 0xd7
592 | 0xd8 0xd9 0xda 0xdb
593 | 0xdc 0xdd 0xde 0xdf
594 | ```
595 |
596 | ### 6.3.3 安装码派生的预配置链路密钥
597 |
598 | 安装码派生的预配置链路密钥是由为产品创建的随机安装码生成的,并以制造商特定的方式提供给节点,以在安装期间引用。有关详细信息,请参阅子条款 10.1。
599 |
600 | ### 6.3.4 Touchlink 预配置链路密钥
601 |
602 | Touchlink 预配置链路密钥用于加入网络(通过 touchlink)。该链路密钥被提供给公司,以作为一个产品成功认证的结果。对于测试,此密钥的值应(SHALL)为:
603 |
604 | ```
605 | Touchlink preconfigured link key (0:15) = 0xc0 0xc1 0xc2 0xc3
606 | 0xc4 0xc5 0xc6 0xc7
607 | 0xc8 0xc9 0xca 0xcb
608 | 0xcc 0xcd 0xce 0xcf
609 | ```
610 |
611 | 在 touchlink 过程中使用 touchlink 预配置链路密钥的节点应(SHALL)将 **scan response** inter-PAN 命令帧的 **key bitmask** 字段的第 4 位或第 15 位设置为 1(参见 \[R2\]),具体取决于节点是在认证测试期间还是在认证后的产品中使用(正常操作)。
612 |
613 | ## 6.4 安装码的使用
614 |
615 | 所有节点都应(SHALL)支持安装码。
616 |
617 | 通过零售渠道无法获得和专业安装的节点(例如,电表或燃气表)可以(MAY)被配置为在加入时需要使用安装码。
618 |
619 | 通过零售渠道可获得和支持用户配置机制的节点(例如,物理开关)可以(MAY)默认为一种仅需使用安装码的入网络模式。然而,其应(SHALL)有一个机制,以切换到所有可考虑的入网络模式。
620 |
621 | 通过零售渠道获得但没有用户配置机制的节点应(SHALL)能够自动加入所有网络。
622 |
623 | 信任中心可以(MAY)要求加入其网络的所有节点使用安装码。
624 |
625 | ## 6.5 Commissioning
626 |
627 | 所有节点都应(SHALL)支持网络转向,以便所有节点都可以使用一个通用的机制作为后备。实现简单设备类的设备应(SHALL)支持查找和绑定,而实现动态或节点设备类的设备可(MAY)支持查找和绑定。根据节点上实现的各个设备规范,可以(MAY)支持其他 commissioning 机制。
628 |
629 | 节点支持的 commissioning 机制在 **bdbNodeCommissioningCapability** 属性中指定(参见子条款 5.3)。
630 |
631 | 本规范规定了以下 commissioning 机制的过程:
632 |
633 | * 网络转向。所有节点都应(SHALL)支持网络转向。
634 | * 网络形成。节点形成网络的能力及其网络安全模型应(SHALL)取决于节点的逻辑设备类型。
635 | * 查找和绑定。在实现简单设备类的设备上应(SHALL)支持定位和绑定到其他设备上的应用簇的能力,并且可以(MAY)在实现动态或节点设备类的设备上也支持该能力。
636 | * Touchlink commissioning。节点可以(MAY)支持基于邻近的 commissioning 机制。如果支持 touchlink commissioning,则节点应(SHALL)支持作为 touchlink 发起者,目标或两者。
637 |
638 | 一个实现可以(MAY)随时使用 commissioning,例如,可以随时对整个节点执行网络转向,或者在适合应用程序的任何端点上随时执行查找和绑定。但是,每次使用时都应(SHALL)按照顶级 commissioning 过程中的规定执行。
639 |
640 | 例如,在单个端点上实现温度传感器设备的节点可以在激活特定用户按钮时使用 commissioning 过程。类似地,在两个端点(每个开关一个)上实现 开/关 灯开关设备的节点可以在激活每个开关时使用 commissioning 过程。
641 |
642 | 所需的 commissioning 过程由每个活动端点定义的若干属性控制(另请参见子条款 5.3):**bdbCommissioningMode**,**bdbCommissioningGroupID** 和 **bdbCommissioningStatus**。要执行 commissioning,需要在 **bdbCommissioningMode** 属性中指定要在当时执行的 commissioning 选项。如果需要查找和绑定,还要指定 **bdbCommissioningGroupID**(用于查找和绑定的分组)。请注意,如果不需要分组绑定,则 **bdbCommissioningGroupID** 属性被设置为 **0xffff**。执行请求的 commissioning 选项后,**bdbCommissioningStatus** 属性将指示尝试的状态。
643 |
644 | **bdbCommissioningMode** 中指定的 commissioning 选项按照最低有效位的顺序执行,即首先是 touchlink commissioning,然后是网络转向,再后是网络形成,最后是查找和绑定,如下所示:
645 |
646 | 1. 如果指定了作为 touchlink commissioning 发起者并且成功,则在调用 commissioning 过程期间不应(SHALL)执行 **bdbCommissioningMode** 中指定的其他 commissioning 选项。注意,如果发起者接收到对 touchlink 扫描请求的响应,则认为 touchlink 成功。
647 | 2. 如果指定了网络转向,则节点应(SHALL)根据节点是否已加入网络来尝试网络转向。
648 | 3. 如果指定了网络形成,则节点应(SHALL)仅在节点尚未加入网络时尝试网络形成。因此,如果指定了网络转向并且成功,则节点不应(SHALL NOT)尝试网络形成。如果指定了网络形成且节点是 ZigBee 协调器,则它应(SHALL)尝试形成集中式安全网络。相反,如果指定了网络形成且节点是 ZigBee 路由器,则它应(SHALL)尝试形成分布式安全网络。如果节点是 ZigBee 终端设备,则它应(SHALL)跳过网络形成。
649 | 4. 如果指定了查找和绑定,则节点应(SHALL)仅在网络上可操作时才尝试查找和绑定。可以(MAY)在节点上实现的一个或多个端点上发起查找和绑定,其形式取决于簇类(有关详细信息,请参阅 \[R3\])。对于类型 1 客户端或类型 2 服务端簇,应用程序应(SHALL)执行查找和绑定以作为发起者端点。相反,对于类型 1 服务端或类型 2 客户端簇,应用程序应(SHALL)执行查找和绑定以作为目标端点。
650 |
651 | ## 6.6 所有设备的最低要求
652 |
653 | 所有节点都应(SHALL)支持以下要求:
654 |
655 | * 节点应(SHALL)处理 ZDO 发现服务命令:**Active\_EP\_req**、**Node\_Desc\_req**、**Simple\_Desc\_req**、**IEEE\_addr\_req**,**NWK\_addr\_req** 和 **Match\_Desc\_req**;并分别用 **Active\_EP\_rsp**、**Node\_Desc\_rsp**、**Simple\_Desc\_rsp**、**IEEE\_addr\_rsp**,**NWK\_addr\_rsp** 和 **Match\_Desc\_rsp** 命令进行响应。
656 | * 节点应(SHALL)处理 ZDO 节点管理器服务命令:**Mgmt\_Bind\_req** 和 **Mgmt\_Lqi\_req**;并分别用 **Mgmt\_Bind\_rsp** 和 **Mgmt\_Lqi\_rsp** 命令进行响应。
657 | * 节点应(SHALL)处理 ZDO 绑定表服务命令:**Bind\_req** 和 **Unbind\_req**;并分别使用 **Bind\_rsp** 和 **Unbind\_rsp** 命令进行响应。
658 | * 节点应(SHALL)处理 ZDO 网络管理器服务命令:**Mgmt\_Leave\_req**;并使用 **Mgmt\_Leave\_rsp** 命令进行响应。
659 | * 节点应(SHALL)能够在查找和绑定期间广播 **Identify Query** 命令帧之后,处理接收至少一个 **Identify** 簇,**Identify Query Response** 命令帧。如果节点能够处理接收多个 **Identify Query Response** 命令帧,那么它的处理是特定于实现的。
660 | * 支持作为查找和绑定发起者的节点应(SHALL)实现一个绑定表,其可用条目数大于或等于节点的每个设备上支持的簇实例(应用事务的发起者)的总和。在查找和绑定,touchlink 或集中式 commissioning 期间,绑定都是被配置在绑定表中。无论用于生成绑定的 commissioning 机制如何,绑定表都应(SHALL)是一致的,以便可以使用 **Mgmt\_Bind\_req** 命令检索其内容。
661 | * 对于每个指定为强制的和可报告的已实现属性,节点应(SHALL)具有一个默认的报告配置(参见子条款 6.7)。
662 | * 可以成为应用事务的目标的节点应(SHALL)支持分组寻址并且分组表中至少有 8 个成员(memberships)。
663 |
664 | ## 6.7 默认报告配置
665 |
666 | 对于指定为可报告的每个已实现属性,应(SHALL)存在一个默认的报告配置(最大报告间隔为 **0x0000** 或在 **0x003d** 到 **0xfffe** 范围内)。默认报告配置是这样的:如果在节点上创建了给定簇的绑定,则节点应(SHALL)向该绑定发送报告,而无需设置任何额外的报告配置。可以(MAY)随时覆盖属性的默认报告配置。在这种情况下,应(SHALL)使用更新后的报告配置。
667 |
668 | 从同一属性的上一个报告开始,当经过的时间等于该属性的最大报告间隔时,应(SHALL)生成一个报告。配置后的第一个报告的时间未被指定。如果最大报告间隔被设置为 **0x0000**,则不会定期报告,但基于更改的报告仍可操作。
669 |
670 | 考虑一个简单的湿度传感器以作为一个默认报告配置的示例。湿度传感器最好清楚其报告配置应该是什么,以节省电池电量。因此,它应该具有一个默认报告配置,以便一旦它加入网络并创建绑定,它就会立即开始发送其湿度报告。
671 |
672 | ## 6.8 MAC 数据轮询
673 |
674 | 所有嗜睡的 ZigBee 终端设备都需要 MAC 数据轮询才能在 ZigBee-PRO 网络中正常操作。基础设备行为规范不限制 MAC 数据轮询的频率。数据轮询频率的选择根据产品的功耗设计因素来作出决定。然而,以下是一个确保其在网络中正确操作的建议集:
675 |
676 | MAC 数据轮询率应该(SHOULD)基于节点的操作状态是动态的。建议(RECOMMENDED)它至少有两种速率,一个快速率和一个慢速率。
677 |
678 | ZigBee 规范仅要求父节点缓冲单个消息 7.5 秒。该单个缓冲区适用于所有嗜睡的 ZigBee 终端设备。因此,一个嗜睡的 ZigBee 终端设备应该(SHOULD)更频繁地(快于 7.5 秒每次)轮询,以便能够检索它所期望的缓冲消息。
679 |
680 | 当节点等待活动响应消息(例如 APS 确认,ZCL 响应或参与多消息协议)时,它应该(SHOULD)以其快速率进行轮询。建议(RECOMMENDED)这个快速率至少为每 3 秒钟一次。
681 |
682 | 当节点没有等待活动消息时,它可以(MAY)慢速率进行轮询,例如每小时一次。这可确保它仍与网络及其父系连接。
683 |
684 | 在初加入 ZigBee-PRO 网络期间,包括查找和绑定,嗜睡的 ZigBee 终端设备应该(SHOULD)以快速率进行轮询。
685 |
686 | ## 6.9 ZigBee 持久数据
687 |
688 | 除了 ZigBee 规范(参见 \[R1\])和 ZCL 规范(参见 \[R2\])中指定的持久数据外,节点还应(SHALL)在重置间保留以下数据:
689 |
690 | * bdbNodeIsOnANetwork 属性
691 |
692 | # 7. 初始化
693 |
694 | 当节点在第一次上电或在后续以某种形式 断电/重启 上电后,节点将会执行初始化。ZigBee 规范(参见 \[R1\])和子条款 6.9 中定义了节点在重置间预期保存的数据,其首先恢复该数据以确定如何初始化节点。如果节点是路由器,则建议(RECOMMENDED)首先尝试发现其网络是否仍然存在,或已移至另一个信道并采取相应的纠正措施。
695 |
696 | ## 7.1 初始化过程
697 |
698 | 本节定义了节点的初始化过程。Figure 1 展示了此过程的简化版本,以供快速参考。
699 |
700 | 
701 |
702 | 1. 节点应(SHALL)恢复其持久的 ZigBee 数据,如子条款 6.9 中所述。
703 | 2. 如果 **bdbNodeIsOnANetwork** 等于 **FALSE**,则节点应(SHALL)从步骤 6 继续。
704 | 3. 如果节点的节点描述符的 **logical type** 字段不等于 **0b010**(ZigBee 终端设备),则它应(SHALL)从步骤 8 继续。
705 | 4. 节点应(SHALL)尝试重新加入网络。为此,节点发出 **NLME-JOIN.request** 原语(**ExtendedPANId** 参数设置为已知网络的扩展 PAN 标识符、**RejoinNetwork** 设置为 **0x02**、**ScanChannels** 设置为 **0x00000000**、**ScanDuration** 设置为 **0x00**、**CapabilityInformation** 设置为适合节点的值、**SecurityEnable** 设置为 **TRUE**)。在从 NWK 层接收到 **NLME-JOIN.confirm** 原语时,将通知节点其请求的状态。
706 | 5. 如果 **NLME-JOIN.confirm** 原语的 **Status** 参数等于 **SUCCESS**,则节点应(SHALL)广播 **Device\_annce** ZDO 命令并从步骤 8 继续。如果 **NLME-JOIN.confirm** 原语的 **Status** 参数不等于 **SUCCESS**,则节点可以(MAY)在某个应用程序特定的时间重试该过程,或者从步骤 8 继续。实现的责任是处理后续的重新加入尝试。
707 | 6. 如果节点的节点描述符的 **logical type** 字段不等于 **0b001**(ZigBee 路由器),则它应(SHALL)从步骤 8 继续。
708 | 7. 如果 **bdbNodeCommissioningCapability** 的第 3 位等于 **1**(即支持 touchlink),则节点应(SHALL)将其逻辑信道设置为 **bdbcTLPrimaryChannelSet** 中指定的信道之一。
709 | 8. 然后节点应(SHALL)终止该初始化过程。
710 |
711 | # 8. Commissioning
712 |
713 | 当节点不在网络上、在网络上但未绑定到另一个设备或在网络上并绑定到另一个设备时,可以(MAY)调用 Commissioning。Commissioning 可以(MAY)通过用户交互、一些空中机制(例如在 **Identify** 簇中定义的)或由应用软件直接调用(例如在初始化后自动调用)来触发。本节中指定的 commissioning 过程定义了调用 commissioning 时的步骤和状态。
714 |
715 | 实现应(SHALL)提供一种使用网络转向以调用 commissioning 的机制(参见子条款 8.2 和 8.3)。此外,简单设备应(SHALL)提供一种使用查找和绑定以调用 commissioning 的机制(参见子条款 8.5 和 8.6)。同样,如果动态设备支持查找和绑定,那么其应(SHALL)提供一种使用查找和绑定以调用 commissioning 的机制。如果应用程序要求,这些 commissioning 动作可以(MAY)被重载。实现还可以(MAY)为其他 commissioning 动作提供单独的或重载的机制。
716 |
717 | 通过 **bdbCommissioningMode** 属性控制每个端点的 Commissioning 过程,并且在 commissioning 开始之前,应该(SHOULD)视情况对每个应用刺激进行配置。例如,这允许实现使用网络转向和查找和绑定来重载应用刺激。
718 |
719 | ## 8.1 顶级 commissioning 过程
720 |
721 | 本节定义了在某些触发器上激活的顶级 commissioning 过程。
722 |
723 | 触发器是通过一些应用程序定义的刺激,例如按下按钮或来自用户界面的某些命令。刺激可以是每个端点的,也可以是整个节点的。发生这种情况的标准是制造商特定的。
724 |
725 | 应用程序通过将所需端点上的 **bdbCommissioningMode** 属性设置为适当的值(请参阅子条款 5.3.2)来配置所需的 commissioning 动作,然后执行下述过程。
726 |
727 | Figure 2 展示了此过程的简化版本,以供快速参考。
728 |
729 | 
730 |
731 | 1. 在收到 commissioning 应用刺激后,设备首先将 **bdbCommissioningStatus** 设置为 **SUCCESS**,然后通过检查 **bdbCommissioningMode** 来确定所需的 commissioning 步骤。
732 | 2. 如果 **bdbCommissioningMode** 的第 0 位等于 **0**(即无需 touchlink),则设备应(SHALL)从步骤 5 继续。
733 | 3. 节点应遵循 touchlink 过程(作为发起者)(参见子条款 8.7)。
734 | 4. 如果 **bdbCommissioningStatus** 不等于 **NO\_SCAN\_RESPONSE**(即对来自发起者的 touchlink 扫描请求有响应,表示 touchlink 成功),则设备应(SHALL)从步骤 13 继续。
735 | 5. 如果 **bdbCommissioningMode** 的第 1 位等于 **0**(即无需网络转向),则设备应(SHALL)从步骤 7 继续。
736 | 6. 如果 **bdbNodeIsOnANetwork** 等于 **TRUE**,则节点应(SHALL)遵循已在网节点的网络转向过程(参见子条款 8.2)。如果 **bdbNodeIsOnANetwork** 等于 **FALSE**,则节点应(SHALL)遵循非在网节点的网络转向过程(参见子条款 8.3)。
737 | 7. 如果 **bdbCommissioningMode** 的第 2 位等于 **0**(即无需形成网络),则设备应(SHALL)从步骤 10 继续。
738 | 8. 如果 **bdbNodeIsOnANetwork** 等于 **TRUE**,则设备应(SHALL)从步骤 10 继续。
739 | 9. 如果节点的节点描述符的 **logical type** 字段等于 **0b000**(ZigBee 协调器)或 **0b001**(ZigBee 路由器),则节点应(SHALL)遵循网络形成过程(参见子条款 8.4)。
740 | 10. 如果 **bdbCommissioningMode** 的第 3 位等于 **0**(即无需查找和绑定),则设备应(SHALL)从步骤 13 继续。
741 | 11. 如果 **bdbNodeIsOnANetwork** 等于 **FALSE**,则设备应(SHALL)从步骤 13 继续。
742 | 12. 如果 **bdbCommissioningMode** 的第 3 位等于 **1**,则该节点应(SHALL)根据(节点上定义的)端点上实现的簇的类别来遵循查找和绑定过程。对于类型 1 客户端或类型 2 服务端簇,应用程序应(SHALL)执行查找和绑定(作为发起者端点)(请参阅子条款 8.6)。相反,对于类型 1 服务端或类型 2 客户端簇,应用程序应(SHALL)执行查找和绑定(作为目标端点)(请参阅子条款 8.5)。请注意,当 commissioning 多个设备端点并且可以并行处理某些设备端点时,应用程序还有责任确定查找和绑定的执行顺序。
743 | 13. 设备应(SHALL)终止该顶级 commissioning 过程。
744 |
745 | ## 8.2 已在网节点的网络转向过程
746 |
747 | 本节定义已在网节点的网络转向过程。在此过程中,已在网节点将在一段有限的时间内开放网络以允许其他节点加入。
748 |
749 | Figure 3 展示了此过程的简化版本,以供快速参考。
750 |
751 | 
752 |
753 | 1. 节点首先将 **bdbCommissioningStatus** 设置为 **IN\_PROGRESS**。
754 | 2. 节点应(SHALL)广播 **Mgmt\_Permit\_Joining\_req** ZDO 命令,**PermitDuration** 字段设置为至少 **bdbcMinCommissioningTime**、**TC\_Significance** 字段设置为 **0x01**。
755 | 3. 如果节点的节点描述符的 **logical type** 字段等于 **0b000**(ZigBee 协调器)或 **0b001**(ZigBee 路由器),则节点发出 **NLME-PERMIT-JOINING.request** 原语(**PermitDuration** 参数设置为至少 **bdbcMinCommissioningTime**)。在从 NWK 层接收到 **NLME-PERMIT-JOINING.confirm** 原语时,将通知节点其请求的状态。
756 | 4. 然后,节点将 **bdbCommissioningStatus** 设置为 **SUCCESS**,并且它应(SHALL)终止已在网节点的网络转向过程。
757 |
758 | ## 8.3 非在网节点的网络转向过程
759 |
760 | 本节定义了非在网节点的网络转向过程。在此过程中,非在网节点将扫描开放网络,并且如果找到合适的节点则尝试加入。加入后,该节点被身份验证并接收网络密钥。最后,如果网络中存在信任中心,则该节点随后会将其预配置链路密钥与信任中心生成的链路密钥交换。
761 |
762 | 为此过程定义了两个变量:布尔值 **vDoPrimaryScan**,用于控制节点通过 主要信道集/次要信道集 执行信道扫描;32-bit 位映像 **vScanChannels**,用于定义要扫描的当前信道集。
763 |
764 | Figure 4 展示了此过程的简化版本,以供快速参考。
765 |
766 | 
767 |
768 | 1. 节点首先将 **bdbCommissioningStatus** 设置为 **IN\_PROGRESS**、**vDoPrimaryScan** 设置为 **TRUE**、**vScanChannel** 设置为 **bdbPrimaryChannelSet**。如果 **bdbPrimaryChannelSet** 等于 **0x00000000**,则节点应(SHALL)从步骤 12 继续。
769 | 2. 节点应(SHALL)执行信道扫描,以便发现在信道集的无线电范围内可用的网络。为此,节点发出 **NLME-NETWORK-DISCOVERY.request** 原语(**ScanChannels** 参数设置为 **vScanChannels**、**ScanDuration** 设置为 **bdbScanDuration**)。在从 NWK 层接收到 **NLME-NETWORK-DISCOVERY.confirm** 原语时,将通知节点其请求的状态。
770 | 3. 如果 **NLME-NETWORK-DISCOVERY.confirm** 原语中的 **Status** 参数不等于 **SUCCESS**,则表示信道扫描不成功,节点应(SHALL)从步骤 12 继续。
771 | 4. 节点应(SHALL)通过分析 **NetworkCount** 和 **NetworkDescriptor** 参数来确定是否找到了许可加入标志设置为 **TRUE** 的任何合适网络。由应用程序判定其是否属于合适网络。
772 | 5. 如果在信道扫描中未找到合适的网络,则节点应(SHALL)从步骤 12 继续。
773 | 6. 节点应(SHALL)尝试加入使用 MAC 关联找到的网络。为此,节点发出 **NLME-JOIN.request** 原语(**ExtendedPANId** 参数设置为所选网络的扩展 PAN 标识符、**RejoinNetwork** 设置为 **0x00**、**ScanChannels** 设置为 **0x00000000**、**ScanDuration** 设置为 **0x00**、**CapabilityInformation** 设置为适合节点的值、**SecurityEnable** 设置为 **FALSE**)。在从 NWK 层接收到 **NLME-JOIN.confirm** 原语时,将通知节点其请求的状态。
774 | 7. 如果 **NLME-JOIN.confirm** 原语中的 **Status** 参数不等于 **SUCCESS**,则表示加入不成功,节点应(SHALL)尝试从步骤 6 中加入到下一个合适的网络。注意,允许尝试再次加入同一网络,但这不应(SHALL NOT)连续尝试超过 **bdbcMaxSameNetworkRetryAttempts** 次(建议的(RECOMMENDED)连续次数为 **bdbcRecSameNetworkRetryAttempts**)。如果没有其他合适的网络可加入,则节点应(SHALL)从步骤 12 继续。
775 | 8. 如果 **NLME-JOIN.confirm** 原语中的 **Status** 参数等于 **SUCCESS**,则表示加入成功,节点应(SHALL)至少等待 **apsSecurityTimeOutPeriod** 毫秒以进行身份验证,并从其父系接收网络密钥。注意,网络密钥可以从集中式安全网络中的信任中心进行隧道传输,其使用默认的全局信任中心链路密钥或通过安装码派生的预配置链路密钥进行加密;或者直接从分布式安全网络中的父系进行传输,其使用分布式安全全局链路密钥进行加密。节点应(SHALL)相应地设置 **bdbNodeJoinLinkKeyType**,以指示使用那种链路密钥来解密收到的网络密钥。
776 | 9. 如果节点在 **apsSecurityTimeOutPeriod** 毫秒内未从其父系中接收到网络密钥、在 **apsSecurityTimeOutPeriod** 毫秒内收到网络密钥但无法解密或以其他方式认证失败,节点应(SHALL)重置其网络参数及选择加入下一个合适的网络并返回到步骤 6。注意,允许尝试再次加入同一网络,但这不应(SHALL NOT)连续尝试超过 **bdbcMaxSameNetworkRetryAttempts** 次(建议的(RECOMMENDED)连续次数为 **bdbcRecSameNetworkRetryAttempts**)。如果没有其他合适的网络可加入,则节点应(SHALL)从步骤 12 继续。
777 | 10. 节点将 **bdbNodeIsOnANetwork** 设置为 **TRUE**,然后广播 **Device\_annce** ZDO 命令。如果 **apsTrustCenterAddress** 等于 **0xffffffffffffffff**,则节点应(SHALL)从步骤 13 继续。
778 | 11. 节点应(SHALL)执行检索新信任中心链路密钥的过程(请参阅子条款 10.2.5)。如果该过程成功,则节点应(SHALL)从步骤 13 继续。如果不成功,则节点应(SHALL)在其旧网络上执行离开请求并重置其网络参数。然后,该节点将 **bdbNodeIsOnANetwork** 设置为 **FALSE**,并将 **bdbCommissioningStatus** 设置为 **TCLK\_EX\_FAILURE**。为了执行离开请求,节点会将 **NWME-LEAVE.request** 原语发布到 NWK 层(**DeviceAddress** 参数设置为 **NULL**、**RemoveChildren** 设置为 **FALSE**、**Rejoin** 设置为 **FALSE**)。在收到 **NLME-LEAVE.confirm** 原语时,将通知节点其请求的状态。然后,节点应(SHALL)终止非在网节点的网络转向过程。
779 | 12. 如果 **vDoPrimaryScan** 等于 **FALSE** 或 **bdbSecondaryChannelSet** 等于 **0x00000000**,则节点应(SHALL)从步骤 16 继续。如果 **bdbSecondaryChannelSet** 不等于 **0x00000000**,则节点应(SHALL)将 **vDoPrimaryScan** 设置为 **FALSE**、**vScanChannels** 设置为 **bdbSecondaryChannelSet** 并从步骤 2 继续。
780 | 13. 节点应(SHALL)广播 **Mgmt\_Permit\_Joining\_req** ZDO 命令(**PermitDuration** 字段设置为至少 **bdbcMinCommissioningTime**、**TC\_Significance** 设置为 **0x01**)。注意,这将导致接收此命令的节点重置定时器,在此期间,其许可加入标志被激活,从而延长了其他新节点的加入时间。
781 | 14. 如果节点能够允许新节点加入,则它应(SHALL)激活其许可加入标志。为此,节点发出 **NLME-PERMIT-JOINING.request** 原语(**PermitDuration** 参数设置为至少 **bdbcMinCommissioningTime**)。在从 NWK 层接收到 **NLME-PERMIT-JOINING.confirm** 原语时,将通知节点其请求的状态。
782 | 15. 然后,节点将 **bdbCommissioningStatus** 设置为 **SUCCESS**。如果节点支持 **touchlink**,则它会将 **aplFreeNwkAddrRangeBegin**、**aplFreeNwkAddrRangeEnd**、**aplFreeGroupID-RangeBegin** 和 **aplFreeGroupIDRangeEnd** 属性的值全部设置为 **0x0000**(表示节点已使用 MAC 关联加入网络)。然后,节点应(SHALL)终止非在网节点的网络转向过程。
783 | 16. 节点可以(MAY)使用某些制造商特定的过程进行重试或将 **bdbCommissioningStatus** 设置为 **NO\_NETWORK**,然后它应(SHALL)终止非在网节点的网络转向过程。如果尝试制造商特定的过程,则 **bdbCommissioningStatus** 和 **bdbNodeIsOnANetwork** 属性会在其终止时相应地更新,以便使 commissioning 过程保持一致性。
784 |
785 | ## 8.4 网络形成过程
786 |
787 | 本节定义了节点的网络形成过程。在此过程中,ZigBee 协调器节点形成集中式安全网络并激活其信任中心功能,而 ZigBee 路由器节点则形成分布式安全网络。
788 |
789 | 为此过程定义了两个变量:布尔值 **vDoPrimaryScan**,用于控制节点通过 主要信道集/次要信道集 执行信道扫描;32-bit 位映像 **vScanChannels**,用于定义要扫描的当前信道集。
790 |
791 | Figure 5 展示了此过程的简化版本,以供快速参考。
792 |
793 | 
794 |
795 | 1. 节点首先将 **bdbCommissioningStatus** 设置为 **IN\_PROGRESS**、**vDoPrimaryScan** 设置为 **TRUE**、**vScanChannel** 设置为 **bdbPrimaryChannelSet**。如果 **bdbPrimaryChannelSet** 等于 **0x00000000**,则节点应(SHALL)从步骤 4 继续。
796 | 2. 节点应(SHALL)尝试在其中一个指定的信道上形成网络。为此,节点发出 **NLME-NETWORK-FORMATION.request** 原语(**ScanChannels** 参数设置为 **vScanChannels**、**ScanDuration** 设置为 **bdbScanDuration**、**BeaconOrder** 设置为 **0x0f**、**SuperframeOrder** 设置为 **0x00**、**BatteryLifeExtension** 设置为 **FALSE**)。在从 NWK 层接收到 **NLME-NETWORK-FORMATION.confirm** 原语时,将通知节点其请求的状态。
797 | 3. 如果 **NLME-NETWORK-FORMATION.confirm** 原语的 **Status** 参数等于 **SUCCESS**,则表示已形成新网络,节点应(SHALL)从步骤 5 继续。
798 | 4. 如果 **vDoPrimaryScan** 等于 **FALSE** 或 **bdbSecondaryChannelSet** 等于 **0x00000000**,则节点应(SHALL)从步骤 8 继续。如果 **bdbSecondaryChannelSet** 不等于 **0x00000000**,则节点应(SHALL)将 **vDoPrimaryScan** 设置为 **FALSE**、**vScanChannels** 设置为 **bdbSecondaryChannelSet** 并从步骤 2 继续。
799 | 5. 节点将 **bdbNodeIsOnANetwork** 设置为 **TRUE**。如果节点的节点描述符的 **logical type** 字段不等于 **0b000**(ZigBee 协调器),则节点应(SHALL)从步骤 7 继续。
800 | 6. ZigBee 协调器节点应(SHALL)启动其信任中心功能(根据 \[R1\] 的子条款 4.6.1)。
801 | 7. 节点将 **bdbCommissioningStatus** 设置为 **SUCCESS**,并且应(SHALL)终止网络形成过程。
802 | 8. 节点将 **bdbCommissioningStatus** 设置为 **FORMATION\_FAILURE**,并且应(SHALL)终止网络形成过程。
803 |
804 | ## 8.5 目标端点的查找和绑定过程
805 |
806 | 本节定义了对目标端点的查找和绑定过程。在此过程中,目标端点在有限的持续时间内标识自身,然后处理来自发起者端点的后续查找和绑定请求。
807 |
808 | Figure 6 展示了此过程的简化版本,以供快速参考。
809 |
810 | 
811 |
812 | 1. 目标设备首先将 **bdbCommissioningStatus** 设置为 **IN\_PROGRESS**。
813 | 2. 目标设备应(SHALL)将 **Identify** 簇的 **IdentifyTime** 属性设置为至少 **bdbcMinCommissioningTime**。目标设备还可以(MAY)在任何其他标识端点上将 **Identify** 簇的 **IdentifyTime** 属性设置为至少 **bdbcMinCommissioningTime**。
814 | 3. 在 **IdentifyTime** 期间,目标设备应(SHALL)响应标识查询。标识查询可能会跟随其他查找和绑定命令;无论标识状态如何,都应(SHALL)对其进行处理。
815 | 4. 当 **IdentifyTime** 属性递减到零时,目标设备将 **bdbCommissioningStatus** 设置为 **SUCCESS**,并且它应(SHALL)终止目标端点的查找和绑定过程。
816 |
817 | ## 8.6 发起者端点的查找和绑定过程
818 |
819 | 本节定义了发起者端点的查找和绑定过程。在此过程中,发起者端点首先搜索正在标识目标端点,如果找到则请求其简单描述符。然后,发起者端点在其自身与目标端点之间搜索任何匹配的簇,并且在其绑定表中为找到的每个匹配创建相应的条目。如果请求分组绑定,则发起者端点配置目标端点的分组成员身份。
820 |
821 | Figure 7 展示了此过程的简化版本,以供快速参考。
822 |
823 | 
824 |
825 | 1. 发起者设备首先将 **bdbCommissioningStatus** 设置为 **IN\_PROGRESS**。
826 | 2. 发起者设备应(SHALL)将发起者端点的 **Identify** 簇的 **Identify Query** 命令广播到所有节点(即使用广播地址 0xffff)。发起者设备可以(MAY)一次或多次地广播该命令。
827 | 3. 如果没有收到 **Identify** 簇的 **Identify Query Response** 命令,则发起者设备将 **bdbCommissioningStatus** 设置为 **NO\_IDENTIFY\_QUERY\_RESPONSE**,并且应(SHALL)终止发起者端点的查找和绑定过程。如果至少接收到一个 **Identify** 簇的 **Identify Query Response** 命令,则发起者设备应(SHALL)注意每个传入帧(来自作出响应的目标设备,其被称为 “响应者”)的 NWK 地址(包含在 NWK 报头的 **source address** 字段中)和端点(包含在 APS 报头的 **source endpoint** 字段中的)。
828 | 4. 发起者设备应(SHALL)从响应者中获取下一个响应端点的简单描述符。为此,发起者设备应(SHALL)将 **Simple\_Desc\_req** ZDO 命令单播到响应者(**NWKAddrOfInterest** 字段设置为响应者的 NWK 地址、**EndPoint** 设置为被寻址端点的标识符(从响应者的 **Identify** 簇的 **Identify Query Response** 命令的 APS 报头中找到))。
829 | 5. 如果未从响应者中接收到 **Simple\_Desc\_rsp** ZDO 命令或者接收到 **Status** 字段不等于 **SUCCESS** 的 **Simple\_Desc\_rsp** ZDO 命令,则发起者设备应(SHALL)从步骤 10 继续。
830 | 6. 发起者应(SHALL)检查响应者的简单描述符的 **Application Input Cluster List** 或 **Application Output Cluster List** 字段中列出的下一个应用目标簇,如果发起者设备不支持相应的 客户端/服务端 簇,则发起者设备应(SHALL)从步骤 8 继续。
831 | 7. 如果发起者是一个简单设备,它应(SHALL)为该簇创建一个绑定表条目。相反,如果发起者不是一个简单设备,则它可以(MAY)为该簇创建一个绑定表条目。如果要创建一个单播绑定表条目(即如果 **bdbCommissioningGroupId** 等于 **0xffff**)并且响应者的 IEEE 地址是未知的,则发起者应(SHALL)在创建绑定之前使用 **IEEE\_addr\_req** ZDO 命令获取它。为了创建一个绑定表条目,发起者设备将发出 **APSME-BIND.request** 原语(**SrcAddr** 参数设置为发起者设备的 IEEE 地址(**aExtendedAddress**)、**SrcEndpoint** 设置为发起者端点的标识符、**ClusterId** 设置为匹配簇的标识符)。**DstAddrMode** 和 **DstAddr** 参数应(SHALL)分别设置为 **0x01** 和 **bdbCommissioningGroupId**(如果 **bdbCommissioningGroupId** 不等于 **0xffff**)或 **0x03** 和响应者的已知 IEEE 地址(如果 **bdbCommissioningGroupId** 等于 **0xffff**)。只有当 **bdbCommissioningGroupId** 等于 **0xffff** 时,才应该(SHOULD)包含 **DstEndpoint** 参数并将其设置为(已找到的匹配簇)响应者上的端点的标识符。在从 APS 子层接收到 **APSME-BIND.confirm** 原语时,将通知发起者设备其请求的状态。如果 **APSME-BIND.confirm** 原语的 **Status** 参数等于 **TABLE\_FULL**,则设备将 **bdbCommissioningStatus** 设置为 **BINDING\_TABLE\_FULL**,并且它(SHALL)应终止发起者端点的查找和绑定过程。
832 | 8. 如果从简单描述符中发现了更多匹配的簇,则发起者设备应(SHALL)选择下一个并从步骤 6 继续。
833 | 9. 如果 **bdbCommissioningGroupID** 不等于 **0xffff**,并且至少创建了一个绑定链路,则发起者设备应(SHALL)单播 **groups** 簇的 **add group** 命令到响应者;或广播 **groups** 簇的 **add group if identifying** 命令(**Group ID** 字段设置为 **bdbCommissioningGroupID**)。
834 | 10. 如果通过 **Identify Query** 命令发现了更多端点,则发起者设备应(SHALL)选择下一个端点并从步骤 4 继续。如果没有其他端点可供选择,则发起者设备将 **bdbCommissioningStatus** 设置为 **SUCCESS**,并且它应(SHALL)终止发起者端点的查找和绑定过程。注意:如果应用需要,发起者可以(MAY)发送 **Identify** 簇的 **Identify** 命令到所有标识目标(**IdentifyTime** 字段设置为 **0x0000**(停止标识过程))。
835 |
836 | ## 8.7 发起者的 Touchlink 过程
837 |
838 | 本节定义了发起者的 touchlink 过程。在此过程中,发起 touchlink 操作的节点称为 “发起者”,响应的节点称为 “目标”。发起者还扫描支持 touchlink 的节点,如果找到,就会与目标建立一个新的网络(如果发起者不在网络上)或将目标添加到网络(如果发起者已经在网络上)。
839 |
840 | 为此过程定义了三个变量:布尔值 **vDoPrimaryScan**,用于控制节点通过 主要信道集/次要信道集 执行信道扫描;32-bit 位映像 **vScanChannels**,用于定义要扫描的当前信道集;**vIsFirstChannel** 控制是否使用第一个信道执行前五个 touchlink commissioning 扫描。
841 |
842 | 发起者的 touchlink 过程可以执行 “normal” 信道扫描或 “extended” 信道扫描。如果需要重置为 factory new(参见子条款 9.2),或者目标可能在 **bdbcTLPrimaryChannelSet** 中定义的信道之外运行,则使用后者。对于常规信道扫描,**bdbPrimaryChannelSet** 和 **bdbSecondaryChannelSet** 应(SHALL)分别设置为 **bdbcTLPrimaryChannelSet** 和 **0x00000000**。对于扩展信道扫描,**bdbPrimaryChannelSet** 和 **bdbSecondaryChannelSet** 应(SHALL)分别设置为 **bdbcTLPrimaryChannelSet** 和 **bdbcTLSecondaryChannelSet**。
843 |
844 | Figure 8 展示了此过程的简化版本,以供快速参考。
845 |
846 | 
847 |
848 | 1. 发起者首先将 **bdbCommissioningStatus** 设置为 **IN\_PROGRESS**。
849 | 2. 发起者应(SHALL)生成一个 32-bit 事务标识符,在 touchlink 过程中使用的所有命令的 **inter-PAN transaction identifier** 字段中使用该标识符。事务标识符应(SHALL)是随机的、非零的和非顺序的。然后,发起者将 **vDoPrimaryScan** 设置为 **TRUE**、**vScanChannel** 设置为 **bdbPrimaryChannelSet**、**vIsFirstChannel** 设置为 **TRUE**。如果 **bdbPrimaryChannelSet** 等于 **0x00000000**,则节点应(SHALL)从步骤 4 继续。
850 | 3. 发起者应(SHALL)执行 touchlink 设备发现。如果 **vIsFirstChannel** 等于 **TRUE**,则发起者应(SHALL)将 **vIsFirstChannel** 设置为 **FALSE**,切换到 **vScanChannels** 定义的第一个通道,并广播五个连续的 **touchlink commissioning** 簇的 **scan request** inter-PAN 命令帧。然后,发起者应(SHALL)依次切换到 **vScanChannel** 中指定的每个剩余信道,并在每个信道上广播单个 **scan request** inter-PAN 命令帧。被广播的每个 **scan request** inter-PAN 命令帧应(SHALL)带有合适的 **ZigBee information** 和 **touchlink information** 字段值,并且带有一个 **0dBm** 的标称输出功率。每次传输后,发起者应(SHALL)等待 **bdbcTLScanTimeBaseDuration** 秒以接收任何响应。如果在扫描期间,发起者(**bdbNodeIsOnANetwork** 属性等于 **FALSE**)接收到另一个 **scan request** inter-PAN 命令帧(**touchlink information** 字段的 **factory new** 子字段等于 **1**),则应(SHALL)忽略它。相反,如果在扫描期间,发起者(**bdbNodeIsOnANetwork** 属性等于 **FALSE**)接收到另一个 **scan request** inter-PAN 命令帧(**touchlink information** 字段的 **factory new** 子字段等于 **0**),则它可以(MAY)停止发送自己的 **scan request** inter-PAN 命令帧并承担一个目标的角色(参见子条款 8.8),用一个 **touchlink commissioning** 簇的 **scan response** inter-PAN 命令帧进行响应,并为后续的 **touchlink** 命令帧而保持在同一信道上。Touchlink 设备发现可以(MAY)随时中止。由于没有更改任何节点参数(如网络设置),因此该步骤对所涉及的节点是非侵入式的。
851 | 4. 如果 **vDoPrimaryScan** 等于 **TRUE** 且 **bdbSecondaryChannelSet** 不等于 **0x00000000**,则节点将 **vDoPrimaryScan** 设置为 **FALSE**、**vScanChannels** 设置为 **bdbSecondaryChannelSet**,并且它应(SHALL)从步骤 3 继续。
852 | 5. 如果没有接收到 **touchlink commissioning** 簇的 **scan response** inter-PAN 命令帧,或者没有接收到 **touchlink commissioning** 簇的 **scan response** inter-PAN 命令帧(**inter-PAN transaction identifier** 字段等于发起者在其 **scan request** inter-PAN 命令帧中使用的值),则节点将 **bdbCommissioningStatus** 设置为 **NO\_SCAN\_RESPONSE**,它应(SHALL)终止发起者的 touchlink 过程。
853 | 6. Touchlink 设备发现可能导致多个 **touchlink commissioning** 簇的 **scan response** inter-PAN 命令帧在潜在目标列表中给出,应用程序通过某些特定的产品方式从中选择一个目标以进一步地进行处理。如果 **touchlink commissioning** 簇的 **scan response** inter-PAN 命令帧的 **touchlink information** 字段的 **touchlink priority request** 位等于 **1**,则发起者可以(MAY)考虑优先对这些节点进行处理。
854 | 7. 在任何顺序下,如果需要,发起者都可以(MAY)从目标中请求更多的设备信息,或者请求所选目标识别自己以便支持用户确认。为了从目标中请求更多的设备信息,发起者应(SHALL)生成和传输一个 **touchlink commissioning** 簇的 **device information request** inter-PAN 命令帧到合适的已发现目标,并等待一个相应的 **touchlink commissioning** 簇的 **device information response** inter-PAN 命令帧(注意,如果目标只有一个子设备,则这不是必需的,因为它的信息完全包含在 **scan response** 命令帧中)。为了请求目标标识自己,发起者应(SHALL)生成和传输一个 **touchlink commissioning** 簇的 **identify request** inter-PAN 命令帧到合适的已发现目标。发起者可以(MAY)向所选目标进一步地发送 **identify request** inter-PAN 命令帧,例如,要停止标识操作,前提是它可以在 touchlink 事务开始的 **bdbcTLInterPANTransIdLifetime** 秒内完成。如果这不可能,则应(SHALL)执行新的 touchlink 设备发现操作。
855 | 8. 如果 **scan response** 命令帧的 **extended PAN identifier** 字段不等于 **nwkExtendedPANID**(即目标与发起者不在同一网络上),则发起者应(SHALL)从步骤 10 继续。
856 | 9. 如果 **scan response** 命令帧的 **network update identifier** 字段低于 **nwkUpdateId**(即目标已错过了信道变更),则发起者应(SHALL)生成和传输一个 **touchlink commissioning** 簇的 **network update request** 命令帧到目标(**network update identifier** 字段设置为 **nwkUpdateId**、**logical channel** 设置为发起者的当前操作信道)。如果 **scan response** 命令帧的 **network update identifier** 字段高于 **nwkUpdateId**(即发起者已错过了信道变更),则发起者应(SHALL)将 **nwkUpdateId** 及其当前操作信道分别设置为 **scan response** 命令帧的 **network update identifier** 和 **logical channel** 的值。发起者应(SHALL)从步骤 26 继续。
857 | 10. 如果 **apsTrustCenterAddress** 的值不等于 **0xffffffffffffffff**(即发起者位于集中式安全网络上),则发起者将 **bdbCommissioningStatus** 设置为 **NOT\_PERMITTED**,并且它应(SHALL)终止发起者的 touchlink 过程。
858 | 11. 如果发起者不具 touchlink 地址分配能力,则将 **bdbCommissioningStatus** 设置为 **NOT\_AA\_CAPABLE**,并且它应(SHALL)终止发起者的 touchlink 过程。
859 | 12. 如果 **bdbNodeIsOnANetwork** 等于 **TRUE**,则发起者应(SHALL)从步骤 23 继续。
860 | 13. 如果发起者的节点描述符的 **logical type** 字段等于 **0b001**(ZigBee 路由器),则发起者应(SHALL)从步骤 21 继续。
861 | 14. 如果所选目标不是 ZigBee 路由器,则发起者将 **bdbCommissioningStatus** 设置为 **NO\_NETWORK**,并且它应(SHALL)终止发起者的 touchlink 过程。
862 | 15. 发起者应(SHALL)生成和单播 **touchlink commissioning** 簇的 **network start request** inter-PAN 命令帧到所选的目标。发起者应(SHALL)将 **logical channel** 字段设置为零(指示目标应该选择信道)或设置为 **bdbcTLPrimaryChannelSet** 中的信道(如果首选是特定的主要信道)。发起者应(SHALL)将 **extended PAN identifier** 和 **PAN identifier** 字段设置为零。发起者还应(SHALL)分别将 **initiator IEEE address** 和 **initiator network address** 字段设置为它的 IEEE 地址和它将在新网络上使用的网络地址。所有其他字段应(SHALL)根据第 8.7.1 小节指定。
863 | 16. 发起者应(SHALL)启用其接收器并等待最多 **bdbcRxWindowDuration** 秒,或直到从预期目标中接收到相应的 **network start response** inter-PAN 命令帧(**inter-PAN transaction identifier** 字段与发起者在 **scan request** 命令帧中使用的一致)。如果在 **bdbcRxWindowDuration** 秒内未收到相应的 **network start response** inter-PAN 命令帧,或者如果在 **bdbcRxWindowDuration** 秒内收到相应的 **network start response** inter-PAN 命令帧但其 **Status** 参数为非零值,则发起者将 **bdbCommissioningStatus** 设置为 **NO\_NETWORK**,并且它应(SHALL)终止发起者的 touchlink 过程。
864 | 17. 在接收到 **network start response** inter-PAN 命令帧(**Status** 参数为 **SUCCESS**)时,发起者应(SHALL)将这些参数复制到其网络信息库中。发起者应(SHALL)确定 **apsDeviceKeyPairSet** 中是否存在一个条目(**DeviceAddress** 字段对应为 **0xffffffffffffffff**)。如果此条目不存在,则发起方应(SHALL)创建一个新条目(**DeviceAddress** 字段设置为 **0xffffffffffffffff**、**apsLinkKeyType** 字段设置为 **0x01**、**LinkKey** 字段设置为分布式安全全局链路密钥、**OutgoingFrameCounter** 和 **IncomingFrameCounter** 字段设置为 **0**)。
865 | 18. 发起者应(SHALL)至少等待 **bdbcTLMinStartupDelayTime** 秒以允许目标启动网络。
866 | 19. 如果发起者的节点描述符的 **logical type** 字段不等于 **0b010**(ZigBee 终端设备)或者没有发送 **network start request** inter-PAN 命令帧,则发起者应(SHALL)从步骤 26 继续。
867 | 20. 发起者应(SHALL)执行网络重新加入请求。为此,发起者发出 **NLME-JOIN.request** 原语(**ExtendedPANId** 参数设置为所选网络的扩展 PAN 标识符、**RejoinNetwork** 设置为 **0x02**(该节点使用 NWK 重新加入过程加入网络)、**ScanChannels** 设置为 **0x00000000**、**ScanDuration** 设置为 **0x00**、**CapabilityInformation** 设置为适合节点的值、**SecurityEnable** 设置为 **TRUE**)。在从 NWK 层接收到 **NLME-JOIN.confirm** 原语时,将通知发起者其请求的状态。然后,发起者应(SHALL)从步骤 26 继续。
868 | 21. 发起者应(SHALL)执行网络发现以建立网络参数。为此,发起者将 **NWME-NETWORK-DISCOVERY.request** 原语发布到 NWK 层(**ScanChannels** 参数设置为 **bdbcTLPrimaryChannelSet**、**ScanDuration** 设置为 **bdbScanDuration**)。在从 NWK 层接收到 **NLME-NETWORK-DISCOVERY.confirm** 原语时,将结果通知发起者。基于这些结果,发起者应(SHALL)为网络的逻辑信道、PAN 标识符和扩展 PAN 标识符选择合适的值。
869 | 22. 发起者应(SHALL)将新网络参数复制到其网络信息库,并在新网络上开始操作。为此,发起者将 **NLME-START-ROUTER.request** 原语发布到 NWK 层(**BeaconOrder** 参数设置为 **0x0f**、**SuperframeOrder** 设置为 **0x00**、**BatteryLifeExtension** 设置为 **FALSE**)。在收到 **NLME-START-ROUTER.confirm** 原语后,将通知发起者其请求的状态。
870 | 23. 发起者应(SHALL)根据目标是 ZigBee 路由器还是 ZigBee 终端设备,分别生成和单播 **touchlink commissioning** 簇的 **network join router request** 或 **network join end device** inter-PAN 命令帧(**extended PAN identifier**、**network update identifier**、**logical channel** 和 **PAN identifier** 字段设置为发起者使用的相应网络参数值)到所选目标。所有其他字段应(SHALL)根据第 8.7.1 小节指定。
871 | 24. 发起者应(SHALL)启用其接收器并等待最多 **bdbcRxWindowDuration** 秒或直到从预期目标接收到相应的 **response** inter-PAN 命令帧(**inter-PAN transaction identifier** 字段与发起者在 **scan request** 命令帧中使用的一致)。**network join router request** 和 **network join end device request** 命令帧对应的响应分别是 **touchlink commissioning** 簇的 **network join router response** 和 **network join end device response** 命令帧。如果在 **bdbcRxWindowDuration** 秒内未收到相应的 **response** inter-PAN 命令帧,或者在 **bdbcRxWindowDuration** 秒内收到相应的 **response** inter-PAN 命令帧但其 **Status** 参数为非零值,则发起者将 **bdbCommissioningStatus** 设置为 **TARGET\_FAILURE**,并且它应(SHALL)终止发起者的 touchlink 过程。
872 | 25. 发起者应(SHALL)至少等待 **bdbcTLMinStartupDelayTime** 秒,以允许目标正确地启动网络或在网络上开始操作。
873 | 26. 如果发起者是一个简单设备,它应(SHALL)在绑定表中建立到目标的绑定链路。相反,如果发起者不是一个简单设备,则它可以(MAY)在绑定表中建立到目标的绑定链路。如果要建立绑定链路,则发起者应(SHALL)基于在 **scan response** 和/或 **device information response** inter-PAN 命令帧中接收的端点和设备标识符信息,在绑定表中为发起者上的 客户端/服务端 簇与目标上对应的 服务端/客户端 簇建立绑定链路。发起者将 **bdbCommissioningStatus** 设置为 **SUCCESS**,**bdbNodeIsOnANetwork** 设置为 **TRUE**,并且它应(SHALL)终止发起者的 touchlink 过程。
874 |
875 | ### 8.7.1 网络 启动/加入 命令的常规字段设置
876 |
877 | #### 8.7.1.1 Inter-PAN transaction identifier 字段
878 |
879 | **Inter-PAN transaction identifier** 字段应(SHALL)设置为 **scan request** 命令帧中使用的相同值。
880 |
881 | #### 8.7.1.2 Key index 和 encrypted network key 字段
882 |
883 | **Key index** 字段应(SHALL)设置为与 **encrypted network key** 字段(即 touchlink 预配置链路密钥)中用于加密 ZigBee 网络密钥的密钥相对应的 touchlink 密钥索引(参见 \[R2\])。在认证测试期间,该值应(SHALL)设置为 **0x04**,或在其他所有时间设置为 **0x0f**。
884 |
885 | **encrypted network key** 字段应(SHALL)包含已加密的 ZigBee 网络密钥已保护网络。ZigBee 网络密钥应(SHALL)使用 touchlink 预配置链路密钥进行加密。
886 |
887 | #### 8.7.1.3 Network address 字段
888 |
889 | **Network address** 字段应(SHALL)设置为目标在网络上操作的网络地址。
890 |
891 | 如果 **aplFreeNwkAddrRangeBegin** 属性(参见 \[R2\])的值等于 **0x0000**(指示发起者已使用 MAC 关联加入网络),则地址应(SHALL)根据经典的 ZigBee 机制随机生成。如果 **aplFreeNwkAddrRangeBegin** 属性的值不等于 **0x0000**,则地址应(SHALL)等于 **aplFreeNwkAddrRangeBegin**,然后该值应(SHALL)递增。
892 |
893 | #### 8.7.1.4 Group identifiers begin/end 字段
894 |
895 | **Group identifiers begin** 和 **Group identifiers end** 字段应(SHALL)设置为分配给目标的分组标识符的允许范围。
896 |
897 | 如果目标在其 **scan response** 命令帧中请求了一组分组标识符,并且 **aplFreeGroupIDAddrRangeBegin** 属性(参见 \[R2\])的值等于 **0x0000**(发起者已使用 MAC 关联加入网络),则 **group identifiers begin** 和 **group identifiers end** 字段应(SHALL)设置为 **0x0000**。如果目标在其 **scan response** 命令帧中请求了一组分组标识符,并且 **aplFreeGroupIDAddrRangeBegin** 属性的值不等于 **0x0000**,则应(SHALL)为目标分配分组标识符范围,并且 **group identifiers begin** 和 **group identifiers end** 字段应相应地设置。
898 |
899 | #### 8.7.1.5 Free network/group address range begin/end 字段
900 |
901 | **Free network address range begin**、**Free network address range end**、**Free group identifier range begin** 和 **Free group identifier range end** 字段应(SHALL)设置为网络地址的允许范围和分配给目标的分组标识符,以便将来分配给加入设备。
902 |
903 | 如果目标指示其 **scan response** 命令帧中的地址分配能力且 **aplFreeNwkAddrRangeBegin** 属性(参见 \[R2\])的值等于 **0x0000**,则 **Free network address range begin**、**Free network address range end**、**Free group identifier range begin** 和 **Free group identifier range end** 字段应(SHALL)设置为 **0x0000**。如果目标指示其 **scan response** 命令帧中的地址分配能力且 **aplFreeNwkAddrRangeBegin** 属性的值不等于 **0x0000**,则应(SHALL)为目标分配网络地址和分组标识符,以用于其自身目的,并且 **Free network address range begin**、**Free network address range end**、**Free group identifier range begin** 和 **Free group identifier range end** 字段应相应地设置。
904 |
905 | ## 8.8 目标的 Touchlink 过程
906 |
907 | 本节定义了目标的 touchlink 过程。在此过程中,目标响应来自发起者的 touchlink 请求,并启动新网络或加入发起者的网络。由于此过程是对来自发起者的 touchlink 请求的响应,因此不通过顶级 commissioning 过程策动。
908 |
909 | 目标不应(SHALL NOT)更改其给定的网络地址,除非它离开并加入到另一个网络,或者需要解决地址冲突时,它可以这样做。
910 |
911 | 如果目标是正在睡眠的 ZigBee 终端设备,则它应(SHALL)首先需要被某些应用程序唤醒,以便它能够启用其接收器并响应来自发起者的扫描。
912 |
913 | 在当前事务完成之前,如果目标接收到额外的 **touchlink commissioning** 簇的 **scan request** 命令帧,则它可以(MAY)从头开始再次重新启动该过程或丢弃该帧。
914 |
915 | 注意,简单地接受 **touchlink commissioning** 簇的 **network start request** 和 **network join router/end device request** 命令帧可能会导致不希望的应用行为(目标离开它当前网络并加入到另一个网络,这在 touchlink 中被称为偷窃(stealing))。因此,该过程允许目标不接受这些命令,并通过设置相应的 **touchlink commissioning** 簇的 **network start response** 或 **network join router/end device** 命令帧的 **Status** 字段来指示这一点,以指示失败。
916 |
917 | **network start request**、**network join router/end device request** 和 **network update request** 命令帧是否被接受的条件是(制造商)产品特定的。这里可以在安全性(例如当节点是集中式安全网络的一部分时不允许被偷窃)和用户友好性(例如总是允许节点被偷窃)之间进行平衡,因为专用的和消费者的应用都存在不同的要求。
918 |
919 | 为此过程定义了一个变量:32-bit 无符号整数 **vIPTransID**,用于存储传入的 **touchlink commissioning** 簇的 **scan request** inter-PAN 命令帧的 **inter-PAN transaction identifier** 字段。
920 |
921 | Figure 9 展示了此过程的简化版本,以供快速参考。
922 |
923 | 
924 |
925 | 1. 在接收到 **touchlink commissioning** 簇的 **scan request** inter-PAN 命令帧之外的其他命令时,目标应(SHALL)终止目标的 touchlink 过程。
926 | 2. 目标将 **vIPTransID** 设置为 **inter-PAN transaction identifier** 字段的值,并且它应(SHALL)确定是否要响应。如果接收到 **scan request** 命令(RSSI 小于或等于某些产品特定的阈值)或者 **touchlink information** 字段的 **link initiator** 子字段等于 **0**,则目标应(SHALL)丢弃该帧并终止目标的 touchlink 过程。
927 | 3. 目标在 **bdbcTLInterPANTransIdLifetime** 秒后启动当前事务的定时器直到期满。随后,目标应(SHALL)生成和单播 **touchlink commissioning** 簇的 **scan response** inter-PAN 命令帧回发起者。**inter-PAN transaction identifier** 字段应(SHALL)设置为 **vIPTransID**。**RSSI correction** 字段应(SHALL)设置为产品特定的 RSSI 校正值,以便补偿无线电和产品外侧间的 RF 信号损耗。然后,发起者可以将此值与来自每个发现目标的 RSSI 结合使用,以选择合适的目标以继续进行 touchlink commissioning。如果目标希望在 touchlinking 期间被发起者优先考虑,则 **touchlink information** 字段的 **touchlink priority request** 子字段应(SHALL)被设置为 **1**(例如如果目标是功率受限并且在用户按下按钮后响应扫描)。**response identifier** 字段应(SHALL)设置为随机(非顺序)值。如果目标节点描述符的 **logical type** 字段等于 **0b001**(ZigBee 路由器)并且 **bdbNodeIsOnANetwork** 等于 **TRUE**,则 **extended PAN identifier**、**network update identifier**、**logical channel**、**PAN identifier** 和 **network address** 字段应(SHALL)设置为目标当前正在运行的网络的相应值。如果目标节点描述符的 **logical type** 字段不等于 **0b001**(ZigBee 路由器)或 **bdbNodeIsOnANetwork** 等于 **FALSE**,则 **extended PAN identifier**、**network update identifier**、**logical channel**、**PAN identifier** 和 **network address** 字段应(SHALL)设置为零。所有其他字段应(SHALL)根据目标的具体情况进行设置。
928 | 4. 在接收到 **touchlink commissioning** 簇的 **device information request**、**identify request**、**network start request**、**network join router request**、**network join end device request** 或 **reset to factory new request** inter-PAN 命令帧(**inter-PAN transaction identifier** 字段不等于 **vIPTransID**)时,目标应(SHALL)丢弃该帧并从步骤 4 继续。如果事务定时器到期,目标应(SHALL)终止目标的 touchlink 过程。
929 | 5. 在接收到 **device information request** inter-PAN 命令帧之外的其他命令时,目标应(SHALL)从步骤 6 继续。随后,目标应(SHALL)生成和单播 **touchlink commissionin** 簇的 **device information response** inter-PAN 命令帧回发起者。**inter-PAN transaction identifier** 字段应(SHALL)设置为 **vIPTransID**。所有其他字段应(SHALL)根据目标的具体情况进行设置。目标应(SHALL)从步骤 4 继续。
930 | 6. 在接收到 **identify request** inter-PAN 命令帧之外的其他命令时,目标应(SHALL)从步骤 8 继续。目标应(SHALL)根据 **identify time** 字段的值以应用特定方式(例如闪烁灯)标识自身。不应(SHALL)对 **identify request** inter-PAN 命令帧生成响应。标识操作不应(SHALL NOT)阻塞目标进一步地接收命令。目标应(SHALL)从步骤 4 继续。
931 | 7. 在接收到 **network update request** inter-PAN 命令帧之外的其他命令时,目标应(SHALL)从步骤 7 继续。如果 **network update request** inter-PAN 命令帧的 **extended PAN identifier** 和 **PAN identifier** 字段与其存储的值不同或 **network update identifier** 字段小于或等于 **nwkUpdateId**,则目标应(SHALL)丢弃该帧并从步骤 4 继续。如果 **network update request** inter-PAN 命令帧的 **extended PAN identifier** 和 **PAN identifier** 字段与其存储的值相同并且 **network update identifier** 字段高于 **nwkUpdateId**,则目标应(SHALL)使用 **network update identifier** 和 **logical channel** 的值分别更新 **nwkUpdateId** 及其当前逻辑信道。目标应(SHALL)从步骤 4 继续。
932 | 8. 在接收到 **network start request** inter-PAN 命令帧之外的其他命令时,目标应(SHALL)从步骤 15 继续。如果节点描述符的 **logical type** 字段不等于 **0b001**(ZigBee 路由器),则目标应(SHALL)丢弃该帧并从步骤 4 继续。
933 | 9. 目标应(SHALL)通过应用特定的方式决定是否允许自己启动新网络。如果目标决定不启动新网络,它应(SHALL)生成和单播 **touchlink commissioning** 簇的 **network start response** inter-PAN 命令帧(**inter-PAN transaction identifier** 字段设置为 **vIPTransID**、**Status** 为 **0x01**(失败))回发起者。目标应(SHALL)终止目标的 touchlink 过程。
934 | 10. 目标应(SHALL)执行网络发现以建立网络参数。为此,目标将 **NWME-NETWORK-DISCOVERY.request** 原语(**ScanChannels** 参数设置为与接收到的 **network start request** inter-PAN 命令帧的 **logical channel** 字段一致(如果其不等于零)或设置为 **bdbcTLPrimaryChannelSet** (如果其等于零),并且 **ScanDuration** 设置为 **bdbScanDuration**)发布到 NWK 层。在从 NWK 层接收到 **NLME-NETWORK-DISCOVERY.confirm** 原语时,将结果通知目标。基于这些结果,目标应(SHALL)为网络的逻辑信道、PAN 标识符和扩展 PAN 标识符选择合适的值。
935 | 11. 目标应(SHALL)随后生成和单播 **network start response** inter-PAN 命令帧回发起者。**inter-PAN transaction identifier** 字段应(SHALL)设置为 **vIPTransID**。**Status** 字段应(SHALL)设置为 **0x00**(成功)。所有其他字段应(SHALL)根据已验证的网络参数进行设置。
936 | 12. 如果 **bdbNodeIsOnANetwork** 等于 **TRUE**,则目标应(SHALL)在其旧网络上执行离开请求。为此,目标将 **NWME-LEAVE.request** 原语(**DeviceAddress** 参数设置为 **NULL**、**RemoveChildren** 为 **FALSE**、**Rejoin** 为 **FALSE**)发布到 NWK 层。在收到 **NLME-LEAVE.confirm** 原语后,将通知目标其请求的状态。然后,目标应(SHALL)清除所有 ZigBee 持久数据(除了传出 NWK 帧计数器)(参见子条款 6.9)。
937 | 13. 目标应(SHALL)将新网络参数复制到其网络信息库,并在新网络上开始操作。为此,目标将 **NLME-START-ROUTER.request** 原语(**BeaconOrder** 参数设置为 **0x0f**、**SuperframeOrder** 为 **0x00**、**BatteryLifeExtension** 为 **FALSE**)发布到 NWK 层。在收到 **NLME-START-ROUTER.confirm** 原语后,将通知目标其请求的状态。
938 | 14. 目标应(SHALL)代表发起者执行一个直接加入。为此,目标将 **NLME-DIRECT-JOIN.request** 原语(**DeviceAddress** 参数设置为发起者的 IEEE 地址)发布到 NWK 层。在收到 **NLME-DIRECT-JOIN.confirm** 原语后,将通知目标其请求的状态。然后目标应(SHALL)从步骤 20 继续。
939 | 15. 在接收到 **network join router request** 或 **network join end device** inter-PAN 命令帧之外的其他命令时,目标应(SHALL)从步骤 21 继续。如果接收到 **network join router request** inter-PAN 命令帧且节点描述符的 **logical type** 字段不等于 **0b001**(ZigBee 路由器)或接收到 **network join end device** inter-PAN 命令帧且节点描述符的 **logical type** 字段不等于 **0b010**(ZigBee 终端设备),则目标应(SHALL)丢弃该帧并从步骤 4 继续。
940 | 16. 目标应(SHALL)通过应用特定的方式决定是否允许自己加入到另一个网络。如果目标决定不加入另一个网络,它应(SHALL)生成和单播相应的 **touchlink commissioning** 簇的 **network join router response** 或 **network join end device response** inter-PAN 命令帧(**inter-PAN transaction identifier** 字段设置为 **vIPTransID**、**Status** 为 **0x01**(失败))回发起者,这取决于接收到的是 **network join router request** 还是 **network join end device request** inter-PAN 命令帧。目标应(SHALL)终止目标的 touchlink 过程。
941 | 17. 目标应(SHALL)生成和单播 **touchlink commissioning** 簇的 **network join router response** 或 **network join end device response** inter-PAN 命令帧(**inter-PAN transaction identifier** 字段设置为 **vIPTransID**、**Status** 为 **0x00**(成功))回发起者,这取决于接收到的是 **network join router request** 还是 **network join end device request** inter-PAN 命令帧。目标将 **bdbNodeJoinLinkKeyType** 设置为 **0x03**(touchlink 预配置链路密钥)。
942 | 18. 如果 **bdbNodeIsOnANetwork** 等于 **TRUE**,则目标应(SHALL)在其旧网络上执行离开请求。为此,目标将 **NWME-LEAVE.request** 原语(**DeviceAddress** 参数设置为 **NULL**、**RemoveChildren** 为 **FALSE**、**Rejoin** 为 **FALSE**)发布到 NWK 层。在收到 **NLME-LEAVE.confirm** 原语后,将通知目标其请求的状态。然后,目标应(SHALL)清除所有 ZigBee 持久数据(除了传出 NWK 帧计数器)(参见子条款 6.9)。
943 | 19. 目标应(SHALL)将新网络参数复制到其网络信息库。如果节点描述符的 **logical type** 字段等于 **0b010**(ZigBee 终端设备),则目标应(SHALL)从步骤 20 继续。目标将 **NLME-START-ROUTER.request** 原语(**BeaconOrder** 参数设置为 **0x0f**、**SuperframeOrder** 为 **0x00**、**BatteryLifeExtension** 为 **FALSE**)发布到 NWK 层。在收到 **NLME-START-ROUTER.confirm** 原语后,将通知目标其请求的状态。
944 | 20. 目标将 **bdbNodeIsOnANetwork** 设置为 **TRUE**、**apsTrustCenterAddress** 为 **0xffffffffffffffff**,并且它应(SHALL)确定 **apsDeviceKeyPairSet** 中是否存在一个条目(**DeviceAddress** 字段对应为 **0xffffffffffffffff**)。如果此条目不存在,则目标应(SHALL)创建一个新条目(**DeviceAddress** 字段设置为 **0xffffffffffffffff**、**apsLinkKeyType** 为 **0x01**、**LinkKey** 为分布式安全全局链路密钥、**OutgoingFrameCounter** 和 **IncomingFrameCounter** 为 **0**)。然后,目标应(SHALL)终止目标的 touchlink 过程。
945 | 21. 在接收到 **reset to factory new request** inter-PAN 命令帧之外的其他命令时,目标应(SHALL)丢弃该命令并从步骤 4 继续。目标应(SHALL)遵循 touchlink 重置过程(参见子条款 9.2),然后终止目标的 touchlink 过程。
946 |
947 | # 9. 重置
948 |
949 | 节点实现应(SHALL)提供交互机制以将其自身重置为其出厂设置。该机制应(SHALL)可供产品安装者使用。
950 |
951 | ZigBee-PRO 提供了多种用于重置(具有各种级别的影响)的机制,从重置应用簇属性到清除 ZigBee 持久数据(如网络设置,分组和绑定)以及离开网络。所有重置机制都应(SHALL)保留由所有设备维护的单个传出 NWK 帧计数器。
952 |
953 | ## 9.1 通过 basic 簇重置
954 |
955 | **basic** 簇提供 **reset to factory defaults** 命令,该命令仅将目标设备上支持的所有簇的属性重置为其默认设置,即网络设置、分组和绑定不受此命令的影响。
956 |
957 | 要使用 **basic** 簇将目标设备上的所有属性重置为其默认值,发起者设备应(SHALL)生成并向目标设备传输 **basic** 簇的 **reset to factory defaults** 命令。
958 |
959 | 在收到 **basic** 簇的 **reset to factory defaults** 命令时,目标设备应(SHALL)将目标设备上支持的所有簇的属性重置为其默认值。应(SHALL)保留所有其他值,如网络设置,帧计数器,分组和绑定。
960 |
961 | ## 9.2 通过 touchlink commissioning 簇重置
962 |
963 | **touchlink commissioning** 簇提供 **reset to factory new request** 命令,该命令清除所有 ZigBee 持久数据(除了传出 NWK 帧计数器)(参见子条款 6.9),并执行重置以使目标处于与出厂时一样的状态。该命令应(SHALL)通过 inter-PAN 通信传输。注意,由于此命令使用 inter-PAN 通信传输,因此不使用安全性。
964 |
965 | 要使用 **touchlink commissioning** 簇将目标重置为其新出厂状态,发起者应(SHALL)首先遵循发起者的 touchlink 过程(带扩展信道扫描)的前 12 个步骤(参见子条款 8.7)。然后,发起者应(SHALL)生成并向预期目标传输 **touchlink commissioning** 簇的 **reset to factory new request** inter-PAN 命令帧。
966 |
967 | 在收到 **touchlink commissioning** 簇的 **reset to factory new request** inter-PAN 命令帧时,如果目标位于集中式安全网络上(即 **apsTrustCenterAddress** 不等于 **0xffffffffffffffff**),则目标可以(MAY)在产品特定的条件下丢弃该帧并且不执行进一步的处理。
968 |
969 | 在收到 **touchlink commissioning** 簇的 **reset to factory new request** inter-PAN 命令帧(带无效事务标识符(即在当前活动事务中未接收到帧))时,目标应(SHALL)丢弃该帧并且不执行进一步的处理。
970 |
971 | 在收到 **touchlink commissioning** 簇的 **reset to factory new request** inter-PAN 命令帧(带有效事务标识符(即紧接着 touchlink 设备发现))时,目标应(SHALL)在网络上执行离开请求。为此,目标将 **NWME-LEAVE.request** 原语(**DeviceAddress** 参数设置为 **NULL**、**RemoveChildren** 为 **FALSE**、**Rejoin** 为 **FALSE**)发布到 NWK 层。在收到 **NLME-LEAVE.confirm** 原语后,将通知目标其请求的状态。
972 |
973 | 然后,目标应(SHALL)清除所有 ZigBee 持久数据(除了传出 NWK 帧计数器)(参见子条款 6.9)。
974 |
975 | Figure 10 展示了通过 **touchlink commissioning** 簇将目标重置为新出厂的事件序列。
976 |
977 | 
978 |
979 | ## 9.3 通过网络的 leave 命令重置
980 |
981 | ZigBee-PRO 提供网络的 **leave** 命令,其通过清除所有 ZigBee 持久数据(除了传出 NWK 帧计数器)(参见子条款 6.9)来请求远程节点离开网络,并执行重置以使节点处于与出厂时一样的状态。
982 |
983 | 网络的 **leave** 命令在 \[R1\] 的子条款 3.4.4 中规定,其用法在 \[R1\] 的子条款 3.6.1.10 中规定。
984 |
985 | ## 9.4 通过 Mgmt\_Leave\_req ZDO 命令重置
986 |
987 | ZigBee-PRO 提供 **Mgmt\_Leave\_req** ZDO 命令,该命令通过清除所有 ZigBee 持久数据(除了传出 NWK 帧计数器)(参见子条款 6.9)来请求远程节点离开网络,并执行重置以使节点处于与出厂时一样的状态。
988 |
989 | **Mgmt\_Leave\_req** ZDO 命令在 \[R1\] 的子条款 2.4.3.3.5 中规定。
990 |
991 | ## 9.5 通过本地动作重置
992 |
993 | 建议(RECOMMENDED)提供本地动作以允许重置节点,这将清除所有 ZigBee 持久数据(除了传出 NWK 帧计数器)(参见子条款 6.9)来请求远程节点离开网络,并执行重置以使节点处于与出厂时一样的状态。
994 |
995 | 应该(SHOULD)实现一些用户可访问的特定应用刺激以调用此本地动作,例如节点上的外部按钮或通过某些软件激活。建议(RECOMMENDED)仅在用户物理地向节点提出时才允许激活此过程。
996 |
997 | 如果节点从应用程序中接收某些刺激以重置并离开其当前网络,则它应(SHALL)在网络上执行离开请求。为此,节点将 **NWME-LEAVE.request** 原语(**DeviceAddress** 参数设置为 **NULL**、**RemoveChildren** 为 **FALSE**、**Rejoin** 为 **FALSE**)发布到 NWK 层。在收到 **NLME-LEAVE.confirm** 原语后,将通知节点其请求的状态。
998 |
999 | 然后,节点应(SHALL)清除所有 ZigBee 持久数据(除了传出 NWK 帧计数器)(参见子条款 6.9)。
1000 |
1001 | # 10. 安全
1002 |
1003 | ## 10.1 安装码
1004 |
1005 | 本节介绍了建立预配置信任中心链路密钥的带外过程、所需的安装码的格式以及用于从安装码派生预配置链路密钥的散列函数。请注意,安装码应(SHALL)是随机的,但可以不(MAY NOT)唯一。
1006 |
1007 | 如 Figure 11 所示,在制造过程期间为每个节点创建随机安装码。此安装码以制造商特定的方式(标签等)提供给节点,并在安装期间引用。安装码的空间应该(SHOULD)与密钥空间一样具有随机性。了解一组安装码不应该(SHOULD NOT)产生任何关于其他安装码的知识,而且每个安装码的可能性应该(SHOULD)相等。
1008 |
1009 | 
1010 |
1011 | 如 Figure 12 所示,在安装过程期间初始信任中心链路密钥是从安装码派生的,并通过带外通信通道发送到信任中心。信任中心使用此密钥作为信任中心链路密钥,该密钥随后用来配置关联节点的网络密钥。
1012 |
1013 | 
1014 |
1015 | ### 10.1.1 安装码格式
1016 |
1017 | 安装码由 128-bit 数字和 16-bit CRC 组成(使用 CCITT CRC 标准多项式:x\^16 + x\^12 + x\^5 + 1)。在打印或显示时,安装码表示为 4 个十六进制数字的多组。
1018 |
1019 | 示例:安装码 “83FE D340 7A93 9723 A5C6 39B2 6916 D505 C3B5”。
1020 |
1021 | 其中值 0x83、0xFE、0xD3、0x40、0x7A、0x93、0x97、0x23、0xA5、0xC6、0x39、0xB2、0x69、0x16、0xD5 和 0x05 用于计算 CRC16,结果返回 0xB5C3。(注意,CRC16 和安装码在上例中以小端字节顺序表示)
1022 |
1023 | #### 10.1.1.1 CRC 算法信息
1024 |
1025 | 如前所述,安装码 CRC 计算基于 CRC 16-CCITT 算法并使用以下参数:
1026 |
1027 | * Length: 16
1028 | * Polynomial: x\^16 + x\^12 + x\^5 + 1 (0x1021)
1029 | * Initialization method: Direct
1030 | * Initialization value: 0xFFFF
1031 | * Final XOR value: 0xFFFF
1032 | * Reflected In: True
1033 | * Reflected Out: True
1034 |
1035 | CRC 16-CCITT 算法的开源实现可以在互联网上获得,如 SourceForge 等。源代码也可在 \[R5\] 中找到。
1036 |
1037 | ### 10.1.2 散列函数
1038 |
1039 | AES-128 密钥使用 Matyas-Meyer-Oseas(MMO)散列函数从安装码中派生(参见 \[R1\] 的 Annex B.6 with a digest size (hashlen) equal to 128 bits)。
1040 |
1041 | 安装码示例:
1042 |
1043 | 应用于安装码 “83FE D340 7A93 9723 A5C6 39B2 6916 D505” 的 MMO 散列产生密钥 “66B6900981E1EE3CA4206B6B861C02BB”。
1044 |
1045 | 注意:最低有效字节为 0x83,最高有效字节为 0x05。
1046 |
1047 | #### 10.1.2.1 MMO 散列代码示例
1048 |
1049 | 基于 Rijndael 实现的 MMO 散列的开源实现可以在互联网上获得,如 SourceForge 等。源代码也可在 \[R5\] 中找到。
1050 |
1051 | ## 10.2 节点操作
1052 |
1053 | 节点加入网络也应(SHALL)具有策略,以指示他们预期来自网络的安全。以下是可以(MAY)用于调整其安全策略的设置。
1054 |
1055 | ### 10.2.1 加入节点的策略值
1056 |
1057 | 加入节点可以(MAY)具有一组策略值,例如如果要将其 commissioned 到网络中。然而,它通常根据它加入的是集中式安全网络还是分布式安全网络来设置这些策略值。除了指定为 ZigBee 协调器的节点外,所有节点都应(SHALL)支持使用任一安全模型加入网络。
1058 |
1059 | #### 10.2.1.1 acceptNewUnsolicitedTrustCenterLinkKey 策略
1060 |
1061 | 此布尔值指示节点是否接受新的未经请求的 APS 传输密钥消息(包含信任中心链路密钥)。
1062 |
1063 | 请注意,在分布式安全网络中忽略此值。
1064 |
1065 | #### 10.2.1.2 acceptNewUnsolicitedApplicationLinkKey 策略
1066 |
1067 | 此布尔值指示节点是否接受信任中心或其他设备发送未经请求的新应用程序链路密钥给它。
1068 |
1069 | 如果设备需要对伙伴节点使用 APS 加密,则可以(MAY)在分布式安全网络中使用此值。
1070 |
1071 | ### 10.2.2 信任中心地址
1072 |
1073 | 节点可以(MAY)在加入前知道信任中心的地址,这取决于节点的 commissioning 过程。如果节点在加入网络前已知信任中心地址,则 commissioning 过程应(SHALL)将 **apsTrustCenterAddress** 设置为它将加入的网络中的信任中心的 IEEE 地址的值。
1074 |
1075 | 在大多数情况下,节点将加入的网络并非提前知道的。因此,建议(RECOMMENDED)节点的 commissioning 过程不要预编程信任中心地址。在这种情况下,**apsTrustCenterAddress** 最初应(SHALL)设置为 **0xffffffffffffffff**。一旦节点加入网络并接收和解密包含网络密钥的 APS 命令传输密钥命令,它应(SHALL)将 **apsTrustCenterAddress** 设置为命令中源地址的值。
1076 |
1077 | 如果 **bdbNodeIsOnANetwork** 等于 **TRUE** 且 **apsTrustCenterAddress** 等于 **0xffffffffffffffff**,则设备已加入到分布式安全网络,并且应该(SHOULD)相应地调整节点的设置。相反,如果 **apsTrustCenterAddress** 不等于 **0xffffffffffffffff**,则该节点已加入到集中式安全网络。
1078 |
1079 | 对于所有随后收到的信任中心或安全相关的 APS 命令帧(存在源地址字段),如果 **apsTrustCenterAddress** 不等于 **0xffffffffffffffff**,则节点应(SHALL)将 **apsTrustCenterAddress** 的值与 APS 命令的源地址值进行比较。如果值不匹配,则应(SHALL)丢弃该帧并且不再进行进一步处理。
1080 |
1081 | ### 10.2.3 信任中心链路密钥
1082 |
1083 | 所有节点在加入集中式安全网络后都应(SHALL)具有更新的信任中心链路密钥。这允许使用安全通信来通知加入事件以及将网络密钥分发给错过密钥更新的设备。节点应(SHALL)使用预配置密钥加入网络,然后在加入完成后请求更新链路密钥。一旦节点获得了更新的信任中心链路密钥,它就应(SHALL)忽略来自信任中心的任何未使用该密钥加密的 APS 命令。
1084 |
1085 | ### 10.2.4 请求链路密钥
1086 |
1087 | 如果 **bdbTCLinkKeyExchangeMethod** 等于 **0x00**,则节点应(SHALL)将其初始链路密钥与信任中心生成的密钥进行交换,以作为其在集中式安全网络中的初始加入操作的一部分。
1088 |
1089 | 如果 **bdbTCLinkKeyExchangeMethod** 不等于 **0x00**,则节点应(SHALL)遵循此属性指定的相应过程。然而,如果该过程失败,则节点将退回到上述链路密钥交换方法(0x00)。如果此方法成功,则节点可以(MAY)将密钥视为未授权的,以允许访问受限的簇。
1090 |
1091 | ### 10.2.5 信任中心链路密钥交换过程
1092 |
1093 | 本节定义了检索节点的新信任中心链路密钥的过程。该过程的序列图展示了消息的交换和用于加密消息的相应密钥,如 Figure 13 所示。
1094 |
1095 | 
1096 |
1097 | Figure 14 展示了此过程的简化版本,以供快速参考。
1098 |
1099 | 
1100 |
1101 | 1. 加入节点应(SHALL)检查其 **bdbTCLinkKeyExchangeMethod**。如果 **bdbTCLinkKeyExchangeMethod** 设置为 **0**,则它应(SHALL)从步骤 2 继续。如果 **bdbTCLinkKeyExchangeMethod** 设置为另一个值,则它应(SHALL)执行该机制定义的适当步骤。如果机制成功,则节点应(SHALL)以成功状态终止信任中心链路密钥交换过程。
1102 | 2. 加入节点将 **bdbTCLinkKeyExchangeAttempts** 设置为 **0**。
1103 | 3. 加入节点应(SHALL)向信任中心发送 **Node\_Desc\_req** ZDO 命令。然后它启动 **bdbcTCLinkKeyExchangeTimeout** 秒的定时器,并将 **bdbTCLinkKeyExchangeAttempts** 递增 **1**。
1104 | 4. 如果在定时器到期之前未收到 **Node\_Desc\_rsp** ZDO 命令,则加入节点应(SHALL)确定是否重试该尝试,如下所示:
1105 | 1. 如果 **bdbTCLinkKeyExchangeAttempts** 小于 **bdbTCLinkKeyExchangeAttemptsMax**,则加入节点应(SHALL)从步骤 3 继续。
1106 | 2. 如果 **bdbTCLinkKeyExchangeAttempts** 等于 **bdbTCLinkKeyExchangeAttemptsMax**,则加入节点应(SHALL)以失败状态终止信任中心链路密钥交换过程。
1107 | 5. 如果接收方的节点描述符的 **server mask** 字段指示 r20 或更早的协议栈修订,则加入节点应(SHALL)以成功状态终止信任中心链路密钥交换过程。
1108 | 6. 加入节点将 **bdbTCLinkKeyExchangeAttempts** 设置为 **0**。
1109 | 7. 加入节点应(SHALL)从信任中心中请求新的链路密钥。为此,加入节点发布 **APSME-REQUEST-KEY.request** 原语(使用其初始信任中心链路密钥(key A)加密)。然后它启动 **bdbcTCLinkKeyExchangeTimeout** 秒的定时器并将 **bdbTCLinkKeyExchangeAttempts** 递增 **1**。
1110 | 8. 如果加入节点在定时器到期之前没有收到 **APSME-TRANSPORT-KEY.indication** 原语,则加入节点应(SHALL)确定是否重试该尝试,如下所示:
1111 | 1. 如果 **bdbTCLinkKeyExchangeAttempts** 小于 **bdbTCLinkKeyExchangeAttemptsMax**,则加入节点应(SHALL)从步骤 7 继续。
1112 | 2. 如果 **bdbTCLinkKeyExchangeAttempts** 等于 **bdbTCLinkKeyExchangeAttemptsMax**,则加入节点应(SHALL)以失败状态终止信任中心链路密钥交换过程。
1113 | 9. 加入节点应(SHALL)在 **apsDeviceKeyPairSet** 中找到与 **apsTrustCenterAddress** 相对应的 **DeviceAddress** 的条目。如果接收到的 **APSME-TRANSPORT-KEY.indication** 原语的 **KeyType** 参数不等于 **0x04**(唯一信任中心链路密钥)或原语中包含的链路密钥与 **apsDeviceKeyPairSet** 条目的 **LinkKey** 值相同,则加入节点应(SHALL)以失败状态终止信任中心链路密钥交换过程。否则,加入节点应(SHALL)用原语中包含的密钥(link key B)替换 **LinkKey** 的值,然后可以(MAY)将 **OutgoingFrameCounter** 设置为 **0**,并且它应(SHALL)为 **apsDeviceKeyPairSet** 条目将 **IncomingFrameCounter** 设置为 **0**。
1114 | 10. 加入节点将 **bdbTCLinkKeyExchangeAttempts** 设置为 **0**。
1115 | 11. 加入节点应(SHALL)与信任中心验证新链路密钥。为此,加入节点发出 **APSME-VERIFY-KEY.request** 原语以验证新密钥(link key B)。然后它启动 **bdbcTCLinkKeyExchangeTimeout** 秒的定时器并将 **bdbTCLinkKeyExchangeAttempts** 增加 **1**。
1116 | 12. 如果加入节点在定时器到期之前没有收到 **APSME-CONFIRM-KEY.indication** 原语,则加入节点应(SHALL)确定是否重试该尝试,如下所示:
1117 | 1. 如果 **bdbTCLinkKeyExchangeAttempts** 小于 **bdbTCLinkKeyExchangeAttemptsMax**,则加入节点应(SHALL)从步骤 11 继续。
1118 | 2. 如果 **bdbTCLinkKeyExchangeAttempts** 等于 **bdbTCLinkKeyExchangeAttemptsMax**,则加入节点应(SHALL)以失败状态终止信任中心链路密钥交换过程。
1119 | 13. 加入节点应(SHALL)以成功状态终止信任中心链路密钥交换过程。
1120 |
1121 | 注意,加入节点应(SHALL)认为 link key A 有效,直到 link key B 成功地被信任中心验证(成功地解密响应)。
1122 |
1123 | ### 10.2.6 接收新链路密钥
1124 |
1125 | 节点的安全策略可以(MAY)限制信任中心发送应用程序链路密钥给它。这可能是因为节点希望控制与其共享链路密钥的其他节点,或者因为它使用某种其他机制来建立应用程序链路密钥。
1126 |
1127 | 在某些情况下,更高级别的应用程序策略确定与应用程序链路密钥共享哪些数据,例如,通过基于证书的密钥交换协议建立更新的信任中心链路密钥的网络。
1128 |
1129 | 如果节点收到包含信任中心链路密钥的传输密钥命令,但它未曾发送请求并且 **acceptNewUnsolicitedTrustCenterLinkKey** 设置为 **FALSE**,则它应(SHALL)忽略该消息。如果节点收到包含应用程序链路密钥的传输密钥命令,但它未层发送请求并且 **acceptNewUnsolicitedApplicationLinkKey** 设置为 **FALSE**,则它应(SHALL)忽略该消息。
1130 |
1131 | ## 10.3 信任中心行为
1132 |
1133 | ### 10.3.1 添加安装码
1134 |
1135 | 1. 通过一些制造商特定的方式,信任中心应(SHALL)决定是否允许节点加入(参见 \[R1\] 的子条款 4.7.3)。
1136 | 1. 如果不允许节点加入,则不执行进一步的动作。
1137 | 2. 信任中心应(SHALL)决定该加入节点是否应使用默认链路密钥或安装码链路密钥,如 **bdbJoinUsesInstallCodeKey** 所指定。
1138 | 1. 如果信任中心需要使用安装码链路密钥,则它应(SHALL)在其 AIB **apsDeviceKeyPairSet** 中添加条目(**DeviceAddress** 设置为加入节点的 EUI64、**LinkKey** 的值等于安装码链路密钥)。
1139 | 1. 条目的 **apsLinkKeyType** 应(SHALL)设置为 **0x00**(Unique)。参见 \[R1\] 中的 Table 4.39。
1140 | 2. 如果信任中心不需要使用安装码链路密钥,则当节点加入网络时,它应在其 AIB **apsDeviceKeyPairSet** 中创建相应的条目。
1141 |
1142 | ### 10.3.2 往网络中添加新节点
1143 |
1144 | 当信任中心接受新节点加入时,可以(MAY)选择该节点是否应使用默认信任中心链路密钥或安装码密钥来加密网络密钥。它还可以(MAY)选择允许网络中设备的混合使用。这是信任中心的策略。此过程描述了信任中心如何处理节点加入(**bdbTCLinkKeyExchangeMethod** 的值等于 **0x00**(APS 请求密钥建立方法))。**bdbTCLinkKeyExchangeMethod** 的其他值尚未支持。
1145 |
1146 | Figure 15 展示了此过程的简化版本,以供快速参考。
1147 |
1148 | 
1149 |
1150 | 1. 从 APSME 中收到 **APSME-UPDATE-DEVICE.indication** 原语后,信任中心应(SHALL)启动 **bdbTrustCenterNodeJoinTimeout** 秒的定时器。
1151 | 2. 信任中心应(SHALL)确定 **Status** 参数是否等于 **0x01**(不安全连接)。
1152 | 1. 如果不是,信任中心应(SHALL)从步骤 12 继续。
1153 | 3. 信任中心应(SHALL)将 **bdbJoiningNodeEui64** 设置为 **APSME-UPDATE-DEVICE.indication** 原语中的 **DeviceAddress** 参数。
1154 | 4. 如果 **bdbJoinUsesInstallCodeKey** 等于 **TRUE** 且 **bdbJoiningNodeEui64** 与 **apsDeviceKeyPairSet** 中的条目不对应,则信任中心应(SHALL)从步骤 12 继续。
1155 | 5. 如果 **bdbJoinUsesInstallCodeKey** 等于 **FALSE** 且 **bdbJoiningNodeEui64** 与 **apsDeviceKeyPairSet** 中的条目不对应,则信任中心应(SHALL)在其 AIB **apsDeviceKeyPairSet** 中添加条目,**DeviceAddress** 参数设置为 **bdbJoiningNodeEui64**,并将 **LinkKey** 值设置为默认全局信任中心链路密钥(“ZigBeeAlliance09”)。
1156 | 1. 该条目的 **apsLinkKeyType** 应(SHALL)设置为 **0x01**(Global)。参见 \[R1\] 中的 Table 4.39。
1157 | 6. 信任中心通过应(SHALL)向 APSME 发布 **APSME-TRANSPORT-KEY.request** 原语(使用与加入节点对应的 **apsDeviceKeyPairSet** 条目的 **LinkKey** 值加密),以传输网络密钥到加入节点。
1158 | 7. 如果在步骤 1 中的超时内,未从 APSME 接收到 **APSME-REQUEST-KEY.indication** 原语(具有等于 **bdbJoiningNodeEui64** 的 IEEE 地址),则信任中心应(SHALL)从步骤 10 继续。
1159 | 8. 信任中心应(SHALL)为节点生成链路密钥。此链路密钥应(SHALL)随机生成或通过制造商特定算法派生,但它不应(SHALL NOT)全部为零,并且它不应(SHALL NOT)与加入节点对应的 **apsDeviceKeyPairSet** 条目的 **LinkKey** 值相同。
1160 | 1. 链路密钥的值应(SHALL)存储在 **bdbJoiningNodeNewTCLinkKey** 中。
1161 | 2. 信任中心应(SHALL)向 APSME 发布 **APSME-TRANSPORT-KEY.request** 原语(使用与加入节点对应的 **apsDeviceKeyPairSet** 条目的 **LinkKey** 值加密)。
1162 | 9. 如果在步骤 1 中的超时内,信任中心收到 **APcME-VERIFY-KEY.indication**(**SrcAddress** 字段等于 **bdbJoiningNodeEui64**),则它应(SHALL)执行以下操作。
1163 | 1. 它应(SHALL)在 **apsDeviceKeyPairSet** 中找到该条目(**DeviceAddress** 对应于 **bdbJoiningNodeEui64**)。
1164 | 2. 如果 **bdbJoiningNodeNewTCLinkKey** 的值与 **apsDeviceKeyPairSet** 条目的 **LinkKey** 的值不同,则信任中心:
1165 | 1. 可以(MAY)将 **OutgoingFrameCounter** 设置为 **0**,并且应(SHALL)在 **ApsDeviceKeyPairSet** 条目中将 **IncomingFrameCounter** 设置为 **0**。
1166 | 2. 应(SHALL)将 **bdbJoiningNodeNewTCLinkKey** 的值复制到 **apsDeviceKeyPairSet的LinkKey**。
1167 | 3. 它应(SHALL)发布 **APSME-CONFIRM-KEY.request** 原语(**DestAddress** 字段设置为 **bdbJoiningNodeEui64**)。
1168 | 4. 它应(SHALL)从步骤 12 继续。
1169 | 10. 如果 **bdbTrustCenterRequireKeyExchange** 等于 **FALSE**(不必交换链路密钥),则信任中心应(SHALL)从步骤 12 继续。
1170 | 11. 信任中心应(SHALL)请求加入节点离开网络。为此,信任中心发布 **APSME-REMOVE-DEVICE.request** 原语(**ParentAddress** 参数设置为步骤 1 中接收到的 **APSME-UPDATE-DEVICE.indication** 原语中的 **SrcAddress** 参数、**ChildAddress** 为 **bdbJoiningNodeEui64**)。
1171 | 12. 在终止往网络中添加新节点的过程之前,信任中心应(SHALL)执行以下操作:
1172 | 1. 使 **bdbTrustCenterNodeJoinTimeout** 定时器到期。
1173 | 2. 将 **bdbJoiningNodeNewTCLinkKey** 的值设置为零。
1174 | 3. 将 **bdbJoiningNodeEui64** 的值设置为零。
1175 |
1176 | ### 10.3.3 已知节点加入时的行为
1177 |
1178 | 如果已交换其信任中心链路密钥的节点尝试再次加入开放的信任中心,即 **APSME-UPDATE-DEVICE.indication** 原语的 **DeviceAddress** 参数对应 **apsDeviceKeyPairSet** 中的一个条目(**KeyAttributes** 字段等于 **VERIFIED\_KEY**),信任中心应(SHALL)允许节点加入但处于新状态,并在传输网络密钥时使用适合该节点的初始链路密钥。在这种情况下,信任中心应(SHALL)使用以下步骤代替 10.3.2 中给出过程的步骤 4 和 5:
1179 |
1180 | 4. 如果 **bdbJoinUsesInstallCodeKey** 等于 **TRUE** 且未存储安装码派生的链路密钥,则信任中心应(SHALL)终止往网络中添加新节点的过程。如果 **bdbJoinUsesInstallCodeKey** 等于 **TRUE** 并且存储了安装码派生的链路密钥,则信任中心应(SHALL)首先在 **apsDeviceKeyPairSet** 中找到与加入节点对应的条目,然后使用安装码派生的链路密钥覆盖 **LinkKey** 条目,并将 **KeyAttributes** 字段设置为 **PROVISIONAL\_KEY**。然后,信任中心可以(MAY)将 **OutgoingFrameCounter** 设置为 **0**,并应(SHALL)将 **IncomingFrameCounter** 设置为 **0**。
1181 | 5. 如果 **bdbJoinUsesInstallCodeKey** 等于 **FALSE**,则信任中心应(SHALL)首先在 **apsDeviceKeyPairSet** 中找到与加入节点对应的条目,然后使用默认全局信任中心链路密钥覆盖 **LinkKey** 条目,并将 **KeyAttributes** 字段设置为 **PROVISIONAL\_KEY**。然后,信任中心可以(MAY)将 **OutgoingFrameCounter** 设置为 **0**,并应(SHALL)将 **IncomingFrameCounter** 设置为 **0**。
1182 |
1183 | ## 10.4 分布式安全网络行为
1184 |
1185 | ### 10.4.1 往网络中添加新节点
1186 |
1187 | 当在分布式安全网络上运行的节点接受新节点加入时,应使用分布式安全全局链路密钥(参见 6.3.2)来加密网络密钥。
1188 |
1189 | # 11. 附录 A:建议措施
1190 |
1191 | ## 11.1 集中式 commissioning 的建议
1192 |
1193 | ### 11.1.1 集中式 commissioning 概述
1194 |
1195 | 集中式 commissioning 是一种允许固定或移动节点 commissioning(确定应用联系并创建绑定)其他节点(在同一网络上)的方法。这也可以称为 Gateway、Tool 或 S-Mode commissioning。
1196 |
1197 | 这可以是一个节点(如网关、中央控制器或通常连接到图形用户界面的 commissioning 工具)。此节点能够配置网络中其他节点上的绑定和报告。它也可以是从一个固定的预加载配置中自动 commissions 网络上其他节点的节点。
1198 |
1199 | 网络中任何具有此功能的节点都被定义为 Commissioning 主管(CD)。
1200 |
1201 | 
1202 |
1203 | ### 11.1.2 设备发现的建议
1204 |
1205 | 为了 commission 节点,CD 需要发现网络中的设备。下面列出了发现网络中所有节点的推荐方法。
1206 |
1207 | #### 11.1.2.1 新节点加入
1208 |
1209 | 新节点通过广播 **Device\_annce** ZDO 命令宣布加入网络。然后,CD 可以使用 ZDO 发现服务来知道网络中的节点、绑定表服务以管理绑定表,并且如果需要,还可以使用 **groups** 簇的命令来管理分组表。
1210 |
1211 | #### 11.1.2.2 现有网络中的节点
1212 |
1213 | 当 CD 加入现有网络时,它需要发现网络中已有的节点。CD 可以(MAY)在成功加入网络或某些用户刺激时立即启动此过程。此外,CD 可以(MAY)定期发现网络上的节点,以便及时了解任何变化。
1214 |
1215 | CD 有多种方法可以发现网络中的节点,但建议(RECOMMENDED)CD 使用 **Mgmt\_Lqi\_req** ZDO 命令。下面列出了使用 **Mgmt\_Lqi\_req**(而不是 **IEEE\_addr\_req** 或 **NWK\_addr\_req**)的好处:
1216 |
1217 | * ZigBee 协调器、ZigBee 路由器、ZigBee终端设备的 ZigBee 逻辑设备类型信息
1218 | * Rx_On_when_Idle 信息
1219 | * 有关父子关系的信息
1220 |
1221 | CD 执行设备发现后,可以(MAY)执行进一步的 commission 动作,例如设置绑定或配置报告。
1222 |
1223 | #### 11.1.2.3 与终端设备建立通信
1224 |
1225 | 本节是建议 CD 与终端设备通信的占位符,在有更好的理解用例时将会添加。
1226 |
1227 |
--------------------------------------------------------------------------------