如何正确调用PushMessage bluez / obex方法通过蓝牙发送SMS

时间:2018-11-09 07:53:45

标签: bluetooth sms bluez obex

我在使用bluez / obex发送SMS消息时遇到问题。

我正在尝试从消息访问配置文件中实现所有方法,并且成功实现了除一个方法之外的所有方法。

我无法使方法“ object,dict PushMessage(字符串源文件,字符串文件夹,dict args)”正常工作。

源文件(/tmp/msgzaGehyhi.bmf)的内容为:

BEGIN:BMSG
VERSION:1.0
STATUS:UNREAD
TYPE:SMS_GSM
FOLDER:TELECOM/MSG/OUTBOX
BEGIN:BENV
BEGIN:VCARD
VERSION:2.1
N:John Smith
TEL:+385917512224
END:VCARD
BEGIN:BBODY
CHARSET:UTF-8
LENGTH:28
BEGIN:MSG
Fgghhh
END:MSG
END:BBODY
END:BENV
END:BMSG

参数文件夹设置为“发件箱”,但我也尝试了“ telecom / msg / outbox”。

参数args是一个空字典。

在调用PushMessage方法之前,我成功地调用了SetFolder(“ / telecom / msg”)方法,该方法可与ListMessages(“ inbox”,[])之类的调用一起使用。

调用PushMessage方法后,我接收到对象传输对象,该对象应该上载源文件,并且其初始状态已排队。

片刻之后,我从bluez收到的唯一消息是没有任何代码或错误文本的错误。

在PushMessage方法代码期间dbus-monitor的输出为

method call time=1541681140.634297 sender=:1.8 -> destination=org.bluez.obex serial=95 path=/org/bluez/obex/client/session5; interface=org.bluez.obex.MessageAccess1; member=PushMessage
   string "/tmp/msgALrukMqt.bmf"
   string "outbox"
   array [
   ]
signal time=1541681140.637403 sender=:1.3 -> destination=(null destination) serial=414 path=/; interface=org.freedesktop.DBus.ObjectManager; member=InterfacesAdded
   object path "/org/bluez/obex/client/session5/transfer49"
   array [
      dict entry(
         string "org.freedesktop.DBus.Introspectable"
         array [
         ]
      )
      dict entry(
         string "org.bluez.obex.Transfer1"
         array [
            dict entry(
               string "Status"
               variant                   string "queued"
            )
            dict entry(
               string "Name"
               variant                   string "outbox"
            )
            dict entry(
               string "Size"
               variant                   uint64 223
            )
            dict entry(
               string "Filename"
               variant                   string "/tmp/msgALrukMqt.bmf"
            )
            dict entry(
               string "Session"
               variant                   object path "/org/bluez/obex/client/session5"
            )
         ]
      )
      dict entry(
         string "org.freedesktop.DBus.Properties"
         array [
         ]
      )
   ]
method return time=1541681140.639362 sender=:1.3 -> destination=:1.8 serial=415 reply_serial=95
   object path "/org/bluez/obex/client/session5/transfer49"
   array [
      dict entry(
         string "Status"
         variant             string "queued"
      )
      dict entry(
         string "Name"
         variant             string "outbox"
      )
      dict entry(
         string "Size"
         variant             uint64 223
      )
      dict entry(
         string "Filename"
         variant             string "/tmp/msgALrukMqt.bmf"
      )
      dict entry(
         string "Session"
         variant             object path "/org/bluez/obex/client/session5"
      )
   ]
method call time=1541681140.643590 sender=:1.8 -> destination=org.freedesktop.DBus serial=96 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',sender='org.bluez.obex',path='/org/bluez/obex/client/session5/transfer49',interface='org.freedesktop.DBus.Properties',member='PropertiesChanged'"
method call time=1541681140.645212 sender=:1.8 -> destination=org.freedesktop.DBus serial=97 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RemoveMatch
   string "type='signal',sender='org.bluez.obex',path='/org/bluez/obex/client/session5/transfer49',interface='org.freedesktop.DBus.Properties',member='PropertiesChanged'"
signal time=1541681141.520368 sender=:1.3 -> destination=(null destination) serial=416 path=/org/bluez/obex/client/session5/transfer49; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
   string "org.bluez.obex.Transfer1"
   array [
      dict entry(
         string "Status"
         variant             string "error"
      )
   ]
   array [
   ]
signal time=1541681141.521765 sender=:1.3 -> destination=(null destination) serial=417 path=/; interface=org.freedesktop.DBus.ObjectManager; member=InterfacesRemoved
   object path "/org/bluez/obex/client/session5/transfer49"
   array [
      string "org.freedesktop.DBus.Properties"
      string "org.freedesktop.DBus.Introspectable"
      string "org.bluez.obex.Transfer1"
   ]
signal time=1541681166.502012 sender=org.freedesktop.DBus -> destination=:1.8 serial=5 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
   string ":1.8"

有人可以帮助我使其正常运行,或者至少给我一个示例源文件和适用于其计算机的参数。

感谢您的帮助

0 个答案:

没有答案