Change the device provisioning status

1 minute read
Edit on GitHub

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 nameValueNotes
Reset0Factory reset - device will change state after that to RFOTM
Ready for Device owner transfer method (RFOTM)1Device is ready to be owned
Ready for Device provisioning (RFPRO)2Update some properties in secure resources by resource owner and owner
Ready for Device normal operation (RFNOP)3Device is ready to be used
The Device is in a soft reset (SRESET)4Update properties secure resources by owner
Note

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.

SOURCE Copy
Copied
        {
  "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.

SOURCE Copy
Copied
        {
  "dos": {
    "s": 3
  }
}
    
May 13, 2021

Get started

plgd makes it simpler to build a successful IoT initiative – to create a proof of concept, evaluate, optimize, and scale.

Get Started Illustration Get Started Illustration