Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About the function to delete and recreate OCF Device programmatically #589

Open
Askidea opened this issue Jan 11, 2024 · 3 comments
Open

Comments

@Askidea
Copy link
Collaborator

Askidea commented Jan 11, 2024

@jkralik @Danielius1922

I'm trying to integrate bridge functionality into iotivity-lite. However, the latest library does not seem to support the ability to dynamically delete and recreate OCF Devices.

As an example, I created an 5 devices, or OCF Client, OCF Bridge and three VODs (Virtual OCF Device) in one android app. Then, when I deleted VOD#1 and tried to create it again, an error occurred and the app crashed.
When I looked at the files/credentials directory of the app package with Android Studio's Device Explorer, I confirmed that u_ids_0~4 (also ael, cred, pstat, ... etc) were created. VOD#1 corresponds to u_ids_2.

In the case of ZigBee VOD, VOD must be dynamically created or deleted during the process of connecting and resetting the ZigBee device. Of course, it is required to manage the VOD index well, but first, I wonder if there will be any problems when dynamically deleting and re-creating the OCF Device (or VOD) in the latest iotivity-lite library.

Can anyone answer this issue?

@joochlee
Copy link
Collaborator

joochlee commented Jan 11, 2024

which iotivity-lite version are you using? current latest iotivity-lite does not include bridge support yet.

@Askidea
Copy link
Collaborator Author

Askidea commented Jan 12, 2024

@joochlee
Based on the recent iotivity-lite (commit fc89bd6), I am working on merging some of the ocfbridging branch's bridge-related source code and our Zigbee library into the iotivity source code.
The point I want to know is whether the current iotivity-lite library supports the case of programmatically deleting and recreating a device. Looking at the source, I see that the OcPlaform class has an addDevice() member function but no removeDevice(), so I am wondering if it is not supported.
My guess is that the current iotivity library only allows adding devices in InitHandler and does not consider deleting them later. If so, it seems that it will also affect the VOD create/delete function.

@joochlee
Copy link
Collaborator

ocfbridging is tool old branch. Currently I'm trying to merge new bridging support code to iotivity-lite stack, but it does not include Android API supports..
Another API is required to add and delete VODs dynamically. So current latest iotivity-lite stack only provides the way to add OCF Device(s) statically in InitHandler as you said.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants