- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我已经创建了一个自定义的 d-bus 服务,它似乎已注册并且可以通过 dbus 调用激活,但是它没有接口(interface)定义并且不能通过 d-feet 等工具进行自省(introspection)。
我正在尝试弄清楚如何做到这一点,我已经创建了以下接口(interface)文件:
<!DOCTYPE node PUBLIC
"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd" >
<node xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
<interface name="com.me.test.Manager">
<method name="Start">
<arg name="name" direction="in" type="s">
<doc:doc><doc:summary>Name of new contact</doc:summary></doc:doc>
</arg>
<arg name="email" direction="in" type="s">
<doc:doc><doc:summary>E-mail address of new contact</doc:summary></doc:doc>
</arg>
<arg name="id" direction="out" type="u">
<doc:doc><doc:summary>ID of newly added contact</doc:summary></doc:doc>
</arg>
<doc:doc>
<doc:description>
<doc:para>
Adds a new contact to the address book with their name and
e-mail address.
</doc:para>
</doc:description>
</doc:doc>
</method>
</interface>
</node>
我将文件命名为:
/usr/share/dbus-1/interfaces/com.me.test.Manager.xml
但是,当我使用 d-feet 浏览器搜索“com.me.test”时,我仍然没有在 session 总线上看到任何对象。这个接口(interface)实际上是如何被dbus注册的,dbus是否监控这个目录?我试过重新启动 dbus,但没有帮助
最佳答案
您的服务需要调用org.freedesktop.DBus.RequestName在特定名称下可见,然后回复 org.freedesktop.DBus.Introspectable.Introspect要求
这是我如何在我的 dbus 库中实现它的示例 - https://github.com/sidorares/node-dbus/blob/master/lib/stdifaces.js#L24-L92
关于c++ - 如何定义一个可以自省(introspection)的新 d-bus 接口(interface)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31815101/
尝试发布到 introspect 方法会引发错误的请求错误: "Bad request. Accept and/or Content-Type headers likely do not match
我想对我使用或过度使用的常用技术进行现代化改造。它静态检查方法签名并调用方法(如果存在)。我的方法比 C++17 早了一段时间 FWIW。 目前,我使用了 Boost 的 Type 特征,例如 BOO
java.beans.Introspector#getBeanInfo 将 getter 返回类型更改为 com.google.common.base.Optional 时,编译不完整的 Proper
我正在将一些“旧的”Swift 代码转换为 Swift 2.0,但我遇到了一个我无法摆脱的错误。 我的函数接收一个类型(任意)的数组,并返回一个相同类型的新数组。 此代码在 Swift 2.0 中不再
我想做的是从 SqlAlchemy 实体定义中获取所有 Column() 的内容,确定它们的类型和约束,以便能够预验证、转换数据并向用户显示自定义表单。 我如何反省它? 例子: class Perso
下面的代码是一个可以轻松重现问题的小示例。所以我有 String 类型的变量,在其上设置了默认值。我有 3 种方法: setter/getter 二传手 将字符串转换为 boolean 值的便捷方法
初级 JavaScript 问题。我有点被 Python 的 dir 内置函数宠坏了。我想发现 node.js REPL 中任何对象的属性/方法。我已经看过this question ;在空数组 []
当我使用自省(introspection)时,我的类、方法和属性名称以纯文本形式编写。就像在这个简短的演示中一样: import java.lang.reflect.Constructor; impo
我正在编写一个通用方法,该方法复制具有公共(public)字段的两种不同类型的 bean。我正在使用内省(introspection)来获取写入和读取方法,例如 propertyDescriptor1
C++ 中是否有像 python 中那样的内省(introspection)技术? 例如:我想获得有关特定对象的更多信息,而无需通过头文件或返回引用 cpp 引用。 我是在问一个正确的问题,还是走错了
我有一个函数: # utils.py def hello(name='World'): # Detect where I'm being called from. print('Hi,
我正在编写一个小的 sqlalchemy shim 以通过一些轻量级数据转换从 MySQL 数据库中导出数据——主要是更改字段名称。我当前的脚本工作正常,但需要我基本上描述我的模型两次——一次在类声明
是否有办法确定实例最初绑定(bind)到的变量? 使用函数我们可以做到这一点: def f(): pass print f.__name__ >> f g = f print g.__name
我正在为使用内省(introspection)的代码块编写单元测试;具体来说,它在我想要模拟的类上调用 getDeclaredField() 并尝试获取该字段的值。有没有办法用 Mockito 来模拟
如何在 gdbus 自省(introspection) xml 中传递多个完整类型。例子, 当我尝试这种格式时,我得到的错误是 Error org.fr
A 类型的对象以及是否有一种方法可以通过编程方式包装类对象? 给定 class A(object): def __init__(self): ## .. def f0(
我有一个需要来自测试函数的变量的 fixture 。如果函数级别的自省(introspection)有效,那么使用自省(introspection)并在函数命名空间/上下文中声明变量应该有效,就像在模
当我尝试使用内省(introspection)来查看 threading.Lock 上可用的方法时,我没有看到我期望的结果。 具体来说,我没有看到获取、释放或锁定。这是为什么? 这是我所看到的: >>
我刚刚在一个项目中发现一些测试方法没有所需的“test_”前缀来确保它们实际运行。应该可以通过一些 linting 来避免这种情况: 在代码库中查找所有 TestCase 断言调用。 在调用层次结构中
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 1
我是一名优秀的程序员,十分优秀!