Digi XBee(R) ANSI C Host Library
zcl_ota_server.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 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., 9350 Excelsior Blvd., Suite 700, Hopkins, MN 55343
10  * ===========================================================================
11  */
12 
21 #ifndef ZCL_OTA_SERVER_H
22 #define ZCL_OTA_SERVER_H
23 
24 #include "zigbee/zcl_ota_upgrade.h"
25 #include "zigbee/zcl.h"
26 
28 
31  void FAR *context);
32 
34 #define ZCL_OTA_UPGRADE_CLUSTER_ENTRY \
35  { ZCL_CLUST_OTA_UPGRADE, zcl_ota_upgrade_cluster_handler, \
36  NULL, WPAN_CLUST_FLAG_SERVER }
37 
38 // forward declaration to define zcl_ota_upgrade_read_fn
40 
54 typedef int (*zcl_ota_upgrade_read_fn)
55  (const struct zcl_ota_upgrade_source_t *source,
56  void *buffer, uint32_t offset, size_t bytes, const addr64 *client_ieee_be);
57 
59 typedef struct zcl_ota_upgrade_source_t {
62 
64  void *context;
66 
83  const zcl_ota_image_id_t *image_id,
84  const wpan_endpoint_table_entry_t *src_ep,
85  uint8_t dest_ep,
86  const addr64 *ieee_addr_be,
87  uint16_t network_addr);
88 
104  *zcl_ota_get_upgrade_source(const addr64 *client_ieee_be,
105  const zcl_ota_image_id_t *id,
106  uint8_t zcl_command);
107 
120 // TODO: If we support using a current_time field, pass that to the callback.
121 uint32_t zcl_ota_get_upgrade_time(const addr64 *client_ieee_be,
122  const zcl_ota_upgrade_source_t *source);
123 
125 
126 #endif // ZCL_OTA_SERVER_H
127 
unsigned long uint32_t
32-bit unsigned integer
Definition: platform_config.h:43
Based on ZigBee document 095264r23.
#define FAR
On platforms with "far" pointers, define to the proper keyword; empty definition if not required...
Definition: platform.h:396
Datatype for providing an OTA Upgrade Image to a client.
Definition: zcl_ota_server.h:59
#define XBEE_BEGIN_DECLS
Macro defined to.
Definition: platform.h:41
zcl_ota_upgrade_read_fn read_handler
callback to read image
Definition: zcl_ota_server.h:63
uint32_t image_size
size of image
Definition: zcl_ota_server.h:61
int zcl_ota_upgrade_cluster_handler(const wpan_envelope_t FAR *envelope, void FAR *context)
Handler for an OTA Upgrade Server's wpan_cluster_table_entry_t.
Definition: zcl_ota_server.c:258
Header for implementation of ZigBee Cluster Library.
unsigned short uint16_t
16-bit unsigned integer
Definition: platform_config.h:41
zcl_ota_image_id_t id
ID fields for image.
Definition: zcl_ota_server.h:60
const zcl_ota_upgrade_source_t * zcl_ota_get_upgrade_source(const addr64 *client_ieee_be, const zcl_ota_image_id_t *id, uint8_t zcl_command)
Application-provided callback from ZCL OTA Upgrade cluster handler to retrieve a structure with detai...
int zcl_ota_upgrade_image_notify(wpan_dev_t *wpan_dev, const zcl_ota_image_id_t *image_id, const wpan_endpoint_table_entry_t *src_ep, uint8_t dest_ep, const addr64 *ieee_addr_be, uint16_t network_addr)
Send at OTA Upgrade Image Notify command.
Definition: zcl_ota_server.c:35
unsigned char uint8_t
8-bit unsigned integer
Definition: platform_config.h:39
Common sequence of fields appearing in multiple frame formats.
Definition: zcl_ota_upgrade.h:44
uint32_t zcl_ota_get_upgrade_time(const addr64 *client_ieee_be, const zcl_ota_upgrade_source_t *source)
Application-provided callback from ZCL OTA Upgrade cluster handler to retrieve the upgrade time to re...
void * context
location to hold user data
Definition: zcl_ota_server.h:64
int(* zcl_ota_upgrade_read_fn)(const struct zcl_ota_upgrade_source_t *source, void *buffer, uint32_t offset, size_t bytes, const addr64 *client_ieee_be)
Callback for ZCL OTA Upgrade Server to supply data to Image Block Requests.
Definition: zcl_ota_server.h:55
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
#define XBEE_END_DECLS
Macro defined to.
Definition: platform.h:42
Information on each endpoint on this device.
Definition: aps.h:252
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