Rate Limit Policy API
The Rate Limit Policy API allows you to limit the rate of the OTA upgrades by defining the upgrade interval and upgrade delay. The rate limit policy can be created in two ways, either by defining the upgrade delay and upgrade speed like below:
RateLimitPolicyBuilder builder = new RateLimitPolicyBuilder();
builder.setOtaUpgradeDelay(Duration.ofSeconds(0));
//upgrade speed should be between 0 % (min speed) to 100 % (max speed)
builder.setOtaUpgradeSpeed(100);
RateLimitPolicy policy = builder.create();
Or by defining the upgrade delay and upgrade interval like below:
RateLimitPolicyBuilder builder = new RateLimitPolicyBuilder();
builder.setOtaUpgradeDelay(Duration.ofSeconds(0));
//upgrade interval should be between 0 millisecond (max speed) to 65534 millisecond (min speed)
builder.setOtaUpgradeInterval(Duration.ofMillis(1));
RateLimitPolicy policy = builder.create();
In order to create a rate limit policy, both upgrade delay and upgrade speed or upgrade delay and upgrade interval must be defined.
Under the hood, upgrade speed gets converted to its corresponding upgrade interval.
Once the rate limit policy object is created, it can be applied using the setRateLimitPolicy method, in the InternalOtaHandler class, before or after an upgrade is started. So either doing the following:
Gateway gw = ...
Device device = ...
gw.getInternalOtaHandler().setRateLimitPolicy(device, policy);
device.startOtaUpgrade();
or:
Rate limit policy can be reset to default by applying the resetRateRateLimitPolicy method like below. This will apply a upgradeDelay of 0 seconds and upgradeInterval of 1 millisecond.
The OTA upgrade can also be paused mid upgrade using the pauseOtaUpgrade method like below:
The OTA upgrade that was paused can be unpaused using the unpauseOtaUpgrade method like below:
Triggering unpause on a paused upgrade does not take place immediately; it can take up to 15 seconds for it to unpause. This is because the device is set to poll the gateway every 15 seconds when paused.
Legal Notices
Copyright © 2020 MMB Networks, Inc. All rights reserved.
Confidential materials prepared and delivered by MMB Networks for receipt and review only by any partner subject to a valid and enforceable MMB Networks confidentiality agreement. Any receipt, review, or misuse of any of the content exchanged hereunder by any party not a party to this confidential exchange shall be subject to any and all rights available under the law. All rights, title and interest to the materials shall remain with MMB Networks.
Any suggestions provided to MMB Networks with respect to MMB Networks' products or services shall be collectively deemed “Feedback.” You, on behalf of yourself, or if you are providing Feedback on behalf of your employer or another entity, represent and warrant that you have full legal authority to bind such entity to these terms, agree to grant and hereby grant to MMB Networks a nonexclusive, perpetual, irrevocable, royalty free, worldwide license to use and otherwise exploit such Feedback within any MMB Networks products and services.