LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
楼主: bjsm

蓝牙G5键盘的问题 若无人能帮忙,每日一顶。

[复制链接]
 楼主| 发表于 2009-5-21 10:46:47 | 显示全部楼层
dbus-python没这个软件




怎么办?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-21 11:02:01 | 显示全部楼层
我是UNSTABLE
回复 支持 反对

使用道具 举报

发表于 2009-5-21 11:25:24 | 显示全部楼层
dbus-python 在extra仓库里面
blue-python 在aur仓库上面
  1. $ yaourt -Ss dbus-python
  2. extra/dbus-python 0.83.0-2 [installed]
  3.      Python bindings for DBUS
  4. aur/bluez-python 0.1.4-1 (13)
  5.     A BlueZ python binding on top of dbus-python
复制代码
回复 支持 反对

使用道具 举报

发表于 2009-5-21 12:35:10 | 显示全部楼层
google "dbus-python debian"得到结果如下
http://packages.debian.org/sid/python/python-dbus
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-21 16:25:18 | 显示全部楼层
python-dbus=dbus-python?
luyi@debian:~/Desktop/bluez-python$ python bluekey.py 00:0A:95:43:B5:53
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.5/dbus/connection.py", line 581, in msg_reply_handler
    *message.get_args_list()))
  File "/home/luyi/Desktop/bluez-python/bluez/Adapter.py", line 101, in error_handler_wrapper
    error_handler(exception)
  File "bluekey.py", line 14, in reply_error
    raise error
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

失败。
回复 支持 反对

使用道具 举报

发表于 2009-5-21 16:40:35 | 显示全部楼层
try this then
  1. #!/usr/bin/env python
  2. import bluez
  3. import gobject
  4. import sys

  5. manager = bluez.Manager('gobject')
  6. adapter = manager.DefaultAdapter()
  7. try:
  8.     device = adapter.FindDevice(sys.argv[1])
  9. except:
  10.     device = adapter.CreateDevice(sys.argv[1])
  11. for interface in device.ListServiceInterfaces():
  12.     if interface.GetInterfaceName() == 'org.bluez.Input':
  13.         interface.Connect()
复制代码

用法和上面那个一样
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-21 18:24:01 | 显示全部楼层
luyi@debian:~/Desktop/bluez-python$ python bluekey2.py 00:0A:95:43:B5:53
Traceback (most recent call last):
  File "bluekey2.py", line 10, in <module>
    except DBusDoesNotExistError:
NameError: name 'DBusDoesNotExistError' is not defined
回复 支持 反对

使用道具 举报

发表于 2009-5-21 19:59:56 | 显示全部楼层
不好意思 修改了一下现在应该好了 我手头上现在没有输入设备 我记得以前用过的那个蓝牙鼠标, 要按一下connect按钮才会被发现 键盘是不是有相似的东西呢
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-21 21:41:26 | 显示全部楼层
luyi@debian:~/Desktop/bluez-python$ python bluekey2.py
  File "bluekey2.py", line 1
    mport bluez
              ^
SyntaxError: invalid syntax



键盘上就一个开关,这是蓝牙,不是无线的,无需对码。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-21 21:47:35 | 显示全部楼层
luyi@debian:~/Desktop/bluez-python$ python bluekey2.py
  File "bluekey2.py", line 1
    mport bluez
              ^
SyntaxError: invalid syntax



键盘上就一个开关,这是蓝牙,不是无线的,无需对码。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表