Comments (2)
Yes, it should be straightforward to implement.
In the block of std::thread worker
, before calling
Download(workflowId, updateType, info) {
it would first make call to your approval service as per its client/server protocol. For example, it could have long-lived keep-alive connection and block to wait for response, or poll over an interval of time and give up after max time (30 days)
, etc.
If the approval is denied, then download worker thread will need to set ADUC_Result result
to an failure ResultCode and a reasonable ExtendedResultCode. e.g.
#define E_APPROVAL_DENIED <some 32-bit number>
{
-1,
E_APPROVAL_DENIED
}
It needs to continue calling WorkCompletionCallback
so that the state machine can continue it transition to the next state. e.g.
workCompletionData->WorkCompletionCallback(workCompletionData->WorkCompletionToken, result);
What this means for PP Agent is it will send the failure to the cloud for Download UpdateAction and it will show as failed and twin will have extended result code.
For PPR Agent, it will similarly show the entire deployment as failed and twin data will also contain the extended result code.
Exiting early and not transitioning to a final success/fail state and then to Idle will make backend not about device status. For PPR, it will show as in-progress indefinitely and there is no timeout for deployment. It is clearer to allow it to transition to final state so it will show success/failure in portal UX and service operator can see the reason (Approval was denied in this case).
If approved, it would just continue on with the Download()
call (and also call WorkCompletionCallback with result of download).
from iot-hub-device-update.
@jw-msft
I have successfully changed the agent with above requirement and its working fine.
Basically i found out the place where code bypass to my customized block of code that do some action and once action fullfilled , i resume agent code by calling same function that should be called in normal flow.
function name is adu_handleaction()
.
from iot-hub-device-update.
Related Issues (20)
- Cannot Install device update agent 1.0.3 beta version for Debian11 Arm64 on Debian 11.8 running on Raspberry Pi 4 HOT 1
- Configuration file deviceupdate-agent.service is marked executable HOT 7
- Yocto Rpi3 Device is restarting again and again in a loop HOT 2
- Failed parse of JSON file in Rpi4 device HOT 6
- /usr/bin/adu-swupdate.sh never runs (swupdate:2 never used even when registered?) HOT 7
- The packages deployed through device update are not reflecting in the device hosted on ubuntu 22.04 HOT 2
- Ignore duplicate deployment workflow not working as expected HOT 4
- Device reporting new Contract Name & ContractId after device update and stays inProgress in ADU HOT 9
- A/B Update Erases ADU Configuration on Yocto Kirkstone Raspberry Pi 4 - 64 bit Example HOT 2
- A/B Update Fails on Yocto Kirkstone Raspberry Pi 4 - 64 bit Example do to invalid update image HOT 2
- Device update agent on bullseye 11 raspberry zero HOT 4
- pthread_mutex_unlock doesn't check whether arguments is NULL for windows, this may cause dos HOT 3
- DeviceManagementClient.GetDeviceModuleAsync does not return the ExtendedResultCode HOT 3
- Update status changes to "In Progress" sometime after "Succeeded". HOT 10
- AducIotAgent cannot find custom step handler HOT 5
- ADUC_Result_Install_RequiredReboot stills reboots immediately after HOT 4
- Seeking Documentation on Retry Behavior HOT 1
- Is_Installed Step runs multiple times in swupdatev2 handler HOT 3
- Registering extensions fails on arm32 due to bug in STRING_construct_sprintf() invocation
- Unable to use additional compatibility information HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iot-hub-device-update.