From my experiment, I’ve used OcPlatform.setDeviceId(getBytesFromUUID(UUID.fromString("AA323232-BB32-CC32-3232-DD3232323232"))); to a device with SVRs database "deviceuuid": "32323232-3232-3232-3232-323232323232" successfully. And OcPlatform.getDeviceId() ==> (AA 32 32 32 BB 32 CC 32 32 32 DD 32 32 32 32 32) OK
But the next time, OcPlatform.setDeviceId() are not allowed to change "AA323232-BB32-CC32-3232-DD3232323232" back to "32323232-3232-3232-3232-323232323232" Because of: E/OIC_SRM_DOXM: This device owned by owner's device. E/OIC_SRM_DOXM: Device UUID cannot be changed to guarantee the reliability of the connection. W/OIC_SRM_DOXM: SetDoxmDeviceID: cannot set doxm: owner and rowner uuid, revert D/OIC_SRM_DOXM: SetDoxmDeviceID OUT Maybe this method should be deprecated for safety. From: iotivity-dev-boun...@lists.iotivity.org [mailto:iotivity-dev-boun...@lists.iotivity.org] On Behalf Of ka ka Sent: Thursday, February 08, 2018 4:20 PM To: Max Kholmyansky; iotivity-dev@lists.iotivity.org Subject: Re: [dev] Android, failed to set device ID Thank you for your kind comments. As I mentioned, I think, IoTIvity supports the function for changing the ID using OcPlatform.setDeviceId. Regards On Thu, Feb 8, 2018 at 5:08 PM, Max Kholmyansky <max...@gmail.com<mailto:max...@gmail.com>> wrote: Hello To my best knowledge, there is no way to set the device ID programmatically. The way it works - is to change the "deviceuuid" value in "doxm" section of the security settings file loaded upon platform initialization. In the server samples, look at file named oic_svr_db_server.json (JSON format) and oic_svr_db_server.dat (samme file encoded to CBOR, this one is actually used by the API). Regards Max On Thu, Feb 8, 2018 at 3:51 AM, ka ka <kaka120...@gmail.com<mailto:kaka120...@gmail.com>> wrote: Hello, IoTivity developers, I am working on an Android based IoTivity project. I need to fix the device ID of IoTivity platform. I used OcPlatform.setDeviceId to set the device ID, but it shows runtime error (UUID length, format are OK). is there some other solution? Regards ==================== Wenquan Jin (김문권) Jeju Natl. Univ. Jeju 690-756 REPUBLIC OF KOREA Phone: +82 (0)10 2983 0958 ==================== _______________________________________________ iotivity-dev mailing list iotivity-dev@lists.iotivity.org<mailto:iotivity-dev@lists.iotivity.org> https://lists.iotivity.org/mailman/listinfo/iotivity-dev -- ==================== Wenquan Jin (김문권) Jeju Natl. Univ. Jeju 690-756 REPUBLIC OF KOREA Phone: +82 (0)10 2983 0958 ====================
_______________________________________________ iotivity-dev mailing list iotivity-dev@lists.iotivity.org https://lists.iotivity.org/mailman/listinfo/iotivity-dev