управление внешними индикаторами на ноутах asus

Обсуждение программ nnCron и nnCron LITE

управление внешними индикаторами на ноутах asus

Postby buzz » Wed, 10 May 2006, 11:27

четыре слова MAIL-LED-ON, MAIL-LED-OFF, WIFI-LED-ON, WIFI-LED-OFF включают/выключают индикатор новой почты и WiFi. Тестировалось на модели Asus A2S, но должны работать и на других.
Code: Select all
WINAPI: DeviceIoControl KERNEL32.DLL
WINAPI: CreateFileA KERNEL32.DLL
0x80000000 CONSTANT GENERIC_READ
0x40000000 CONSTANT GENERIC_WRITE
0x00000080 CONSTANT FILE_ATTRIBUTE_NORMAL

3 CONSTANT OPEN_EXISTING

0x44454C4D CONSTANT MLED
0x44454C54 CONSTANT TLED
0x44454C57 CONSTANT WLED
0x44454C00 CONSTANT LED

VARIABLE bytes 0 bytes !
VARIABLE ret
VARIABLE onoff 1 onoff !
VARIABLE led MLED led !

USER-VALUE ATKACPIhdl 0 TO ATKACPIhdl

CREATE outbuf 768 ALLOT

0
1 CELLS -- cmds
1 CELLS -- cm2
CONSTANT cbuf

CREATE inbuf 20 ALLOT

: LED-CTRL ( onoff led -- )
  led !
  onoff !
  cbuf ALLOCATE THROW >R
  0 R@ cmds W!
  4 R@ cmds 2 + W!
  onoff @ R@ cm2 !
   
  \ fill inbuf
  2 inbuf !
  led @ inbuf 1 CELLS + !
  1 inbuf 2 CELLS + !
  8 inbuf 3 CELLS + !
  R@ inbuf 4 CELLS + !
 
  RDROP

  0 FILE_ATTRIBUTE_NORMAL OPEN_EXISTING 0 0 GENERIC_WRITE
  S" \\.\ATKACPI" DROP CreateFileA DUP TO ATKACPIhdl
   
  INVALID_HANDLE_VALUE <> IF
    0 bytes 768 outbuf 20 inbuf 0x222404 ATKACPIhdl DeviceIoControl ret !
    \ return 1 only for WLED
  THEN
 
  ATKACPIhdl CloseHandle DROP
;

: MAIL-LED-ON
  0 MLED LED-CTRL
;

: MAIL-LED-OFF
  1 MLED LED-CTRL
;

: WIFI-LED-ON
  1 WLED LED-CTRL
;

: WIFI-LED-OFF
  0 WLED LED-CTRL
;
buzz
 

Return to nnCron forum (Russian)

Who is online

Users browsing this forum: No registered users and 2 guests