introduction to the zigbee application...

33
Copyright © 2005-2006 ZigBee TM Alliance. All Rights Reserved. Wireless Control That Simply Works Introduction to the ZigBee Application Framework Phil Jamieson, ZigBee AFG Chair ZigBee Open House, Seoul, South Korea, September 28 th , 2006

Upload: others

Post on 23-Mar-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Copyright © 2005-2006 ZigBeeTM Alliance. All Rights Reserved.

Wireless Control That Simply Works

Introduction to the ZigBee Application Framework

Phil Jamieson, ZigBee AFG ChairZigBee Open House, Seoul, South Korea, September 28th, 2006

Page 2: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

2

The ZigBee Stack

Physical (PHY) Layer

Security Service Provider

PD-SAP

APSSE-SA

PN

LSE-SAP

PLME-SAP

Medium Access Layer (MAC) Layer

MLME-SAPMCPS-SAP

Network (NWK) Layer

NLM

E-SAP

NLDE-SAP

Application Support (APS) Sub-Layer

APSDE-SAP APSDE-SAP APSDE-SAP

APSM

E-SAP

Application Framework

Application Object 240

[On Endpoint 240]

Application Object 1

[On Endpoint 1]

ZPUI ZigBee Device

Object (ZDO)[On Endpoint 0]

Page 3: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

3

Application Overview:Addressing & Binding

Switch 1

Switch 2

Radio Z1

Lamp 1

Lamp 2

Lamp 3

Lamp 4

Can create relationships betweenapplications by adding bindings

Lamp application objectadds functionality to lamp unit

EP 5 EP 7 EP 8 EP 17

Switch unit

Lampunit

Switch application objectadds functionality to switch unit

EP 21

EP 3

EP = EndpointRadio

Z2

Page 4: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

4

Application Overview:Transporting Clusters

Switch 1EP 3

Switch 2EP 21

Radio Z1

Radio Z2

Lamp 1

EP 5

Lamp 2

EP 7

Lamp 3

EP 8

Lamp 4

EP 17

Clusters (commands)transported via bindings

Switch unit

LampunitEP = Endpoint

Page 5: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

5

Application Overview:Indirect Transmission

Switch 1EP 3

Switch 2EP 21

Radio Z1 Radio

Z0ZigBee

coordinator

Radio Z2

Lamp 1

EP 5

Lamp 2

EP 7

Lamp 3

EP 8

Lamp 4

EP 17

Switch unit

LampunitEP = Endpoint

Page 6: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

6

The Application Support Sub-Layer

Physical (PHY) Layer

Security Service Provider

PD-SAP

APSSE-SA

PN

LSE-SAP

PLME-SAP

Medium Access Layer (MAC) Layer

MLME-SAPMCPS-SAP

Network (NWK) Layer

NLM

E-SAP

NLDE-SAP

Application Support (APS) Sub-Layer

APSDE-SAP APSDE-SAP APSDE-SAP

APSM

E-SAP

Application Framework

Application Object 240

[On Endpoint 240]

Application Object 1

[On Endpoint 1]

ZPUI ZigBee Device

Object (ZDO)[On Endpoint 0]

Page 7: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

7

APS Service Primitives

■Data service►APSDE-DATA.request

►APSDE-DATA.confirm

►APSDE-DATA.indication

■Management service►APSME-BIND.request

►APSME-BIND.confirm

►APSME-UNBIND.request

►APSME-UNBIND.confirm

Page 8: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

8

Request to Transmit Data

APSDE-DATA.request (DstAddrMode, Not present, 16-bit or 64-bit

DstAddress, According to DstAddrMode

DstEndpoint, Target endpoint: 0x00-0xff

ProfileId, Profile to which this command belongs

ClusterId, Cluster being transported

SrcEndpoint, Source endpoint: 0x00-0xfe

asduLength, The length of asdu

asdu, The application data

TxOptions, Security, NWK key, acknowledgement select

DiscoverRoute, Route discovery override

RadiusCounter Broadcast radius (broadcast transmissions only)

)

Page 9: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

9

Notification of the Arrival of Data

APSDE-DATA.indication (

DstEndpoint, Target endpoint on this device: 0x00-0xfe

ClusterId, Cluster being received

SrcAddrMode, Not present, 16-bit or 64-bit

SrcAddress, According to SrcAddrMode

SrcEndpoint, Originator endpoint: 0x00-0xff

ProfileId, Identifier of the profile from which the frame originated

asduLength, The length of asdu

asdu, The application data

WasBroadcast, Whether the transmission was broadcast

SecurityStatus Unsecured, NWK key or link key

)

Page 10: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

10

General APDU Frame Format

Octets:1 0/1 0/1 0/2 0/1 Variable

Destination endpoint

Cluster identifier

Profile identifier

Source endpoint

Addressing fields

Frame payload

APS header APS payload

Frame Control

Depending on indirect

