37 #define ZDO_CONVERSATION_TIMEOUT 15 49 #define ZDO_ENDPOINT(state) \ 50 { WPAN_ENDPOINT_ZDO, WPAN_PROFILE_ZDO, zdo_handler, \ 51 &state, 0x0000, 0x00, NULL } 71 #define ZDO_REQUEST_TYPE_SINGLE 0x00 73 #define ZDO_REQUEST_TYPE_EXTENDED 0x01 79 #define ZDO_CAPABILITY_ALTERNATE_PAN 0x01 80 #define ZDO_CAPABILITY_FULL_FUNCTION 0x02 81 #define ZDO_CAPABILITY_MAINS_POWER 0x04 82 #define ZDO_CAPABILITY_RX_ON_IDLE 0x08 83 #define ZDO_CAPABILITY_RESERVED_1 0x10 84 #define ZDO_CAPABILITY_RESERVED_2 0x20 85 #define ZDO_CAPABILITY_SECURITY 0x40 86 #define ZDO_CAPABILITY_ALLOCATE_ADDR 0x80 93 #define ZDO_STATUS_SUCCESS 0x00 95 #define ZDO_STATUS_INV_REQUESTTYPE 0x80 96 #define ZDO_STATUS_DEVICE_NOT_FOUND 0x81 97 #define ZDO_STATUS_INVALID_EP 0x82 98 #define ZDO_STATUS_NOT_ACTIVE 0x83 99 #define ZDO_STATUS_NOT_SUPPORTED 0x84 100 #define ZDO_STATUS_TIMEOUT 0x85 101 #define ZDO_STATUS_NO_MATCH 0x86 103 #define ZDO_STATUS_NO_ENTRY 0x88 104 #define ZDO_STATUS_NO_DESCRIPTOR 0x89 105 #define ZDO_STATUS_INSUFFICIENT_SPACE 0x8A 106 #define ZDO_STATUS_NOT_PERMITTED 0x8B 107 #define ZDO_STATUS_TABLE_FULL 0x8C 108 #define ZDO_STATUS_NOT_AUTHORIZED 0x8D 112 #define ZDO_CLUST_RESPONSE_MASK 0x8000 114 #define ZDO_CLUST_IS_RESPONSE(c) (c & ZDO_CLUST_RESPONSE_MASK) 120 #define ZDO_NWK_ADDR_REQ 0x0000 121 #define ZDO_NWK_ADDR_RSP 0x8000 140 #define ZDO_NET_ADDR_PENDING 0xFFFE 141 #define ZDO_NET_ADDR_TIMEOUT 0xFFFF 142 #define ZDO_NET_ADDR_ERROR 0xFFFD 178 #define ZDO_IEEE_ADDR_REQ 0x0001 179 #define ZDO_IEEE_ADDR_RSP 0x8001 191 #define ZDO_IEEE_ADDR_PENDING WPAN_IEEE_ADDR_UNDEFINED 192 #define ZDO_IEEE_ADDR_TIMEOUT WPAN_IEEE_ADDR_BROADCAST 193 #define ZDO_IEEE_ADDR_ERROR WPAN_IEEE_ADDR_ALL_ZEROS 257 #define ZDO_NODE_DESC_REQ 0x0002 258 #define ZDO_NODE_DESC_RSP 0x8002 280 #define ZDO_NODE_DESC_FLAGS0_TYPE_MASK 0x07 281 #define ZDO_NODE_DESC_FLAGS0_TYPE_COORD 0x00 282 #define ZDO_NODE_DESC_FLAGS0_TYPE_ROUTER 0x01 283 #define ZDO_NODE_DESC_FLAGS0_TYPE_ENDDEV 0x02 285 #define ZDO_NODE_DESC_FLAGS0_COMPLEX_DESC_AVAIL 0x08 286 #define ZDO_NODE_DESC_FLAGS0_USER_DESC_AVAIL 0x10 288 #define ZDO_NODE_DESC_FLAGS0_RESERVED 0xE0 290 #define ZDO_NODE_DESC_FLAGS1_APS_FIELD 0x07 291 #define ZDO_NODE_DESC_FLAGS1_FREQUENCY_MASK 0xF8 293 #define ZDO_NODE_DESC_FLAGS1_FREQ_868 (1<<0) 294 #define ZDO_NODE_DESC_FLAGS1_FREQ_RESERVED_1 (1<<1) 295 #define ZDO_NODE_DESC_FLAGS1_FREQ_900 (1<<2) 296 #define ZDO_NODE_DESC_FLAGS1_FREQ_2400 (1<<3) 297 #define ZDO_NODE_DESC_FLAGS1_FREQ_RESERVED_4 (1<<4) 302 #define ZDO_NODE_DESC_MAC_CAPABILITY_ALT_PAN_COORD (1<<0) 303 #define ZDO_NODE_DESC_MAC_CAPABILITY_DEVICE_TYPE (1<<1) 304 #define ZDO_NODE_DESC_MAC_CAPABILITY_POWER_SOURCE (1<<2) 305 #define ZDO_NODE_DESC_MAC_CAPABILITY_RX_ON_IDLE (1<<3) 306 #define ZDO_NODE_DESC_MAC_CAPABILITY_RESERVED_4 (1<<4) 307 #define ZDO_NODE_DESC_MAC_CAPABILITY_RESERVED_5 (1<<5) 308 #define ZDO_NODE_DESC_MAC_CAPABILITY_SECURITY (1<<6) 309 #define ZDO_NODE_DESC_MAC_CAPABILITY_ALLOCATE_ADDR (1<<7) 315 #define ZDO_NODE_DESC_SERVER_MASK_PRIMARY_TRUST (1<<0) 316 #define ZDO_NODE_DESC_SERVER_MASK_BACKUP_TRUST (1<<1) 317 #define ZDO_NODE_DESC_SERVER_MASK_PRIMARY_BINDING (1<<2) 318 #define ZDO_NODE_DESC_SERVER_MASK_BACKUP_BINDING (1<<3) 319 #define ZDO_NODE_DESC_SERVER_MASK_PRIMARY_DISCOVERY (1<<4) 320 #define ZDO_NODE_DESC_SERVER_MASK_BACKUP_DISCOVERY (1<<5) 321 #define ZDO_NODE_DESC_SERVER_MASK_NETWORK_MANAGER (1<<6) 335 #define ZDO_POWER_DESC_REQ 0x0003 336 #define ZDO_POWER_DESC_RSP 0x8003 348 #define ZDO_POWER_SOURCE_MAINS 0x01 350 #define ZDO_POWER_SOURCE_RECHARGABLE 0x02 351 #define ZDO_POWER_SOURCE_DISPOSABLE 0x04 352 #define ZDO_POWER_SOURCE_RESERVED 0x08 355 #define ZDO_POWER0_SYNC 0x00 356 #define ZDO_POWER0_PERIODIC 0x01 357 #define ZDO_POWER0_STIMULATED 0x02 360 #define ZDO_POWER0_AVAIL_MAINS (ZDO_POWER_SOURCE_MAINS << 4) 361 #define ZDO_POWER0_AVAIL_RECHARGABLE (ZDO_POWER_SOURCE_RECHARGABLE << 4) 362 #define ZDO_POWER0_AVAIL_DISPOSABLE (ZDO_POWER_SOURCE_DISPOSABLE << 4) 363 #define ZDO_POWER0_AVAIL_RESERVED (ZDO_POWER_SOURCE_RESERVED << 4) 366 #define ZDO_POWER1_LEVEL_CRITICAL 0x00 367 #define ZDO_POWER1_LEVEL_33 0x40 368 #define ZDO_POWER1_LEVEL_66 0x80 369 #define ZDO_POWER1_LEVEL_FULL 0xC0 372 #define ZDO_POWER1_CURRENT_MAINS ZDO_POWER_SOURCE_MAINS 373 #define ZDO_POWER1_CURRENT_RECHARGABLE ZDO_POWER_SOURCE_RECHARGABLE 374 #define ZDO_POWER1_CURRENT_DISPOSABLE ZDO_POWER_SOURCE_DISPOSABLE 375 #define ZDO_POWER1_CURRENT_RESERVED ZDO_POWER_SOURCE_RESERVED 396 #define ZDO_SIMPLE_DESC_REQ 0x0004 397 #define ZDO_SIMPLE_DESC_RSP 0x8004 455 uint16_t addr_of_interest, uint_fast8_t endpoint,
462 #define ZDO_ACTIVE_EP_REQ 0x0005 463 #define ZDO_ACTIVE_EP_RSP 0x8005 485 #define ZDO_MATCH_DESC_REQ 0x0006 486 #define ZDO_MATCH_DESC_RSP 0x8006 518 #define ZDO_COMPLEX_DESC_REQ 0x0007 519 #define ZDO_COMPLEX_DESC_RSP 0x8007 533 #define ZDO_USER_DESC_REQ 0x0011 534 #define ZDO_USER_DESC_RSP 0x8011 548 #define ZDO_DEVICE_ANNCE 0x0013 559 #define ZDO_DEVICE_ANNCE_CLUSTER( handler, context) \ 560 { ZDO_DEVICE_ANNCE, handler, context, \ 561 WPAN_CLUST_FLAG_OUTPUT | WPAN_CLUST_FLAG_NOT_ZCL } 567 #define ZDO_BIND_REQ 0x0021 568 #define ZDO_BIND_RSP 0x8021 570 #define ZDO_UNBIND_REQ 0x0022 572 #define ZDO_UNBIND_RSP 0x8022 604 #define ZDO_BIND_DST_MODE_GROUP 0x01 605 #define ZDO_BIND_DST_MODE_ADDR 0x03 638 #define ZDO_MGMT_LEAVE_REQ 0x0034 639 #define ZDO_MGMT_LEAVE_RSP 0x8034 646 #define ZDO_MGMT_LEAVE_REQ_FLAG_NONE 0x00 647 #define ZDO_MGMT_LEAVE_REQ_FLAG_REJOIN 0x01 648 #define ZDO_MGMT_LEAVE_REQ_FLAG_REMOVE_CHILDREN 0x02 656 #define ZDO_MGMT_LEAVE_REQ_ENCRYPTED 0x0100 701 const void FAR *context);
710 #endif // __XBEE_ZDO_H frame format for a ZDO Management Leave Request
Definition: zdo.h:643
frame format for ZDO Active_EP request
Definition: zdo.h:467
frame format for ZDO Complex_Desc request
Definition: zdo.h:523
int zdo_handler(const wpan_envelope_t FAR *envelope, wpan_ep_state_t FAR *ep_state)
Process ZDO frames (received on endpoint 0 with Profile ID 0).
Definition: zigbee_zdo.c:731
WPAN datatypes and support functions, valid for ZigBee and DigiMesh.
int zdo_send_descriptor_req(wpan_envelope_t *envelope, uint16_t cluster, uint16_t addr_of_interest, wpan_response_fn callback, const void FAR *context)
Send a ZDO Node, Power, Complex or User Descriptor request, or an Active Endpoint request...
Definition: zigbee_zdo.c:925
#define FAR
On platforms with "far" pointers, define to the proper keyword; empty definition if not required...
Definition: platform.h:396
int zdo_simple_desc_request(wpan_envelope_t *envelope, uint16_t addr_of_interest, uint_fast8_t endpoint, wpan_response_fn callback, const void FAR *context)
Send a ZDO Simple Descriptor Request.
Definition: zigbee_zdo.c:422
int(* wpan_response_fn)(struct wpan_conversation_t FAR *conversation, const wpan_envelope_t FAR *envelope)
Handler registered with wpan_conversation_register() to process responses to outstanding requests...
Definition: aps.h:493
frame format for ZDO Complex_Desc request
Definition: zdo.h:538
frame format for ZDO Power_Desc request
Definition: zdo.h:340
#define XBEE_BEGIN_DECLS
Macro defined to.
Definition: platform.h:41
int zdo_send_nwk_addr_req(wpan_dev_t *dev, const addr64 FAR *ieee_be, uint16_t FAR *net)
Given a device's IEEE (64-bit) address, get its 16-bit network address by unicasting a ZDO NWK_addr r...
Definition: zigbee_zdo.c:1028
int zdo_send_ieee_addr_req(wpan_dev_t *dev, uint16_t net_addr, addr64 FAR *ieee_be)
Given a device's 16-bit network address, get its IEEE (64-bit) address by unicasting a ZDO IEEE_addr ...
Definition: zigbee_zdo.c:1134
Volatile part of an endpoint record used to track conversations (requests waiting for responses)...
Definition: aps.h:529
frame format for a ZDO Bind Request with a group address as the destination (header.dst_addr_mode == ZDO_BIND_DST_MODE_GROUP)
Definition: zdo.h:584
frame format for a ZDO Device_annce announcement
Definition: zdo.h:556
int zdo_match_desc_request(void *buffer, int16_t buflen, uint16_t addr_of_interest, uint16_t profile_id, const uint16_t *inClust, const uint16_t *outClust)
Generate a Match_Desc (Match Descriptor) request (ZigBee spec 2.4.3.1.7) to send on the network...
Definition: zigbee_zdo.c:247
unsigned short uint16_t
16-bit unsigned integer
Definition: platform_config.h:41
< see ZDO_STATUS_* macros
Definition: zdo.h:329
unsigned char uint8_t
8-bit unsigned integer
Definition: platform_config.h:39
int zdo_send_response(const wpan_envelope_t FAR *request, const void FAR *response, uint16_t length)
Send a response to a ZDO request.
Definition: zigbee_zdo.c:160
Cluster/Endpoint layer for WPAN networks (ZigBee and DigiMesh).
frame format for ZDO Node_Desc request
Definition: zdo.h:262
frame format for ZDO Node_Desc response
Definition: zdo.h:268
format for ZDO PowerDescriptor
Definition: zdo.h:382
frame format for ZDO Power_Desc response
Definition: zdo.h:389
header for ZDO Match_Desc request
Definition: zdo.h:495
short int16_t
16-bit signed integer
Definition: platform_config.h:40
Typedef used to hold a 64-bit IEEE address, represented as 8 bytes, 4 16-bit values or 2 32-bit value...
Definition: types.h:34
int zdo_mgmt_leave_req(wpan_dev_t *dev, const addr64 *address, uint16_t flags)
Send a ZDO Management Leave Request.
Definition: zigbee_zdo.c:892
#define XBEE_END_DECLS
Macro defined to.
Definition: platform.h:42
frame format for a ZDO Bind Request with an IEEE address and endpoint as the destination (header...
Definition: zdo.h:591
frame format for ZDO Simple_Desc request
Definition: zdo.h:404
int zdo_send_bind_req(wpan_envelope_t *envelope, uint16_t type, wpan_response_fn callback, void FAR *context)
Send a ZDO Bind (or Unbind) Request to the destination address in the envelope.
Definition: zigbee_zdo.c:839
wpan_ep_state_t FAR * zdo_endpoint_state(wpan_dev_t *dev)
Returns the ZDO endpoint's state if a device has a ZDO endpoint.
Definition: zigbee_zdo.c:82
frame format for ZDO NKW_addr request
Definition: zdo.h:129
Second half of Match_Desc request.
Definition: zdo.h:503
The "envelope" is used to gather all necessary information about a given frame on the network...
Definition: aps.h:40
Structure used by the WPAN/ZigBee layers.
Definition: aps.h:390
frame format for ZDO IEEE_addr request
Definition: zdo.h:187