Digi XBee(R) ANSI C Host Library
zcl_client.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2012 Digi International Inc.,
3  * All rights not expressly granted are reserved.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
7  * You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343
10  * =======================================================================
11  */
12 
20 #ifndef __ZCL_CLIENT_H
21 #define __ZCL_CLIENT_H
22 
23 #include "wpan/aps.h"
24 #include "zigbee/zcl.h"
25 
27 
28 typedef struct zcl_client_read
29 {
30  // include ieee, network and dest endpoint?
31  // discovery has those set to broadcast, response handler fills them in?
33  uint16_t mfg_id;
34  // ZCL_MFG_NONE for standard
35  uint16_t cluster_id;
36  const uint16_t FAR *attribute_list;
38 
39 int zcl_find_and_read_attributes( wpan_dev_t *dev, const uint16_t *clusters,
40  const zcl_client_read_t FAR *cr);
42  const zcl_attribute_base_t FAR *attr_table);
44  const wpan_envelope_t FAR *envelope);
45 int zdo_send_match_desc( wpan_dev_t *dev, const uint16_t *clusters,
46  uint16_t profile_id, wpan_response_fn callback, const void FAR *context);
48  const zcl_client_read_t *client_read);
49 
50 int zcl_create_attribute_records( void FAR *buffer,
51  uint8_t bufsize, const zcl_attribute_base_t FAR **p_attr_list);
53  const zcl_attribute_base_t FAR *attr_list);
54 
55 int zcl_print_attribute_value( uint8_t type, const void *value,
56  int value_length);
57 int zcl_print_array_value( const void *value, int value_length);
58 int zcl_print_struct_value( const void *value, int value_length);
59 
60 typedef const char *(*zcl_format_utctime_fn)( char dest[40],
61  zcl_utctime_t utctime);
62 extern zcl_format_utctime_fn zcl_format_utctime;
63 
65 
66 // If compiling in Dynamic C, automatically #use the appropriate C file.
67 #ifdef __DC__
68  #use "zcl_client.c"
69 #endif
70 
71 #endif // __ZCL_CLIENT_H
72 
Used to track conversations (outstanding requests) on an endpoint.
Definition: aps.h:505
#define FAR
On platforms with "far" pointers, define to the proper keyword; empty definition if not required...
Definition: platform.h:396
int zcl_print_array_value(const void *value, int value_length)
Print Read Attributes Response value of an array attribute.
Definition: zcl_client.c:617
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
int zdo_send_match_desc(wpan_dev_t *dev, const uint16_t *clusters, uint16_t profile_id, wpan_response_fn callback, const void FAR *context)
Send a ZDO Match Descriptor request for a list of cluster IDs.
Definition: zcl_client.c:334
#define XBEE_BEGIN_DECLS
Macro defined to.
Definition: platform.h:41
int _zcl_send_read_from_zdo_match(wpan_conversation_t FAR *conversation, const wpan_envelope_t FAR *envelope)
Definition: zcl_client.c:182
Structure populated by zcl_command_build() with the ZCL header from a received ZCL command frame...
Definition: zcl.h:876
int zcl_create_attribute_records(void FAR *buffer, uint8_t bufsize, const zcl_attribute_base_t FAR **p_attr_list)
From a list of attributes, write ID (in little-endian byte order), type and value to a buffer as woul...
Definition: zcl_client.c:426
Header for implementation of ZigBee Cluster Library.
Basic structure for storing a list of attributes in a cluster.
Definition: zcl.h:735
int zcl_print_struct_value(const void *value, int value_length)
Print Read Attributes Response value of a structure attribute.
Definition: zcl_client.c:678
Definition: zcl_client.h:28
unsigned short uint16_t
16-bit unsigned integer
Definition: platform_config.h:41
zcl_format_utctime_fn zcl_format_utctime
Pointer to function that converts a zcl_utctime_t value to a human-readable timestamp.
Definition: zcl_client.c:590
unsigned char uint8_t
8-bit unsigned integer
Definition: platform_config.h:39
Cluster/Endpoint layer for WPAN networks (ZigBee and DigiMesh).
int zcl_process_read_attr_response(zcl_command_t *zcl, const zcl_attribute_base_t FAR *attr_table)
Process a Read Attributes Response and populate the attibute values into an attribute table as if it ...
Definition: zcl_client.c:60
int zcl_send_write_attributes(wpan_envelope_t *envelope, const zcl_attribute_base_t FAR *attr_list)
Send one or more Write Attributes Requests to a node on the network.
Definition: zcl_client.c:496
#define XBEE_END_DECLS
Macro defined to.
Definition: platform.h:42
int zcl_client_read_attributes(wpan_envelope_t FAR *envelope, const zcl_client_read_t *client_read)
Send a Read Attributes request for attributes listed in client_read.
Definition: zcl_client.c:103
Information on each endpoint on this device.
Definition: aps.h:252
int zcl_print_attribute_value(uint8_t type, const void *value, int value_length)
Formats an attribute value and prints it to stdout.
Definition: zcl_client.c:731
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
int zcl_find_and_read_attributes(wpan_dev_t *dev, const uint16_t *clusters, const zcl_client_read_t FAR *cr)
Use ZDO Match Descriptor Requests to find devices with a given profile/cluster and then automatically...
Definition: zcl_client.c:300