Chinaunix首页 | 论坛 | 博客
  • 博客访问: 210405
  • 博文数量: 145
  • 博客积分: 3000
  • 博客等级: 中校
  • 技术积分: 1720
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-14 18:42
文章分类

全部博文(145)

文章存档

2011年(1)

2009年(144)

我的朋友

分类: LINUX

2009-07-23 15:10:26

by tangke 2009-07-23

1.lshal |grep backlight
udi = '/org/freedesktop/Hal/devices/computer_backlight'
  info.addons = {'hald-addon-generic-backlight'} (string list)
  info.subsystem = 'backlight'  (string)
  info.udi = '/org/freedesktop/Hal/devices/computer_backlight'  (string)
  linux.subsystem = 'backlight'  (string)
  linux.sysfs_path = '/sys/devices/virtual/backlight/asus-laptop'  (string)

2.get the whole information of '/org/freedesktop/Hal/devices/computer_backlight'

udi = '/org/freedesktop/Hal/devices/computer_backlight'
  info.addons = {'hald-addon-generic-backlight'} (string list)
  info.capabilities = {'laptop_panel'} (string list)
  info.category = 'laptop_panel'  (string)
  info.interfaces = {'org.freedesktop.Hal.Device.LaptopPanel'} (string list)
  info.parent = '/org/freedesktop/Hal/devices/computer'  (string)
  info.product = 'Generic Backlight Device'  (string)
  info.subsystem = 'backlight'  (string)
  info.udi = '/org/freedesktop/Hal/devices/computer_backlight'  (string)
  laptop_panel.access_method = 'general'  (string)
  laptop_panel.num_levels = 16  (0x10)  (int)
  linux.hotplug_type = 2  (0x2)  (int)
  linux.subsystem = 'backlight'  (string)
  linux.sysfs_path = '/sys/devices/virtual/backlight/asus-laptop'  (string)

3./usr/share/hal/fdi/policy/10osvendor/10-laptop-panel-mgmt-policy.fdi





 
   
     
     
   
   
      hald-addon-generic-backlight
   

   
   
          org.freedesktop.Hal.Device.LaptopPanel

          SetBrightness
          i
          brightness_value
          hal-system-lcd-set-brightness

          GetBrightness
         
         
      hal-system-lcd-get-brightness
       

     

   

 



可以发现LaptopPanel的建立是在这里建立的,当hal检测到从udev发过来的信息知道有devices插入之后,并且已经处理完preprobe和information目录的内容之后才开始执行这个文件.

4.将 hald-addon-generic-backlight屏蔽掉,看了一些hal的source code hald/linux/addon/hald-addon-generic-backlight.c代码,发现它就是实现了SetBrightness和GetBrightness的两个接口。这两个接口就是实现了往/sys/devices/virtual/asus_laptop/brightness里面写数据和读书据。

5.我将这段代码屏蔽掉,然后重新启动,发现通过kpowersave里面的brightness adjust已经不起作用了,因为dbus-send已经不起作用了,因为接口已经没有了,但是我直接绕过SetBrightness和GetBrightness直接往/sys/devices/virtual/asus_laptop/brightness里面写数据或者读数据都是可以的。

echo 10 > /sys/devices/virtual/asus_laptop/brightness

cat /sys/devices/virtual/asus_laptop/brightness

以前的做法是
dbus-send --system --type=method_call --dest=org.freedesktop.Hal /org/freedesktop/Hal/devices/computer_backlight org.freedesktop.Hal.Device.LaptopPanel.SetBrightness int32:$1

dbus-send --system --print-reply --type=method_call --dest=org.freedesktop.Hal /org/freedesktop/Hal/devices/computer_backlight org.freedesktop.Hal.Device.LaptopPanel.GetBrightness

参考文档:



%22Cannot-get-laptop-panel-brightness%22-td10237351.html


阅读(357) | 评论(0) | 转发(0) |
0

上一篇:hal and dbus

下一篇:hal-device commands

给主人留下些什么吧!~~