> Kishen, > Can we do a similar thing for IOTivity-Lite? Yes. The existing oc_obt_device_hard_reset() API lets OBTs reset devices they own. But there isn’t an API to let devices reset themselves. That can be easily added.
Thanks, -Kishen. - Kishen Maloor Intel Open Source Technology Center From: <iotivity-dev@lists.iotivity.org<mailto:iotivity-dev@lists.iotivity.org>> on behalf of Wouter van der Beek <wovan...@cisco.com<mailto:wovan...@cisco.com>> Date: Thursday, May 10, 2018 at 9:02 PM To: Rami Alshafi <rami_in_portl...@hotmail.com<mailto:rami_in_portl...@hotmail.com>>, "Nash, George" <george.n...@intel.com<mailto:george.n...@intel.com>>, "Heldt-Sheller, Nathan" <nathan.heldt-shel...@intel.com<mailto:nathan.heldt-shel...@intel.com>>, iotivity-dev <iotivity-dev@lists.iotivity.org<mailto:iotivity-dev@lists.iotivity.org>> Subject: Re: [dev] Setting device to "ready for OTM state" Hi George, Can we add this mechanism to code that is being created by DeviceBuilder? Kishen, Can we do a similar thing for IOTivity-Lite? Kind Regards, Wouter From: iotivity-dev@lists.iotivity.org<mailto:iotivity-dev@lists.iotivity.org> [mailto:iotivity-dev@lists.iotivity.org] On Behalf Of Rami Alshafi Sent: 11 May 2018 02:23 To: Nash, George <george.n...@intel.com<mailto:george.n...@intel.com>>; Heldt-Sheller, Nathan <nathan.heldt-shel...@intel.com<mailto:nathan.heldt-shel...@intel.com>>; iotivity-dev <iotivity-dev@lists.iotivity.org<mailto:iotivity-dev@lists.iotivity.org>> Subject: Re: [dev] Setting device to "ready for OTM state" George, That is very interesting! The way I have been doing it is by killing the server app and recovering the cbor file manually. I just implemented this API and set it up with the SIGQUIT so when I press Ctrl+/ it would call the OCResetSVRDB() API and it seems to work! I have included the decoded cbor files that I captured in the following testing. 1- converted the initial RFOTM json to cbor and it is brand new untouched then converted it back to json (RFOTM_new.json) 2- launched the server application and then killed it right away and you can see a new section was added which is the "resetpf" (RFOTM_init.json) 3- launched the server application again and then pressed Ctrl+/ to call the OCResetSVRDB() and then killed the server app. (RFOTM_reset.json). Here there is no difference but the API actually did the reset successfully even though there is no difference at all when comparing with RFOTM_init.json as the resetpf section is already identical to the rest of the SVR database. 4- Next I launched the server again and ran the "CT1.1.1 CoAP-Based Resource Discover" test in CTT against the server and then killed the server and you can see the CTT has onboarded the server app successfully (RFOTM_CTT.json). There are 3 additional aces in the acl and the cred section is added and the doxm and pstat sections have been updated accordingly to be in the RFNOP state along with all the resource owners that used to be nil now set to the uuid of the CTT. 5- Next, I launched the server application and killed it right away and that did not cause anything (RFOTM_post_CTT.json) 6- Finally, the most interesting part!!!, launched the server and pressed Ctrl+/ to call the OCRestSVRDB() API and then killed the server and it was reset to match RFOTM_init.json successfully. (RFOTM_post_CTT_reset.json). I think I will finalize this implementation and push it to gerrit in my sample application whenever the current commit is merged to master. Thanks, -Rami ________________________________ From:iotivity-dev-boun...@lists.iotivity.org<mailto:iotivity-dev-boun...@lists.iotivity.org> <iotivity-dev-boun...@lists.iotivity.org<mailto:iotivity-dev-boun...@lists.iotivity.org>> on behalf of Nash, George <george.n...@intel.com<mailto:george.n...@intel.com>> Sent: Tuesday, March 6, 2018 11:26:51 AM To: Heldt-Sheller, Nathan; iotivity-dev Subject: Re: [dev] Setting device to "ready for OTM state" Thank you, with that information I was finally able to run through all of the security tests. I have some failures but I am investigating them. I did find the function OCResetSVRDB. Using code inspection, I was unable to tell if this puts the device in the OTM state. I did hear from another developer that this worked for them. Can anyone confirm if this function will put the device into the Ready-for-OTM state? George From: Heldt-Sheller, Nathan Sent: Monday, March 5, 2018 10:15 PM To: Nash, George <george.n...@intel.com<mailto:george.n...@intel.com>>; iotivity-dev <iotivity-dev@lists.iotivity.org<mailto:iotivity-dev@lists.iotivity.org>> Subject: RE: Setting device to "ready for OTM state" When testing CTT with IoTivity sample apps I’ve always just killed the Server, replaced the .dat file and restarted the Server. Thanks, Nathan From: iotivity-dev-boun...@lists.iotivity.org<mailto:iotivity-dev-boun...@lists.iotivity.org> [mailto:iotivity-dev-boun...@lists.iotivity.org] On Behalf Of Nash, George Sent: Monday, March 5, 2018 4:18 PM To: iotivity-dev <iotivity-dev@lists.iotivity.org<mailto:iotivity-dev@lists.iotivity.org>> Subject: [dev] Setting device to "ready for OTM state" I have some code that I am running through the OFC Certification and Testing Tool. I am currently working on the security tests. When running the tests it will ask me multiple times to ‘Please initiat device to “ready for OTM” state’. The OCF Security Specification v1.3.0 section 8.2 has a list of values for the Device Ready-for-OTM State Definition. These include setting the owned property to FALSE and setting a lot of UUIDs to the nil UUID. I could replace the security.dat file with the security.dat file before any of the unit tests ran but I don’t know if that is what is expected. How have other developers handled putting the device into the “ready for OTM”? Do you have a reset method that changes the values in the security.dat file? George Nash