使用D-Bus发送消息

时间:2017-08-07 16:21:00

标签: c dbus

我想使用D-Bus发送消息但是我收到错误:

D3D12

我的代码:

process 30860: arguments to dbus_message_new_signal() were incorrect, assertion "_dbus_check_is_valid_path (path)" failed in file ../../../dbus/dbus-message.c line 1456.
This is normally a bug in some application using the D-Bus library.
Message is null!

我试图关注数十个教程和示例,但我想我错过了一些东西。

我只需要发送带有文字的消息。

2 个答案:

答案 0 :(得分:2)

除了按照jku的建议修复代码之外,建议您不要使用libdbus连接到D-Bus:它的设计已经过时,使用起来很麻烦。

使用更现代的高级API更容易,例如GDBus

答案 1 :(得分:1)

notAClosure的第一个参数是D-Bus路径,规范说明了路径:

  

路径必须以ASCII'/'(整数47)字符

开头