Miranda notify

For you, my english speaking visitors, please read translation at the bottom of this page.

Tento plugin je pre uzivatelov laptopov ASUS (napr ja mam A6r). Niektore rady tychto pocitacov maju diodky ako notifikacia na prichadzajuci email, power state, battery state, wifi state. Diody wifi a mail notify sa daju softwarovo ovladat cez ACPI, a ja som zobral nejaky najjednoduchsi plugin do mirandy aky som len nasiel (FDD notify) a upravil som ho tak, aby prichodzia icq sprava rozblikala diodku priradenu na notifikaciu emailu. Pochybujem ze niekto normalny pouziva tu defaultnu utilitku, ktora aj tak funguje iba s outlook expressom, a takto sa aspon prakticky ta uzasna modra ledka vyuzije :)
Pre sikovneho programatora nebude problem upravit si plugin podla svojich predstav, prikladam cely projekt visual studia... samotne ovladanie acpi je v subore fdd.cpp, je to z toho dovodu ze povodny ucel tohoto pluginu ktory som upravil bol, ze notifikoval prichod ICQ spravy tym, ze zapinal a vypinal motor disketovej mechaniky..... :) A robil som to dost narychlo ako ja vsetko zvyknem :) ale hlavne ze to ide....
Pozor, na odporucanie niekoho kto sa mi ozval na ICQ, som pridal moznost prepnut notifikaciu na niektoru z asus-podporovanych led diod ( WLED - wifi, MLED - mail, TLED - netusim, LED - netusim), prepnut sa to da v konfiguracnom dialogu pluginu... Na stiahnutie stale ponechavam povodnu verziu aj novu (improved)... keby tam boli nahodou nejake chyby, ale to pochybujem.
Stiahnut: Miranda ACPI notify plugin
Stiahnut: Improved miranda ACPI notify plugin
Stiahnut: MirandaNotify.dll (improved version)

Pre nainstalovanie si stiahnite prilozeny subor MirandaNotify.rar, v adresari RELEASE je ulozeny subor fdd.dll a ten si nakopirujte do aresaru mirandinych pluginov (C:\Programs\Internet\Miranda\Plugins\fdd.dll), ma to len 64kb, a nijak to nevytazuje pocitac....

Tuto este prikladam velmi uzitocnu cast kodu na ovladanie ACPI notebookov asus :



ASUS ACPI control routine
// these numbers give more sense when converted to ascii
#define MLED 0x44454c4d
#define WLED 0x44454c57
#define TLED 0x44454c54
#define LED  0x44454c00 

HANDLE hAcpi = INVALID_HANDLE_VALUE;

int CtrlACPI(int code, int arg, int onoff)
{
  unsigned long bytes = 0;
  long inbuf[5];
  struct cmbuf {
    short cmds[2];
    long cm2;
  } cbuf;
  long outbuf[192];
  int ret;

  cbuf.cmds[0] = 0;
  cbuf.cmds[1] = 4;
  cbuf.cm2 = onoff;
  inbuf[0] = 2;
  inbuf[1] = code;
  inbuf[2] = arg;
  inbuf[3] = 8 * arg;
  inbuf[4] = (long)&cbuf;

  ret = DeviceIoControl(hAcpi, 0x222404, inbuf, 
    sizeof(inbuf), outbuf, sizeof(outbuf), &bytes, 
    NULL);

  return ret;
}

bool OpenDevice(void)
{
  // ATK ACPI driver must be installed ! (atkacpi.sys)
  hAcpi = CreateFile("\\.\ATKACPI", 
    GENERIC_READ|GENERIC_WRITE,
    FILE_SHARE_READ|FILE_SHARE_WRITE, 
    NULL, 
    OPEN_EXISTING, 
    0,
    NULL);

  return hAcpi != INVALID_HANDLE_VALUE;
}

bool ToggleLight(bool)
{                                                          
  // parameters : 
  //   code : which led 
  //   arg : dont change this
  //   state : true/false, may be inverted on some leds
  CtrlACPI(MLED, 1, true);

  return TRUE;
}

void CloseDevice(void)
{
  if (hAcpi != INVALID_HANDLE_VALUE)
    CloseHandle(hAcpi);
}
 

Once upon a day I bought an Asus A6R laptop. It has 4 notification led diodes underneath the touchpad. Two of them (power on, charging) are not software controlled, but the next two (mail, wifi) can be turned on/off by simple code you can find on this page. I am also a happy user of Miranda IM, and was wondering if it is possible to blink the leds when ICQ message arrives to me. So at first, I was looking for the code to control ACPI leds, firstly by disassembling original asus utilities (mail notify), but without success. Somehow I found needed code on some polish forum. Next step was to learn how to make plugins for miranda. Looking for most simple notify plugin I found very simple plugin that drives FDD motor on ICQ message. Combining this plugin with ASUS controlling code my plugin was born :) And that is what am I offering on this page - the plugin with source codes, or just the plugin dll.
Have fun, and please dont forget to sign my guestbook :)