More about this topic you can find in OCF specification in section 8 Device Onboarding state definitions.
For update any secure device resource such at credentials/ACLs we need to change device from normal state to provisioning state. To get current state of device we can use GET
request on device provisioning status resource(/oic/sec/pstat). The property dos.s
is state of device.
State name | Value | Notes |
---|---|---|
Reset | 0 | Factory reset - device will change state after that to RFOTM |
Ready for Device owner transfer method (RFOTM) | 1 | Device is ready to be owned |
Ready for Device provisioning (RFPRO) | 2 | Update some properties in secure resources by resource owner and owner |
Ready for Device normal operation (RFNOP) | 3 | Device is ready to be used |
The Device is in a soft reset (SRESET) | 4 | Update properties secure resources by owner |
More about this topic you can find in OCF specification in section 8 Device Onboarding state definitions.
To change state of device we can use POST
request on device provisioning status resource we need to be a owner of the device or resource owner which is stored in rowneruuid
property.
{
"dos": {
"s": 2
}
}
After changing state of device we can update device secure sources such as credentials, ACLs, etc. After updating device secure sources we need to change state of device to normal operation.
{
"dos": {
"s": 3
}
}
plgd makes it simpler to build a successful IoT initiative – to create a proof of concept, evaluate, optimize, and scale.