addressing mode

Not included with command

frames

Not included with command

frames

Depending on indirect

addressing mode

Page 11: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

11

Frame Control Field

Bits:0-1 2-3 4 5 6 7

Frame type Delivery mode

Indirect address mode

Security Ack. request Reserved

Data, command or acknowledgement

frame

Source/destination endpoint inclusion

control

Acknowledgement request control

Normal unicast, indirect addressing or broadcast transmission

Frame security control

Page 12: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

12

Binding Link Creation/Removal

APSME-(UN)BIND.request

(

SrcAddr, 64-bit IEEE address

SrcEndpoint, Source endpoint: 0x01-0xff

ClusterId, Source cluster to (un)bind with destination

DstAddr, 64-bit IEEE address

DstEndpoint Destination endpoint: 0x01-0xff

)

Page 13: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

13

The Binding Table

The binding table forms the mapping:

(as, es, cs) = { (ad1, ed1), (ad2, ed2), …, (adn, edn) }

Where

as = the address of the device as the source of the binding link

es = the endpoint identifier of the device as the source of the binding link

cs = the cluster identifier used in the binding link

adi = the ith address of the device as the destination of the binding link

edi = the ith endpoint identifier of the device as the destination of the binding link

Page 14: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

14

The Application Framework

Physical (PHY) Layer

Security Service Provider

PD-SAP

APSSE-SA

PN

LSE-SAP

PLME-SAP

Medium Access Layer (MAC) Layer

MLME-SAPMCPS-SAP

Network (NWK) Layer

NLM

E-SAP

NLDE-SAP

Application Support (APS) Sub-Layer

APSDE-SAP APSDE-SAP APSDE-SAP

APSM

E-SAP

Application Framework

Application Object 240

[On Endpoint 240]

Application Object 1

[On Endpoint 1]

ZPUI ZigBee Device

Object (ZDO)[On Endpoint 0]

Page 15: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

15

Data Types

Data type Data length (octets)

No data 0

Unsigned 8-bit integer 1

Signed 8-bit integer 1

Unsigned 16-bit integer 2

Signed 16-bit integer 2

Semi-precision 2

Absolute time (s) 4

Relative time (ms) 4

Character string Defined in 1st octet

Octet string Defined in 1st octet

Page 16: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

16

Descriptors

Name Mandatory/Optional Description

Node M Type and capabilities of the node (one per device)

Node power M Node power characteristics (one per device)

Simple M Device descriptions contained in the node (one per active endpoint)

Complex O Further information about the device descriptions (one per active endpoint)

User O User-definable information

Page 17: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

17

Node Descriptor

Field name Length (bits) Description

Logical type 3 ZigBee coordinator, router, end-device

868MHz, 915MHz, 2.4GHz

Alternative PAN coordinator, MAC logical device type, power source, receiver on when idle, security capability

Allocated by the ZigBee Alliance

Max size of data passed to application

Frequency band 5

MAC capability flags 8

Manufacturer code 16

Maximum buffer size 8

Page 18: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

18

Simple Descriptor

Field name Length (bits) Description

Endpoint 8 The endpoint to which this descriptor refers

The profile implemented on this endpoint

The device description implemented on this endpoint

Version 1.0

Complex, user descriptor available

Number of input clusters

List of supported input clusters

Number of output clusters

Application output cluster list 8*o List of supported output clusters

Application profile ID 16

Application device ID 16

Application device version 4

Application flags 4

Application input cluster count 8

Application input cluster list 8*i

Application output cluster count 8

Page 19: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

19

General AF Frame Format

Bits:4 4 Variable Variable Variable

Transaction count Frame type Transaction 1 … Transaction

n

Number of transactions, n,

included in the frame

Key Value Pair (KVP) or

Message (MSG)

Where each transaction, Transaction i, has the format:

Bits:8 Variable

Transaction sequence number

Transaction data

Transaction header

Transaction payload

Transaction sequence number used to tie response frames to

request frames

Page 20: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

20

General KVP Command Frame Format

Bits: 4 4 16 0/8 Variable

Command type

identifier

Attribute data type

Attribute identifier Error code Attribute

data

Appropriate data type (See

Defined in appropriate device

description

Dependent on command, data type

and device descriptionData Types)

•Set•Event•Get with acknowledgement•Set with acknowledgement•Event with acknowledgement•Get response•Set response•Event response

•Success•Invalid endpoint•Unsupported attribute•Invalid command type•Invalid attribute data length•Invalid attribute data•Application defined error

Page 21: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

21

MSG Frame Format

Bits: 8 Variable

Message length

Message data

■ Designed for commands which do not fit into the KVP structure

■ Free form data

■ No response support

■ All transactions must be defined in the device description

Page 22: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

22

The ZigBee Device Object

Physical (PHY) Layer

Security Service Provider

PD-SAP

APSSE-SA

PN

LSE-SAP

