A sample policy file that implements the callbacks for the Zigbee Over-the-air bootload cluster server.

License#

Copyright 2018 Silicon Laboratories Inc. www.silabs.com

The licensor of this software is Silicon Laboratories Inc. Your use of this software is governed by the terms of Silicon Labs Master Software License Agreement (MSLA) available at www.silabs.com/about-us/legal/master-software-license-agreement. This software is distributed to you in Source Code format and is governed by the sections of the MSLA applicable to Source Code.

/***************************************************************************/
#define OTA_SERVER_NO_RATE_LIMITING_FOR_CLIENT          0
#define OTA_SERVER_CLIENT_USES_MILLISECONDS             1
#define OTA_SERVER_CLIENT_USES_SECONDS                  2
#define OTA_SERVER_DISCOVER_CLIENT_DELAY_UNITS          3
#ifdef SL_ZIGBEE_TEST
 #define OTA_SERVER_DO_NOT_OVERRIDE_CLIENT_DELAY_UNITS  0xFF
#endif

uint8_t sl_zigbee_af_ota_server_policy_get_client_delay_units(sl_802154_short_addr_t clientNodeId,
                                                              sl_802154_long_addr_t clientEui64);
 // end of name API

uint8_t sl_zigbee_af_ota_server_image_block_request_cb(sl_zigbee_af_image_block_request_callback_struct_t* data);
 // end of ota_server_policy_cb // end of name Callbacks // end of ota-server-policy

void sli_zigbee_af_ota_server_policy_print(void);

void sli_zigbee_af_ota_server_set_query_policy(uint8_t value);
void sli_zigbee_af_ota_server_set_block_request_policy(uint8_t value);
void sli_zigbee_af_ota_server_set_upgrade_policy(uint8_t value);

bool sli_zigbee_af_server_page_request_tick_callback(uint16_t relativeOffset, uint8_t blockSize);
void sli_zigbee_af_set_page_request_missed_block_modulus(uint16_t modulus);
void sli_zigbee_af_ota_server_set_page_request_policy(uint8_t value);
void sli_zigbee_af_ota_server_policy_set_min_block_request_period(uint16_t minBlockRequestPeriodMS);

API#

uint8_t
sl_zigbee_af_ota_server_policy_get_client_delay_units(sl_802154_short_addr_t clientNodeId, sl_802154_long_addr_t clientEui64)

GetClientDelayUnits.

Callbacks#

uint8_t
sl_zigbee_af_ota_server_image_block_request_cb(sl_zigbee_af_image_block_request_callback_struct_t *data)

API Documentation#

sl_zigbee_af_ota_server_policy_get_client_delay_units#

uint8_t sl_zigbee_af_ota_server_policy_get_client_delay_units (sl_802154_short_addr_t clientNodeId, sl_802154_long_addr_t clientEui64)

GetClientDelayUnits.

Parameters
N/AclientNodeId

Ver.: always

N/AclientEui64

Ver.: always

Called when the server receives an Image Block Request from a client that supports rate limiting using the Minimum Block Period feature. This callback gives the server a chance to decide which units the client uses for the Minimum Block Period, seconds or milliseconds. The server can also return OTA_SERVER_DISCOVER_CLIENT_DELAY_UNITS, which causes the plugin code to test the client by sending it a preset delay value. The length of time the client delays determines which units it uses. For more information on this feature, see the plugin option descriptions under the OTA Server plugin.

For return values, see ota-server-policy.h. An unknown return value will result in the same behavior as if OTA_SERVER_CLIENT_USES_MILLISECONDS had been returned.


Definition at line 69 of file app/framework/plugin/ota-server-policy/ota-server-policy.h

Callbacks Documentation#

sl_zigbee_af_ota_server_image_block_request_cb#

uint8_t sl_zigbee_af_ota_server_image_block_request_cb (sl_zigbee_af_image_block_request_callback_struct_t * data)
Parameters
N/Adata

Definition at line 91 of file app/framework/plugin/ota-server-policy/ota-server-policy.h

Macro Definition Documentation#

OTA_SERVER_NO_RATE_LIMITING_FOR_CLIENT#

#define OTA_SERVER_NO_RATE_LIMITING_FOR_CLIENT
Value:
0

Definition at line 38 of file app/framework/plugin/ota-server-policy/ota-server-policy.h

OTA_SERVER_CLIENT_USES_MILLISECONDS#

#define OTA_SERVER_CLIENT_USES_MILLISECONDS
Value:
1

Definition at line 39 of file app/framework/plugin/ota-server-policy/ota-server-policy.h

OTA_SERVER_CLIENT_USES_SECONDS#

#define OTA_SERVER_CLIENT_USES_SECONDS
Value:
2

Definition at line 40 of file app/framework/plugin/ota-server-policy/ota-server-policy.h

OTA_SERVER_DISCOVER_CLIENT_DELAY_UNITS#

#define OTA_SERVER_DISCOVER_CLIENT_DELAY_UNITS
Value:
3

Definition at line 41 of file app/framework/plugin/ota-server-policy/ota-server-policy.h

Function Documentation#

sli_zigbee_af_ota_server_policy_print#

void sli_zigbee_af_ota_server_policy_print (void )
Parameters
N/A

Definition at line 97 of file app/framework/plugin/ota-server-policy/ota-server-policy.h

sli_zigbee_af_ota_server_set_query_policy#

void sli_zigbee_af_ota_server_set_query_policy (uint8_t value)
Parameters
N/Avalue

Definition at line 99 of file app/framework/plugin/ota-server-policy/ota-server-policy.h

sli_zigbee_af_ota_server_set_block_request_policy#

void sli_zigbee_af_ota_server_set_block_request_policy (uint8_t value)
Parameters
N/Avalue

Definition at line 100 of file app/framework/plugin/ota-server-policy/ota-server-policy.h

sli_zigbee_af_ota_server_set_upgrade_policy#

void sli_zigbee_af_ota_server_set_upgrade_policy (uint8_t value)
Parameters
N/Avalue

Definition at line 101 of file app/framework/plugin/ota-server-policy/ota-server-policy.h

sli_zigbee_af_server_page_request_tick_callback#

bool sli_zigbee_af_server_page_request_tick_callback (uint16_t relativeOffset, uint8_t blockSize)
Parameters
N/ArelativeOffset
N/AblockSize

Definition at line 103 of file app/framework/plugin/ota-server-policy/ota-server-policy.h

sli_zigbee_af_set_page_request_missed_block_modulus#

void sli_zigbee_af_set_page_request_missed_block_modulus (uint16_t modulus)
Parameters
N/Amodulus

Definition at line 104 of file app/framework/plugin/ota-server-policy/ota-server-policy.h

sli_zigbee_af_ota_server_set_page_request_policy#

void sli_zigbee_af_ota_server_set_page_request_policy (uint8_t value)
Parameters
N/Avalue

Definition at line 105 of file app/framework/plugin/ota-server-policy/ota-server-policy.h

sli_zigbee_af_ota_server_policy_set_min_block_request_period#

void sli_zigbee_af_ota_server_policy_set_min_block_request_period (uint16_t minBlockRequestPeriodMS)
Parameters
N/AminBlockRequestPeriodMS

Definition at line 106 of file app/framework/plugin/ota-server-policy/ota-server-policy.h