Está en la página 1de 5

An Introduction

®
to ZigBee 019-0162 • 080924-C
The latest revision of this manual is available on the Rabbit Web site,
www.rabbit.com, for free, unregistered download.
An Introduction to ZigBee®
Part Number 019-0162–C • 080924 • Printed in U.S.A.
Digi International Inc. © 2008 • All rights reserved.
No part of the contents of this manual may be reproduced or transmitted in any form or by any means
without the express written permission of Digi International Inc.
Permission is granted to make one or more copies as long as the copyright page contained therein is
included. These copies of the manuals may not be let or sold for any reason without the express written
permission of Digi International Inc.
Digi International Inc. reserves the right to make changes and
improvements to its products without providing notice.
Trademarks
Rabbit and Dynamic C® are registered trademarks of Digi International Inc.
Windows® is a registered trademark of Microsoft Corporation
ZigBee® is a registered trademark of the ZigBee Alliance
ii
Table of Contents
Chapter 1. Introduction
Chapter 2. Wireless Communication
1
3
2.1 Communication Systems .................................................................................................................................... 3
2.2 Wireless Network Types..................................................................................................................................... 3
2.2.1 WPAN ......................................................................................................................................................... 3
2.2.2 WLAN ......................................................................................................................................................... 4
2.2.3 WWAN ....................................................................................................................................................... 4
2.3 Wireless Network Topologies ............................................................................................................................ 4
2.4 Wireless Standards.............................................................................................................................................. 5
2.5 Security in a Wireless Network .......................................................................................................................... 6
2.5.1 Security Risks ............................................................................................................................................. 6
Chapter 3. IEEE 802.15.4 Specification
7
3.1 Scope of 802.15.4 ............................................................................................................................................... 7
3.1.1 PHY Layers ................................................................................................................................................. 7
3.1.2 MAC Layer ................................................................................................................................................. 7
3.2 Properties of 802.15.4 ......................................................................................................................................... 8
3.2.1 Transmitter and Receiver ............................................................................................................................ 8
3.2.2 Channels ...................................................................................................................................................... 8
3.3 Network Topologies ........................................................................................................................................... 9
3.4 Network Devices and their Operating Modes..................................................................................................... 9
3.5 Addressing Modes Supported by 802.15.4 ....................................................................................................... 10
3.5.1 PAN ID ..................................................................................................................................................... 10
Chapter 4. ZigBee Specification
11
4.1 Logical Device Types ....................................................................................................................................... 11
4.2 ZigBee Stack Layers ......................................................................................................................................... 12
4.2.1 Network (NWK) Layer ............................................................................................................................. 12
4.2.2 Application (APL) Layer .......................................................................................................................... 13
4.2.2.1 Application Support Sublayer (APS) ................................................................................................ 13
4.2.2.2 Application Framework ..................................................................................................................... 14
4.2.2.3 ZigBee Device Object (ZDO) ........................................................................................................... 14
4.3 ZigBee Addressing ........................................................................................................................................... 15
4.3.1 ZigBee Messaging ..................................................................................................................................... 15
4.3.2 Broadcast Addressing ............................................................................................................................... 15
4.3.3 Group Addressing ..................................................................................................................................... 15
4.4 ZigBee Application Profiles ............................................................................................................................. 16
4.4.1 ZigBee Device Profile ............................................................................................................................... 17
Chapter 5. Rabbit and ZigBee
19
5.1 Implementation Overview ................................................................................................................................ 19
5.1.1 Initialization State ..................................................................................................................................... 19
5.1.2 Discovery State ......................................................................................................................................... 20
5.1.3 Ready State ............................................................................................................................................... 21
5.1.4 End Device Sleep Mode ............................................................................................................................ 21
5.2 Sample Programs .............................................................................................................................................. 22
5.2.1 Sample Program Initialization Requirements ........................................................................................... 23
5.2.2 Summary of ZigBee Sample Programs ..................................................................................................... 24
An Introduction to ZigBee
rabbit.com
iii
5.2.2.1 Sample Programs for One Rabbit-Based Board ................................................................................24
5.2.2.2 Sample Programs for Two Rabbit-Based Boards ..............................................................................25
5.2.3 GPIO Server/Client Sample Programs ......................................................................................................25
5.2.3.1 Running the GPIO Applications ........................................................................................................26
5.2.3.2 Studying the Code .............................................................................................................................30
5.3 Dynamic C Library for ZigBee Applications.................................................................................................... 31
5.3.1 Communication with an RF Module .........................................................................................................31
5.3.1.1 Sending Data to a Remote Device .....................................................................................................31
5.3.1.2 Radio Commands ..............................................................................................................................32
5.3.2 Configuration Macros and Constants ........................................................................................................32
5.3.2.1 Compile-Time Macros .......................................................................................................................32
DEFAULT_CHANNELS ......................................................................................................................... 32
DEFAULT_EXTPANID .......................................................................................................................... 32
DEFAULT_PANID .................................................................................................................................. 32
ENDPOINT_TABLE_*............................................................................................................................ 33
NODEID_STR.......................................................................................................................................... 34
XBEE_DEBUG ........................................................................................................................................ 34
XBEE_IN_BUF / XBEE_OUT_BUF ...................................................................................................... 34
XBEE_ROLE............................................................................................................................................ 34
XBEE_VERBOSE.................................................................................................................................... 34
ZB_CONSTRUCT_NODE_ID ................................................................................................................ 34
ZB_FATAL_ERROR ............................................................................................................................... 35
ZB_MULTI_PROFILE ............................................................................................................................ 35
5.3.2.2 Information Macros ...........................................................................................................................35
XBEE_IS_COORD .................................................................................................................................. 35
XBEE_IS_ENDDEV ................................................................................................................................ 35
XBEE_IS_ROUTER ................................................................................................................................ 35
5.3.2.3 Deprecated Device Type Macros .......................................................................................................35
ZIGBEE_COORDINATOR ..................................................................................................................... 35
ZIGBEE_ENDDEV.................................................................................................................................. 35
ZIGBEE_ROUTER .................................................................................................................................. 35
5.3.3 Error Codes ................................................................................................................................................35
5.3.4 Data Structures ..........................................................................................................................................36
api_frame_t ............................................................................................................................................... 36
xb_io_sample_t ......................................................................................................................................... 36
_zb_NodeData_t ....................................................................................................................................... 36
zb_sendAddress_t .................................................................................................................................... 36
5.3.5 API Functions and Macros ........................................................................................................................37
GET_NODE_DATA................................................................................................................................. 37
resetRadio ................................................................................................................................................. 37
xbee_awake............................................................................................................................................... 38
xbee_init.................................................................................................................................................... 38
xbee_protocol............................................................................................................................................ 39
xbee_tick ................................................................................................................................................... 40
xbee_wait_for_wake................................................................................................................................. 41
xb_get_register.......................................................................................................................................... 42
xb_hexdump.............................................................................................................................................. 43
xb_io_conf_desc ....................................................................................................................................... 43
xb_io_sample_clear .................................................................................................................................. 44
xb_IS_parse .............................................................................................................................................. 44
xb_listNodes ............................................................................................................................................. 45
xb_nd_nodetype_str.................................................................................................................................. 46
xb_sendAPIremoteATcmd ....................................................................................................................... 47
xb_send_command ................................................................................................................................... 55
xb_set_register .......................................................................................................................................... 56
iv
rabbit.com
xb_sleep.................................................................................................................................................... 57
xb_stayawake ........................................................................................................................................... 59
zb_adc_in.................................................................................................................................................. 60
zb_API_ATCmdResponse ....................................................................................................................... 61
zb_check_sleep_params ........................................................................................................................... 62
zb_dio_in .................................................................................................................................................. 63
zb_dio_out ................................................................................................................................................ 63
ZB_ERROR.............................................................................................................................................. 64
ZB_GENERAL_MESSAGE_HANDLER............................................................................................... 64
zb_getATCmdResponse ........................................................................................................................... 65
zb_io_init.................................................................................................................................................. 66
ZB_LATEST_MESSAGE ....................................................................................................................... 67
ZB_LAST_MSG_DATA ......................................................................................................................... 68
ZB_LAST_MSG_DATALEN ................................................................................................................. 68
ZB_LAST_STATUS................................................................................................................................ 69
zb_MakeEndpointClusterAddr................................................................................................................. 70
zb_MakeIEEENetworkAddr .................................................................................................................... 71
zb_missed_messages ................................................................................................................................ 72
ZB_ND_RUNNING................................................................................................................................. 72
zb_Rabbit_poweroff ................................................................................................................................. 73
zb_Rabbit_Sleep....................................................................................................................................... 74
zb_receive................................................................................................................................................. 75
zb_reply .................................................................................................................................................... 76
zb_send ..................................................................................................................................................... 77
zb_sendAPICmd....................................................................................................................................... 78
zb_sendATCmd........................................................................................................................................ 79
zb_swapBytes ........................................................................................................................................... 80
zb_tick ...................................................................................................................................................... 80
ZB_XMIT_OVERHEAD......................................................................................................................... 81
ZB_XMIT_STATUS................................................................................................................................ 81
zigbee_init (deprecated) ........................................................................................................................... 82
5.4 Protocol Firmware ............................................................................................................................................ 83
5.4.1 Updating RF Module FW on a Rabbit-Based Target ............................................................................... 83
5.4.2 X-CTU: Updating RF Module FW on a DIGI XBee USB Device ........................................................... 83
5.4.2.1 X-CTU Installation ............................................................................................................................ 83
5.4.2.2 PC Settings Tab ................................................................................................................................. 84
5.4.2.3 Modem Configuration Tab ................................................................................................................ 85
5.5 Summary ........................................................................................................................................................... 92
Appendix A. Glossary of Terms
ad-hoc network .........................................................................................................................................
application object......................................................................................................................................
attribute.....................................................................................................................................................
Bluetooth ..................................................................................................................................................
BPSK ........................................................................................................................................................
cluster .......................................................................................................................................................
cluster ID ..................................................................................................................................................
cluster tree ................................................................................................................................................
coordinator................................................................................................................................................
CSMA-CA................................................................................................................................................
device description.....................................................................................................................................
end device.................................................................................................................................................
endpoint ....................................................................................................................................................
FFD...........................................................................................................................................................
95
95
95
95
95
95
95
95
95
95
96
96
96
96
96
An Introduction to ZigBee
rabbit.com
v

También podría gustarte