PLME-SAP

Medium Access Layer (MAC) Layer

MLME-SAPMCPS-SAP

Network (NWK) Layer

NLM

E-SAP

NLDE-SAP

Application Support (APS) Sub-Layer

APSDE-SAP APSDE-SAP APSDE-SAP

APSM

E-SAP

Application Framework

Application Object 240

[On Endpoint 240]

Application Object 1

[On Endpoint 1]

ZPUI ZigBee Device

Object (ZDO)[On Endpoint 0]

Page 23: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

23

Device & Service Discovery Commands

AddressingCommand

Request Response

NWK address Broadcast Unicast

IEEE address Unicast Unicast

Unicast

Unicast

Unicast

Unicast

Unicast

Unicast

Unicast

Unicast

Node descriptor Unicast

Power descriptor Unicast

Simple descriptor Unicast

Active endpoint Unicast

Match descriptor Broadcast/unicast

Complex descriptor Unicast

User descriptor Unicast

End device announce Unicast to ZC

ZC = ZigBee Coordinator

Page 24: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

24

Binding Commands

AddressingCommand

Request Response

End device bind Unicast to ZC Unicast

Bind Unicast to ZC or Src Unicast

UnicastUnbind Unicast to ZC or Src

ZC = ZigBee Coordinator

Page 25: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

25

Network Management Commands

AddressingCommand

Request Response

Network discovery Unicast to ZC/router Unicast

Neighbour table Unicast to ZC/router Unicast

Unicast

Unicast

Unicast

Unicast

Routing table Unicast to ZC/router

Binding table Unicast to ZC/router

Leave network Unicast

Direct network join Unicast to ZC/router

ZC = ZigBee Coordinator

Page 26: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

26

Logical Device Types

■State machine description for each device type►ZigBee Coordinator

►ZigBee Router

►ZigBee End Device

■Device initialisation

■Device normal operating state

Page 27: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

27

Profiles

Physical (PHY) Layer

Security Service Provider

PD-SAP

APSSE-SA

PN

LSE-SAP

PLME-SAP

Medium Access Layer (MAC) Layer

MLME-SAPMCPS-SAP

Network (NWK) Layer

NLM

E-SAP

NLDE-SAP

Application Support (APS) Sub-Layer

APSDE-SAP APSDE-SAP APSDE-SAP

APSM

E-SAP

Application Framework

Application Object 240

[On Endpoint 240]

Application Object 1

[On Endpoint 1]

ZPUI ZigBee Device

Object (ZDO)[On Endpoint 0]

Page 28: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

28

Why Do We Need Profiles?

■Need a common language for exchanging data

■Need a well defined set of processing actions

■Device interoperability across different manufacturers

■Allows solid conformance test programmes to be created

■Simplicity and reliability for the end users

■Realistic application specifications developed through OEM experience

Page 29: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

29

Profile Classes

■Standard profiles►For generically useful applications►Developed publicly by members of the ZigBee Alliance►Managed within the Application Framework Working Group►Development follows the profile lifecycle►Enables products to undergo logo certification so that the

ZigBee logo can be used

■Private profiles►For manufacturer specific proprietary applications►Developed privately by individual manufacturers►Private profiles must use a ZigBee allocated profile identifier►Commercial products built using private profiles must undergo

“no harm” testing

Page 30: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

30

Profile Development Lifecycle

Demonstrateinteroperable

implementations

Qualification & certificationPre-development

Profileproposal

presentation

Gauge interestand form profile

task group

Profiletask group

formed

PTG development

Develop marketrequirements

document

MRDcomplete

Developprofile

specification

Profilespecification

complete

Definecompliance

tests with ZQG

Compliancetest casescomplete

Profilecomplete,

published & ratified

products appear

Page 31: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

31

Current Profiles

■Commercial building automation►Complete building control, monitoring and energy management

■Home automation►Low to high end residential systems for control of devices

around the home

■ Industrial plant monitoring►Monitoring time varying attributes related to operating

environment and machinery conditions

■Wireless sensor applications►Environmental monitoring, asset tracking and structural

monitoring

Page 32: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Wireless Control That Simply WorksZigBeeTM Alliance |Copyright © 2005-2006. All Rights Reserved.

32

Future Standard Profiles

■ Telecom applications► Light data sharing► Active RFID in mobile paying

■ Automatic Meter Reading► Residential & commercial utility systems

■ Personal/home health care► Body area networks► Fitness monitoring: home, gym, on-the-move► Patient monitoring

■ Automotive► In vehicle control: vehicular & entertainment► Status monitoring

■ Others identified by ZigBee members

Page 33: Introduction to the ZigBee Application Frameworkread.pudn.com/downloads446/doc/1879210/064483r00ZB... · ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2005-2006

Copyright © 2005-2006 ZigBeeTM Alliance. All Rights Reserved.

Wireless Control That Simply Works

Any Questions?