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

[Dbus] Set and GetAll methods throwing Error io.openthread.Error.NotFound: io.openthread.Error.NotFound error #2133

Open
gadekula1 opened this issue Dec 14, 2023 · 4 comments

Comments

@gadekula1
Copy link

Dbus set and GetAll methods throwing error.

Details:

DBUS_PROPERTY_SET_METHOD "Set"
DBUS_PROPERTY_GET_ALL_METHOD "GetAll"

Introspect for GetAll:

dbus-send command :
dbus-send --system --print-reply --dest=io.openthread.BorderRouter.wpan0 /io/openthread/BorderRouter/wpan0 org.free
desktop.DBus.Properties.GetAll string:"io.openthread.BorderRouter"
Error io.openthread.Error.NotFound: io.openthread.Error.NotFound

dbus-send --system --print-reply --dest=io.openthread.BorderRouter.wpan0 /io/openthread/BorderRouter/wpan0 org.free
desktop.DBus.Properties.GetAll string:io.openthread.BorderRouter
Error io.openthread.Error.NotFound: io.openthread.Error.NotFound

Introspect for set method:

dbus-send command

dbus-send --system --print-reply --dest=io.openthread.BorderRouter.wpan0 /io/openthread/BorderRouter/wpan0 org.free
desktop.DBus.Properties.Set string:io.openthread.BorderRouter string:RadioRegion variant:string:"1234"
Error io.openthread.Error.InvalidArgs: io.openthread.Error.InvalidArgs

dbus-send --system --print-reply --dest=io.openthread.BorderRouter.wpan0 /io/openthread/BorderRouter/wpan0 org.free
desktop.DBus.Properties.Set string:io.openthread.BorderRouter string:"RadioRegion" variant:string:"1234"
Error io.openthread.Error.InvalidArgs: io.openthread.Error.InvalidArgs

@superwhd
Copy link
Contributor

superwhd commented Dec 22, 2023

I think your Set method failed because you didn't pass in a valid region code. Below command works for me.

dbus-send --system --print-reply --dest=io.openthread.BorderRouter.wpan0 /io/openthread/BorderRouter/wpan0 org.freedesktop.DBus.Properties.Set string:"io.openthread.BorderRouter" string:"RadioRegion" variant:string:"US"

@superwhd
Copy link
Contributor

superwhd commented Dec 22, 2023

For the GetAll method, it failed due to an error when getting one of the unimplemented properties. When a feature is disabled at build time, its 'GetPropertyHandler' is still registered but it throws an OT_NOT_IMPLEMENTED error which results in the failure of GetAll.

@morningboata Shall we let GetAll tolerate OT_NOT_IMPLEMENTED error? See

SuccessOrExit(error = p.second(dictEntryIter));

@morningboata
Copy link
Contributor

It seems that once the compile time flag is defined, the runtime behavior is well-defined, so that we can fix the property's compile time registration issue instead of tolerate runtime OT_NOT_IMPLEMENTED error? That is:

  1. print detail property name (p.first) and 'not implemented' error around

SuccessOrExit(error = p.second(dictEntryIter));

  1. fix the error by stopping the property's registration if it is not available, similar to https://github.com/openthread/ot-br-posix/blob/main/src/dbus/server/dbus_thread_object.cpp#L209C3-L209C3

How do you think?

@superwhd
Copy link
Contributor

Either one seems good to be. The first approach seems simpler to implement because it's feature-agnostic.

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

3 participants